{"swagger":"2.0","info":{"description":"Api Documentation","version":"1.0","title":"Api Documentation","termsOfService":"urn:tos","contact":{},"license":{"name":"Apache 2.0","url":"http://www.apache.org/licenses/LICENSE-2.0"}},"host":"service.chromeriver.com","basePath":"/","tags":[{"name":"Entity (V2)","description":"V2 Entity Controller"},{"name":"Entity (V1)","description":"V1 Entity Controller"},{"name":"Entity Type","description":"Entity Type Controller"}],"schemes":["https"],"paths":{"/v1/entities":{"get":{"tags":["Entity (V1)"],"summary":"Get list of Entities","description":"This web service allows an external application to get a list of active entities. This endpoint does not provide filtering by entity code, type code, or status. If filtering is necessary, use GET v2/entities.","operationId":"getUsingGET","produces":["application/json"],"parameters":[{"name":"chain-id","in":"header","description":"Used for tracking the flow of the request","required":false,"type":"string"},{"name":"customer-code","in":"header","description":"Unique customer identifier provided by Chrome River","required":true,"type":"string"},{"name":"x-api-key","in":"header","description":"API key for Authentication ","required":true,"type":"string"}],"responses":{"200":{"description":"OK","schema":{"type":"array","items":{"$ref":"#/definitions/Entity"}}},"400":{"description":"Customer Code is invalid."},"503":{"description":"Service unavailable."}},"deprecated":false},"post":{"tags":["Entity (V1)"],"summary":"Create/Update Entities","description":"This web service allows an external application to create or update a list of entities.","operationId":"upsertEntitiesUsingPOST","consumes":["application/json"],"produces":["application/json"],"parameters":[{"name":"chain-id","in":"header","description":"Used for tracking the flow of the request","required":false,"type":"string"},{"name":"customer-code","in":"header","description":"Unique customer identifier provided by Chrome River","required":true,"type":"string"},{"in":"body","name":"entities","description":"List of entities","required":false,"schema":{"type":"array","items":{"$ref":"#/definitions/Entity"}}},{"name":"x-api-key","in":"header","description":"API key for Authentication ","required":true,"type":"string"}],"responses":{"200":{"description":"All entities were processed successfully","schema":{"type":"array","items":{"$ref":"#/definitions/ApiResponse"}}},"207":{"description":"Some of the entities couldn't be processed successfully.","schema":{"type":"array","items":{"$ref":"#/definitions/ApiResponse"}}},"400":{"description":"Customer Code is invalid."},"422":{"description":"Failed while processing all entities."},"503":{"description":"Service unavailable."}},"deprecated":false},"delete":{"tags":["Entity (V1)"],"summary":"Delete Entities","description":"This web service allows an external application to delete a list of entities.","operationId":"deleteEntitiesUsingDELETE","produces":["application/json"],"parameters":[{"name":"chain-id","in":"header","description":"Used for tracking the flow of the request","required":false,"type":"string"},{"name":"customer-code","in":"header","description":"Unique customer identifier provided by Chrome River","required":true,"type":"string"},{"in":"body","name":"entities","description":"List of entities","required":false,"schema":{"type":"array","items":{"$ref":"#/definitions/Entity"}}},{"name":"x-api-key","in":"header","description":"API key for Authentication ","required":true,"type":"string"}],"responses":{"200":{"description":"OK","schema":{"type":"array","items":{"$ref":"#/definitions/ApiResponse"}}},"204":{"description":"All Entities Are Deleted","schema":{"type":"array","items":{"$ref":"#/definitions/ApiResponse"}}},"207":{"description":"Any Combination of 204, 404, 410","schema":{"type":"array","items":{"$ref":"#/definitions/ApiResponse"}}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Entity Not Found"},"410":{"description":"Entity Already Deleted"},"503":{"description":"Service unavailable"}},"deprecated":false}},"/v1/entity-types":{"get":{"tags":["Entity Type"],"summary":"Gets list of Entity Types","description":"This web service allows an external application to fetch a list of Entity Types.  Only returns 100 max results of active entity types.","operationId":"getEntityTypesUsingGET","produces":["application/json"],"parameters":[{"name":"chain-id","in":"header","description":"Used for tracking the flow of the request","required":false,"type":"string"},{"name":"customer-code","in":"header","description":"Unique customer identifier provided by Chrome River","required":true,"type":"string"},{"name":"x-api-key","in":"header","description":"API key for Authentication ","required":true,"type":"string"}],"responses":{"200":{"description":"Entity Types were returned successfully","schema":{"type":"array","items":{"$ref":"#/definitions/EntityType"}}},"400":{"description":"Customer Code is invalid."},"503":{"description":"Service unavailable."}},"deprecated":false},"post":{"tags":["Entity Type"],"summary":"Create an Entity Type","description":"This web service allows an external application to create an Entity Type. \n\nDoes not support the 'languages'. Use POST /v1/entity-types/{entityTypeCode}/languages instead. \n\nThis endpoint does not act as an upsert. It will fail for existing entities, unless the entity already is inactive. If the entity is inactive, it'll reactivate the entity.","operationId":"createEntityTypeUsingPOST","consumes":["application/json"],"produces":["application/json"],"parameters":[{"name":"chain-id","in":"header","description":"Used for tracking the flow of the request.","required":false,"type":"string"},{"name":"customer-code","in":"header","description":"Unique customer identifier provided by Chrome River.","required":true,"type":"string"},{"in":"body","name":"entityType","description":"EntityType input JSON payload.","required":true,"schema":{"$ref":"#/definitions/EntityTypeModel"}},{"name":"x-api-key","in":"header","description":"API key for Authentication.","required":true,"type":"string"}],"responses":{"200":{"description":"Entity Type successfully created.","schema":{"$ref":"#/definitions/EntityTypeModel"}},"400":{"description":"Request is invalid. Please check the request specification and try again."},"410":{"description":"Entity Type Code already available in system."},"422":{"description":"The request was well-formed but was unable to be followed due to semantic errors."},"500":{"description":"Server error."},"503":{"description":"Service unavailable."}},"deprecated":false}},"/v1/entity-types/{code}":{"get":{"tags":["Entity Type"],"summary":"Get Entity Type by Code","description":"This web service allows an external application to fetch an Entity Type by its Code. Only returns active entities.","operationId":"getEntityTypeByCodeUsingGET","produces":["application/json"],"parameters":[{"name":"chain-id","in":"header","description":"Used for tracking the flow of the request.","required":false,"type":"string"},{"name":"code","in":"path","description":"Entity Type code","required":false,"type":"string"},{"name":"customer-code","in":"header","description":"Unique customer identifier provided by Chrome River","required":true,"type":"string"},{"name":"x-api-key","in":"header","description":"API key for Authentication ","required":true,"type":"string"}],"responses":{"200":{"description":"Entity Type was returned successfully","schema":{"$ref":"#/definitions/EntityType"}},"400":{"description":"Customer Code is invalid."},"404":{"description":"Code is invalid"},"503":{"description":"Service unavailable."}},"deprecated":false},"put":{"tags":["Entity Type"],"summary":"Put Entity Type by Code","description":"This web service allows an external application to replace an Entity Type by its Code. \n\nDoes not support the 'languages'. Use PUT /v1/entity-types/{entityTypeCode}/languages/{languageCode} instead.","operationId":"replaceEntityTypeByCodeUsingPUT","consumes":["application/json"],"produces":["application/json"],"parameters":[{"name":"chain-id","in":"header","description":"Used for tracking the flow of the request.","required":false,"type":"string"},{"name":"code","in":"path","description":"Entity Type code","required":false,"type":"string"},{"name":"customer-code","in":"header","description":"Unique customer identifier provided by Chrome River.","required":true,"type":"string"},{"in":"body","name":"entityType","description":"Entity Type body","required":true,"schema":{"$ref":"#/definitions/EntityTypeModel"}},{"name":"x-api-key","in":"header","description":"API key for Authentication.","required":true,"type":"string"}],"responses":{"200":{"description":"Entity Type was returned successfully","schema":{"$ref":"#/definitions/EntityTypeModel"}},"400":{"description":"Request is invalid. Please check the request specification and try again."},"422":{"description":"The request was well-formed but was unable to be followed due to semantic errors."},"503":{"description":"Service unavailable."}},"deprecated":false}},"/v1/entity-types/{entityTypeCode}":{"delete":{"tags":["Entity Type"],"summary":"Delete an entity-type","description":"This web service allows an external application to delete an Entity Type by entity-code","operationId":"deleteEntityTypeByCodeUsingDELETE","produces":["application/json"],"parameters":[{"name":"chain-id","in":"header","description":"Used for tracking the flow of the request.","required":false,"type":"string"},{"name":"customer-code","in":"header","description":"Unique customer identifier provided by Chrome River.","required":true,"type":"string"},{"name":"entityTypeCode","in":"path","description":"EntityType code.","required":true,"type":"string"},{"name":"x-api-key","in":"header","description":"API key for Authentication.","required":true,"type":"string"}],"responses":{"200":{"description":"Entity Type successfully deleted"},"400":{"description":"Customer Code is invalid."},"404":{"description":"Entity Type Code is unavailable."},"410":{"description":"Entity Type Code already deleted in system."},"500":{"description":"Server error."},"503":{"description":"Service unavailable."}},"deprecated":false}},"/v1/entity-types/{entityTypeCode}/languages":{"get":{"tags":["Entity Type"],"summary":"Gets list of language translations for the EntityType","description":"This web service allows an external application to get a list of localized names for the set of languages under the EntityType.","operationId":"getLanguagesUsingGET","produces":["application/json"],"parameters":[{"name":"chain-id","in":"header","description":"Used for tracking the flow of the request.","required":false,"type":"string"},{"name":"customer-code","in":"header","description":"Unique customer identifier provided by Chrome River.","required":true,"type":"string"},{"name":"entityTypeCode","in":"path","description":"Entity Type code","required":false,"type":"string"},{"name":"x-api-key","in":"header","description":"API key for Authentication.","required":true,"type":"string"}],"responses":{"200":{"description":"List of languages returned successfully","schema":{"type":"array","items":{"$ref":"#/definitions/EntityTypeLanguage"}}},"404":{"description":"The EntityType code does not exist"},"503":{"description":"Service unavailable."}},"deprecated":false},"post":{"tags":["Entity Type"],"summary":"Add a language to an EntityType","description":"This web service allows an external application to add a localized name to an EntityType. \n\nThis endpoint is not an upsert. Languages that aleady exist cannot be modified except through PUT /entity-types/{entityTypeCode}/languages/{languageCode}","operationId":"addLanguageUsingPOST","consumes":["application/json"],"produces":["application/json"],"parameters":[{"name":"chain-id","in":"header","description":"Used for tracking the flow of the request.","required":false,"type":"string"},{"name":"customer-code","in":"header","description":"Unique customer identifier provided by Chrome River.","required":true,"type":"string"},{"name":"entityTypeCode","in":"path","description":"Entity Type code","required":false,"type":"string"},{"in":"body","name":"entityTypeLanguage","description":"entityTypeLanguage","required":true,"schema":{"$ref":"#/definitions/EntityTypeLanguage"}},{"name":"x-api-key","in":"header","description":"API key for Authentication.","required":true,"type":"string"}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/EntityTypeLanguage"}},"201":{"description":"Language created successfuly","schema":{"$ref":"#/definitions/EntityTypeLanguage"}},"404":{"description":"The EntityType code does not exist"},"422":{"description":"Missing/Invalid values in language"},"503":{"description":"Service unavailable."}},"deprecated":false}},"/v1/entity-types/{entityTypeCode}/languages/{languageCode}":{"put":{"tags":["Entity Type"],"summary":"Modify a language to EntityType","description":"This web service allows an external application to alter existing localized name to an EntityType","operationId":"updateLanguageUsingPUT","consumes":["application/json"],"produces":["application/json"],"parameters":[{"name":"chain-id","in":"header","description":"Used for tracking the flow of the request.","required":false,"type":"string"},{"name":"customer-code","in":"header","description":"Unique customer identifier provided by Chrome River.","required":true,"type":"string"},{"name":"entityTypeCode","in":"path","description":"Entity Type code","required":true,"type":"string"},{"in":"body","name":"entityTypeLanguage","description":"entityTypeLanguage","required":true,"schema":{"$ref":"#/definitions/EntityTypeLanguage"}},{"name":"languageCode","in":"path","description":"Entity Type langauge code","required":true,"type":"string"},{"name":"x-api-key","in":"header","description":"API key for Authentication.","required":true,"type":"string"}],"responses":{"200":{"description":"Language modified successfuly","schema":{"$ref":"#/definitions/EntityTypeLanguage"}},"404":{"description":"The EntityType code/Locale does not exist"},"422":{"description":"Missing/Invalid values in language"},"503":{"description":"Service unavailable."}},"deprecated":false},"delete":{"tags":["Entity Type"],"summary":"Delete a language fromEntityType","description":"This web service allows an external application to delete a localized name from an EntityType","operationId":"deleteLanguageUsingDELETE","produces":["application/json"],"parameters":[{"name":"chain-id","in":"header","description":"Used for tracking the flow of the request.","required":false,"type":"string"},{"name":"customer-code","in":"header","description":"Unique customer identifier provided by Chrome River.","required":true,"type":"string"},{"name":"entityTypeCode","in":"path","description":"Entity Type code","required":false,"type":"string"},{"name":"languageCode","in":"path","description":"Language code","required":false,"type":"string"},{"name":"x-api-key","in":"header","description":"API key for Authentication.","required":true,"type":"string"}],"responses":{"200":{"description":"Language deleted successfuly","schema":{"type":"object"}},"404":{"description":"The EntityType code or language code does not exist"},"503":{"description":"Service unavailable."}},"deprecated":false}},"/v2/entities":{"get":{"tags":["Entity (V2)"],"summary":"Get List of Entities","description":"This web service allows an external application to get a list of active entities. This endpoint allows for filtering by entityCode, entityTypeCode or status.","operationId":"getUsingGET_1","produces":["application/json"],"parameters":[{"name":"chain-id","in":"header","description":"Used for tracking the flow of the request.","required":false,"type":"string"},{"name":"customer-code","in":"header","description":"Unique customer identifier provided by Chrome River.","required":true,"type":"string"},{"name":"entityCode","in":"query","description":"Entity code.","required":false,"type":"string","allowEmptyValue":false},{"name":"entityTypeCode","in":"query","description":"Entity type code.","required":false,"type":"string","allowEmptyValue":false},{"name":"isActive","in":"query","description":"Active flag. Defaults to (true).","required":false,"type":"boolean","default":true,"allowEmptyValue":false},{"name":"page","in":"query","description":"Page number. Defaults to (0).","required":false,"type":"integer","default":0,"format":"int32","allowEmptyValue":false,"x-example":0},{"name":"pageSize","in":"query","description":"Page size. Defaults to (0).","required":false,"type":"integer","default":0,"format":"int32","allowEmptyValue":false,"x-example":0},{"name":"status","in":"query","description":"Entity status filter: (ACT) active only, (INACT) inactive only, (ANY) either. When omitted, the isActive flag applies. Use (ANY) to tell an entity that was deactivated apart from one that never existed.","required":false,"type":"string","allowEmptyValue":false},{"name":"x-api-key","in":"header","description":"API key for Authentication.","required":true,"type":"string"}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/GetEntitiesApiResponse"}},"400":{"description":"Customer Code is invalid."},"503":{"description":"Service unavailable."}},"deprecated":false}},"/v2/entities/search":{"get":{"tags":["Entity (V2)"],"summary":"Search for Entities","description":"This web service allows an external application to search for entities. This endpoint allows search by search term and entityTypeId.","operationId":"searchUsingGET","produces":["application/json"],"parameters":[{"name":"chain-id","in":"header","description":"Used for tracking the flow of the request.","required":false,"type":"string"},{"name":"customer-code","in":"header","description":"Unique customer code provided by Chrome River","required":true,"type":"string"},{"name":"entityTypeId","in":"query","description":"Entity type Id","required":false,"type":"integer","format":"int32","allowEmptyValue":false},{"name":"languageId","in":"query","description":"The language id used to localize the entity type","required":false,"type":"integer","default":1,"format":"int32","allowEmptyValue":false},{"name":"page","in":"query","description":"Page number. Defaults to (0).","required":false,"type":"integer","default":0,"format":"int32","allowEmptyValue":false,"x-example":0},{"name":"pageSize","in":"query","description":"Page size. Defaults to (0).","required":false,"type":"integer","default":100,"format":"int32","allowEmptyValue":false,"x-example":0},{"name":"searchTerm","in":"query","description":"search term","required":false,"type":"string","allowEmptyValue":false},{"name":"x-api-key","in":"header","description":"API key for Authentication","required":true,"type":"string"}],"responses":{"200":{"description":"OK","schema":{"$ref":"#/definitions/GetEntitiesApiResponse"}},"400":{"description":"Customer code is invalid"},"401":{"description":"Unauthorized Customer code."},"403":{"description":"Customer code is forbidden to get expense types"},"503":{"description":"Service unavailable"}},"deprecated":false}}},"definitions":{"ApiResponse":{"type":"object","properties":{"entityCode":{"type":"string"},"entityTypeCode":{"type":"string"},"errorCode":{"type":"string"},"errorMessage":{"type":"string"},"operationType":{"type":"string","enum":["INSERT","UPDATE","DELETE"]},"result":{"type":"string","enum":["SUCCESS","FAIL"]}},"title":"ApiResponse"},"Entity":{"type":"object","required":["entityCode","entityTypeCode"],"properties":{"entityCode":{"type":"string"},"entityTypeCode":{"type":"string"},"extraData1":{"type":"string","description":"extraData for entity.  To remove value, set to empty string."},"extraData2":{"type":"string","description":"extraData for entity.  To remove value, set to empty string."},"extraData3":{"type":"string","description":"extraData for entity.  To remove value, set to empty string."},"extraData4":{"type":"string","description":"extraData for entity.  To remove value, set to empty string."},"extraData5":{"type":"string","description":"extraData for entity.  To remove value, set to empty string."},"sortOrder":{"type":"string","description":"SortOrder to be used by EntityType.SortType"},"status":{"type":"string","description":"ACT or DEL.  If not provided, no updates are done to existing entity, otherwise defaults to ACT for new entities","enum":["ACT","DEL"]},"entityId":{"type":"integer","format":"int32","description":"entity Id"},"localizedEntityName":{"type":"string","description":"entity name for the languageId"},"entityNames":{"type":"array","description":"List of names in different Locales.  List should always include an engligh locale (en) as default","items":{"$ref":"#/definitions/EntityLanguage"}}},"title":"Entity"},"EntityLanguage":{"type":"object","properties":{"locale":{"type":"string"},"name":{"type":"string"}},"title":"EntityLanguage"},"EntityType":{"type":"object","required":["code","description","name"],"properties":{"languages":{"type":"array","items":{"$ref":"#/definitions/EntityTypeLanguage"}},"code":{"type":"string","example":"DEPT"},"name":{"type":"string","example":"Department"},"description":{"type":"string","example":"List of departments"},"loadOnLogin":{"type":"boolean","description":"Flag to cache Entity Type during login process."},"sortType":{"type":"string","description":"Sort type for list of Entities for Entity Type","enum":["NAME","CODE","SORT_ORDER"]}},"title":"EntityType"},"EntityTypeLanguage":{"type":"object","required":["languageCode","name"],"properties":{"description":{"type":"string","description":"The description of the EntityType in specified language"},"languageCode":{"type":"string","example":"en, en_UK, fr, fr_CA","description":"The locale either ISO 639_1 or a combination of ISO 639_1 and ISO 3166"},"name":{"type":"string","description":"The name of the EntityType in specified language"}},"title":"EntityTypeLanguage"},"EntityTypeModel":{"type":"object","required":["code","description","name"],"properties":{"code":{"type":"string","example":"DEPT"},"name":{"type":"string","example":"Department"},"description":{"type":"string","example":"List of departments"},"loadOnLogin":{"type":"boolean","description":"Flag to cache Entity Type during login process."},"sortType":{"type":"string","description":"Sort type for list of Entities for Entity Type","enum":["NAME","CODE","SORT_ORDER"]}},"title":"EntityTypeModel"},"GetEntitiesApiResponse":{"type":"object","properties":{"entities":{"type":"array","items":{"$ref":"#/definitions/Entity"}},"total":{"type":"integer","format":"int32"}},"title":"GetEntitiesApiResponse"}}}