{"swaggerDoc":{"swagger":"2.0","schemes":["http","https"],"basePath":"/api","consumes":["application/json"],"produces":["application/json"],"info":{"title":"Activigie public API documentation","description":"Swagger used from the Activigie Public API.\n\nWe use OData protocol for querying this API. Feel free to check the core documentation at https://www.odata.org/documentation/odata-version-3-0/odata-version-3-0-core-protocol/\n","version":"2.6.0"},"securityDefinitions":{"AuthHeader":{"type":"apiKey","in":"header","name":"X-ZUMO-AUTH","description":"Token that as been generated by the api/login route."}},"definitions":{"AuthCredentials":{"type":"object","description":"Data that are usefull for getting authentified data","properties":{"token":{"type":"string"},"tokenExpiration":{"type":"integer","description":"Timestamp when the token will expire in seconds since UNIX epoch"}}},"Company":{"type":"object","description":"Company","required":["name","domiciliation","identifier","divisionId"],"properties":{"id":{"type":"string","readOnly":true},"createdAt":{"type":"string","format":"dateTime","readOnly":true,"description":"Internal usage, do not use in any way"},"updatedAt":{"type":"string","format":"dateTime","readOnly":true,"description":"Internal usage, do not use in any way"},"name":{"type":"string","description":"Name of the company (raison sociale)"},"domiciliation":{"type":"string","description":"Country place where the company is registered","enum":["France","Europe","Other"]},"identifier":{"type":"string","description":"Can be a SIRET, a DUNS or TVA."},"street1":{"type":"string"},"street2":{"type":"string"},"zipCode":{"type":"string"},"city":{"type":"string"},"country":{"type":"string"},"ape":{"type":"string"},"phone":{"type":"string","description":"office phone"},"divisionId":{"type":"string","description":"ID of the division of the company"},"mobilePhone":{"type":"string"},"emailContact":{"type":"string","description":"Email of the contact. At register, it's the first admin contact"},"isBtp":{"type":"boolean","default":false,"description":"Indicates if the company is a BTP one, so that we can use the BTP Card scanning feature."},"isValid":{"type":"boolean","description":"Indicates if the company is allowed to enter in the site."},"corporationCheckStatus":{"type":"string"},"isRank2":{"type":"boolean","description":"Indicates if the company is rank 2 or more (if false, the company is rank 1)."}}},"People":{"type":"object","description":"Employee, Interim or SubleaseEmployee","required":["firstname","lastname"],"properties":{"id":{"type":"string","readOnly":true,"description":"Unique ID of the people"},"createdAt":{"type":"string","format":"dateTime","readOnly":true,"description":"Date when this people has been created."},"updatedAt":{"type":"string","format":"dateTime","readOnly":true,"description":"Last update of this people"},"companyId":{"type":"string","description":"ID of the company this people is attached to."},"companyName":{"type":"string","description":"Name of the company this people is attached to."},"firstname":{"type":"string"},"lastname":{"type":"string"},"birthday":{"type":"string","format":"dateTime","description":"Birthday of the people in date format."},"nationality":{"type":"string","description":"Nationality of the people."},"function":{"type":"string","description":"Job in the company."},"contractType":{"type":"string","enum":["fixedTerm","permanent","manager","trainee","selfEmployed","apprentice","seasonalContract","CUICAE","locatier"],"description":"contract type for employees only; fixedTerm (french CDD), permanentContrat (french CDI)"},"startedAt":{"type":"string","format":"dateTime","description":"When the contract started."},"endAt":{"type":"string","format":"dateTime","description":"When the contract has or will ended. Only applicable for contract types that have an ending."},"isValid":{"type":"boolean","description":"Indicates if the people is allowed to enter in the site."},"kind":{"type":"string","description":"(previously peopleType). Gives the type of the people (employee, interim or subleaseEmployee)","enum":["employee","interim","subleaseEmployee"]},"validationState":{"type":"string","description":"ValidationState of the person"},"motifIncompleted":{"type":"string","description":"reason why the person is incompleted"},"refusedReason":{"type":"string","description":"reason why the person is refused"}}},"Site":{"type":"object","description":"Site","required":["name"],"properties":{"id":{"type":"string","readOnly":true},"createdAt":{"type":"string","format":"dateTime","readOnly":true,"description":"Internal usage, do not use or update in any way"},"updatedAt":{"type":"string","format":"dateTime","readOnly":true,"description":"Internal usage, do not use or update in any way"},"name":{"type":"string","description":"Name of the site"},"description":{"type":"string"},"typology":{"type":"string","enum":["static","mobile"],"description":"Kind of site. Mobile if there is multiple places, static if only one place"},"street1":{"type":"string"},"street2":{"type":"string"},"zipCode":{"type":"string"},"city":{"type":"string"},"country":{"type":"string"},"latitude":{"type":"number"},"longitude":{"type":"number"},"companyId":{"type":"string","description":"Id of the company that own this site"},"companyName":{"type":"string","description":"Name of the owner company.","readOnly":true},"companyIdentifier":{"type":"string","description":"Identifier of the owner company.","readOnly":true},"operationStartDate":{"type":"string","format":"dateTime"},"operationEndDate":{"type":"string","format":"dateTime"}}},"SiteControlInfo":{"type":"object","description":"Get datas of the controls and siteControlEntries","properties":{"id":{"type":"string","readOnly":true,"description":"ID of the siteControlEntry"},"siteId":{"type":"string","description":"ID of the site"},"siteName":{"type":"string","description":"Name of the site"},"siteControlId":{"type":"string","description":"ID of the control"},"controllerId":{"type":"string","description":"ID of the controller"},"controleur":{"type":"string","description":"Firstname and lastname of the controller"},"Lieu du Controle":{"type":"string","description":"Place of the control"},"startedAt":{"type":"string","format":"dateTime","description":"Starting date of the control"},"endedAt":{"type":"string","format":"dateTime","description":"Ending date of the control"},"comment":{"type":"string","description":"comment of the controller on the siteControlEntry"},"kind":{"type":"string","description":"Kind of the siteControlEntry (valid or incident)"},"referenceCompanyId":{"type":"string","description":"ID of the company that has the person"},"referenceCompanyName":{"type":"string","description":"Name of the company that has the person"},"identifier":{"type":"string","description":"Identifier of the company that has the person (SIRET, TVA, DUNS)"},"referenceId":{"type":"string","description":"ID of the person"},"referenceFirstname":{"type":"string","description":"Firstname of the person"},"referenceLastname":{"type":"string","description":"Lastname of the person"},"referenceKind":{"type":"string","description":"Kind of the person (employee, interim, subleaseEmployee)"},"incidentType":{"type":"string","description":"Type of incident"},"incidentOtherReason":{"type":"string","description":"Other reason of the incident"},"isActive":{"type":"boolean","description":"The resolution state of the incident (0 = solved)"},"solvedAt":{"type":"string","format":"dateTime","description":"Date of resolution of the incident"},"solvedBy":{"type":"string","description":"ID of the user who solved the incident"},"solvedByFirstname":{"type":"string","description":"Firstname of the user who solved the incident"},"solvedByLastname":{"type":"string","description":"Lastname of the user who solved the incident"},"commentDo":{"type":"string","description":"Comment of the DO on the siteControlEntry"}}},"Standard":{"type":"object","description":"Standard response with status and error type","properties":{"status":{"type":"boolean"},"error":{"type":"string","description":"if the status is false, describes the error"}}}},"paths":{"/api/login":{"post":{"summary":"Generate access credentials","description":"Generate access credentials with a provided API Key. This authentication is valid 1 day, and should be generated again passed this delay.","tags":["Authentication"],"operationId":"login","consumes":["application/json"],"parameters":[{"in":"body","name":"data","description":"the user to login","required":true,"schema":{"type":"object","required":["apiKey"],"properties":{"apiKey":{"type":"string","description":"the key that has been transmitted by Activigie"},"controllerId":{"type":"string","description":"the ID of the controller, used for some routes"},"companyId":{"type":"string","description":"the ID of the company, used for some routes"}}}},{"name":"zumo-api-version","description":"The API version","required":true,"type":"string","in":"header","default":"2.0.0"}],"produces":["application/json"],"responses":{"200":{"description":"Connected, get credentials","schema":{"$ref":"#/definitions/AuthCredentials"}},"404":{"description":"The user has not been found"}}}},"/api/{siteId}/people":{"get":{"tags":["People"],"summary":"Find the employees, interims and sublease employees of a site","description":"Return all the employees, interims and sublease employees of a site.","security":[{"AuthHeader":[]}],"parameters":[{"name":"siteId","description":"The site identifier","required":true,"type":"string","in":"path"},{"name":"zumo-api-version","description":"The API version","required":true,"type":"string","in":"header","default":"2.0.0"},{"name":"$filter","description":"OData filter clause","required":false,"type":"string","in":"query"},{"name":"$orderby","description":"OData order by clause","required":false,"type":"string","in":"query"},{"name":"$skip","description":"OData skip clause","required":false,"type":"integer","in":"query"},{"name":"$top","description":"OData top clause","required":false,"type":"integer","in":"query"},{"name":"$select","description":"OData select clause","required":false,"type":"string","in":"query"},{"name":"$inlinecount","description":"OData inline count clause","required":false,"type":"string","in":"query"}],"operationId":"FindSitePeople","responses":{"200":{"description":"All data","schema":{"type":"array","items":{"$ref":"#/definitions/People"}}},"400":{"description":"The format of the request was incorrect"},"401":{"description":"Credential are invalid or has been expired"},"404":{"description":"This resource doesn't exists"},"500":{"description":"An internal error occurred"}}}},"/api/{siteId}/companies":{"get":{"tags":["Companies"],"summary":"Find companies of a site","description":"Return all companies of a site.","security":[{"AuthHeader":[]}],"parameters":[{"name":"siteId","description":"The site identifier","required":true,"type":"string","in":"path"},{"name":"zumo-api-version","description":"The API version","required":true,"type":"string","in":"header","default":"2.0.0"},{"name":"$filter","description":"OData filter clause","required":false,"type":"string","in":"query"},{"name":"$orderby","description":"OData order by clause","required":false,"type":"string","in":"query"},{"name":"$skip","description":"OData skip clause","required":false,"type":"integer","in":"query"},{"name":"$top","description":"OData top clause","required":false,"type":"integer","in":"query"},{"name":"$select","description":"OData select clause","required":false,"type":"string","in":"query"},{"name":"$inlinecount","description":"OData inline count clause","required":false,"type":"string","in":"query"}],"operationId":"FindSiteCompanies","responses":{"200":{"description":"All data","schema":{"type":"array","items":{"$ref":"#/definitions/Company"}}},"400":{"description":"The format of the request was incorrect"},"401":{"description":"Credential are invalid or has been expired"},"404":{"description":"This resource doesn't exists"},"500":{"description":"An internal error occurred"}}}},"/api/{siteId}/control":{"post":{"tags":["Controls"],"summary":"Insert a bunch of controls","description":"Insert a bunch of controls","security":[{"AuthHeader":[]}],"parameters":[{"name":"siteId","description":"The site identifier","required":true,"type":"string","in":"path"},{"name":"zumo-api-version","description":"The API version","required":true,"type":"string","in":"header","default":"2.0.0"},{"name":"body","description":"The list of entries","required":true,"schema":{"type":"object","required":["known","unknown"],"properties":{"known":{"type":"array","items":{"type":"object","required":["authorized","id","companyId","lastname","firstname","companyName"],"properties":{"id":{"type":"string"},"companyId":{"type":"string"},"lastname":{"type":"string"},"firstname":{"type":"string"},"companyName":{"type":"string"},"function":{"type":"string"},"date":{"type":"string"},"authorized":{"type":"boolean"}}}},"unknown":{"type":"array","items":{"type":"object","required":["lastname","firstname","companyName","peopleType"],"properties":{"lastname":{"type":"string"},"firstname":{"type":"string"},"companyName":{"type":"string"},"companyAddress":{"type":"string"},"siretNumber":{"type":"string"},"companyPhone":{"type":"string"},"function":{"type":"string"},"peopleType":{"type":"string","enum":["employee","interim","pmo"]}}}}}},"in":"body"}],"operationId":"InsertControlEntries","responses":{"200":{"description":"Entries has been inserted"},"400":{"description":"The format of the request was incorrect"},"401":{"description":"Credential are invalid or has been expired"},"404":{"description":"This resource doesn't exists"},"500":{"description":"An internal error occurred"}}}},"/api/{siteId}/sitecontrolinfo":{"get":{"tags":["SiteControlInfo"],"summary":"Find the people controlled on a site","description":"Find the people controlled on a site","security":[{"AuthHeader":[]}],"parameters":[{"name":"siteId","description":"The site identifier","required":true,"type":"string","in":"path"},{"name":"zumo-api-version","description":"The API version","required":true,"type":"string","in":"header","default":"2.0.0"},{"name":"$filter","description":"OData filter clause","required":false,"type":"string","in":"query"},{"name":"$orderby","description":"OData order by clause","required":false,"type":"string","in":"query"},{"name":"$skip","description":"OData skip clause","required":false,"type":"integer","in":"query"},{"name":"$top","description":"OData top clause","required":false,"type":"integer","in":"query"},{"name":"$select","description":"OData select clause","required":false,"type":"string","in":"query"},{"name":"$inlinecount","description":"OData inline count clause","required":false,"type":"string","in":"query"}],"operationId":"FindSiteControlInfo","responses":{"200":{"description":"All data","schema":{"type":"array","items":{"$ref":"#/definitions/SiteControlInfo"}}},"400":{"description":"The format of the request was incorrect"},"401":{"description":"Credential are invalid or has been expired"},"404":{"description":"This resource doesn't exists"},"500":{"description":"An internal error occurred"}}}},"/api/relaunch":{"post":{"tags":["Relaunch"],"summary":"Relaunch a company from a site","description":"Relaunch a specific company for a site. Relaunch for his incident, employees and users.","security":[{"AuthHeader":[]}],"parameters":[{"name":"zumo-api-version","description":"The API version","required":true,"type":"string","in":"header","default":"2.0.0"},{"name":"body","description":"The list of entries","required":true,"schema":{"type":"object","required":["siteId","companyId"],"properties":{"siteId":{"type":"string"},"companyId":{"type":"string"}}},"in":"body"}],"operationId":"RelaunchCompany","responses":{"200":{"description":"Relaunch started"},"400":{"description":"The format of the request was incorrect"},"401":{"description":"Credential are invalid or has been expired"},"500":{"description":"An internal error occurred"}}}},"/api/site/{id}":{"get":{"tags":["Site"],"summary":"Get site details","description":"Return all details of a site","security":[{"AuthHeader":[]}],"parameters":[{"name":"id","description":"The site identifier","required":true,"type":"string","in":"path"},{"name":"zumo-api-version","description":"The API version","required":true,"type":"string","in":"header","default":"2.0.0"}],"operationId":"FindSiteDetails","responses":{"200":{"description":"All data","schema":{"$ref":"#/definitions/Site"}},"400":{"description":"The format of the request was incorrect"},"401":{"description":"Credential are invalid or has been expired"},"500":{"description":"An internal error occurred"}}}},"/api/site":{"get":{"tags":["Site"],"summary":"Find site of the controllerUser","description":"Find list of site","security":[{"AuthHeader":[]}],"parameters":[{"name":"zumo-api-version","description":"The API version","required":true,"type":"string","in":"header","default":"2.0.0"}],"operationId":"FindSite","responses":{"200":{"description":"All data","schema":{"type":"array","items":{"$ref":"#/definitions/Site"}}},"400":{"description":"The format of the request was incorrect"},"401":{"description":"Credential are invalid or has been expired"},"404":{"description":"This resource doesn't exists"},"500":{"description":"An internal error occurred"}}}},"/api/ping":{"get":{"description":"Return the state of the service","tags":["Tools"],"operationId":"ping","responses":{"200":{"description":"OK","type":"object","properties":{"status":{"type":"string","enum":["OK","NOK"],"description":"OK if all services are up and ready, NOK if some are not properly working"}}}}}}},"responses":{"UnauthorizedError":{"description":"Authorization Token missing","headers":{"WWW_Authenticate":{"type":"string"}}},"NotFound":{"description":"The item has not been found"}}},"customOptions":{}}