Location REST API v2
Background and strategic fit
This document describes the details of the Enterprise & Location structure APIs provided by ProcessMAP that will help the user retrieve the enterprise structure & further use to roll up that data for other modules.
Assumptions
ProcessMAP system User permissions would not be considered while exposing the data
Data will be shown in Readable JSON format
User accessing this endpoint through a valid Token & ConsumerId, provided by ProcessMAP, will have access to complete data
Org API will give the complete Enterprise hierarchy in a flat format. The location API will provide all location details in a flat format. The linkage between two APIs is the ImmediateLevelID field in the Location API. Using that the complete hierarchy can be achieved.
Only Level information is shown with ID. No location information. For mapping to location, we need to call location API which has ImmediateLevelID that can be mapped with the LevelID in this API & further self-joined to retrieve the complete hierarchy
Requirements
Steps | Title | Phase |
---|---|---|
Step-1 | An authentication token would be generated & shared to customers by ProcessMAP | Phase 1 |
Step-2 | Call the data API endpoints by passing the token from Step 1 as a parameter along with other required parameters. | Phase 1 |
User Interaction
Endpoints
Data APIs | UAT URLs | End Points |
---|---|---|
Loaction | (PASSING levelCode as OPTIONAL Parameter - URL will be changed) | papi/v1/locationoutbound/LocationInfo |
Enterprise | (PASSING levelCode as OPTIONAL Parameter - URL will be changed) | papi/v1/EnterpriseStrOutbound/EnterpriseInfo |
Headers
Name | Description | Sample | Mandatory/Optional |
---|---|---|---|
Authorization | Represents the value of the authentication token. Allow multiple values: no. | Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ... | Mandatory |
ConsumerId | Represents the value of the consumer id. Allow multiple values: no. | 2495 | Optional |
Parameters
Name | Description | Type | Additional information |
---|---|---|---|
levelCode | Represents the name of enterprise-level of the system for which data to be extracted. In Location API it will retrieve all locations belonging to the level & in Enterprise API it will get the complete hieraray of the level | string | Optional |
Sample Response Json Format:
Location Response
Existing
[
{
"Location Id": 11999,
"Location Name": "Koma Kulshan",
"Location Code": "Koma Kulshan"
}
]
Modified
[
{
"ImmediateLevelID": [
1003,
8804
],
"LocationId": 8731,
"LocationName": "Research Park",
"LocationCode": "Research Park",
"CompanyCode": "",
"Address": "120 1st Ave",
"Country": {
"id": 1001,
"value": "Wastelake"
},
"State_Province": "",
"City": "Melville",
"County": {
"id": 1001,
"value": "Wastelake"
},
"Postal_Zip": "58388",
"LocationStatus": "Active",
"BusinessType": "",
"OperationType": "",
"IndustryDescription": "",
"Comments": ""
},
{
"ImmediateLevelID": [
8773,
11359
],
"LocationId": 8789,
"LocationName": "Troy",
"LocationCode": "Troy",
"CompanyCode": "",
"Address": "Salisbury Industrial Park\r4005 Queens Avenue",
"Country": "United States",
"State_Province": "Michigan",
"City": "Troy",
"County": "",
"Postal_Zip": "",
"LocationStatus": "Active",
"BusinessType": "",
"OperationType": "",
"IndustryDescription": "",
"Comments": ""
}
]
Enterprise Response
New
[
{
"LevelCode": "By Division",
"LevelId": 1003,
"ParentLevelId": "1003",
"ParentLevel": "By Division",
"Depth": "0"
},
{
"LevelCode": "Shared Services",
"LevelId": 8703,
"ParentLevelId": "1003",
"ParentLevel": "By Division",
"Depth": "1"
},
{
"LevelCode": "Sales",
"LevelId": 8768,
"ParentLevelId": "1003",
"ParentLevel": "By Division",
"Depth": "1"
},
{
"LevelCode": "EnterpriseStructureDetails_Demo1",
"LevelId": 11506,
"ParentLevelId": "1003",
"ParentLevel": "By Division",
"Depth": "1"
},
{
"LevelCode": "Test1234",
"LevelId": 11593,
"ParentLevelId": "1003",
"ParentLevel": "By Division",
"Depth": "1"
},
{
"LevelCode": "Division 1",
"LevelId": 8811,
"ParentLevelId": "8810",
"ParentLevel": "Pipe Fabrication",
"Depth": "2"
},
{
"LevelCode": "Division 2",
"LevelId": 8812,
"ParentLevelId": "8810",
"ParentLevel": "Pipe Fabrication",
"Depth": "2"
},
{
"LevelCode": "test move Level",
"LevelId": 11439,
"ParentLevelId": "8818",
"ParentLevel": "Mechanical Contracting & Services",
"Depth": "3"
},
{
"LevelCode": "Testting",
"LevelId": 11442,
"ParentLevelId": "8823",
"ParentLevel": "Commercial Vehicle",
"Depth": "4"
},
{
"LevelCode": "DX",
"LevelId": 11519,
"ParentLevelId": "11518",
"ParentLevel": "CX",
"Depth": "4"
},
{
"LevelCode": "EX",
"LevelId": 11520,
"ParentLevelId": "11519",
"ParentLevel": "DX",
"Depth": "5"
}
]
Field Mapping:
Location Field List and Mapping
Product Field Name | Description | Field Type and Size |
---|---|---|
ImmediateLevelId | It is the reference Id for the Level Str. This indicates the immediate level to which the location is associated | Array |
LocationName | Location Name details | String |
LocationCode | Location Code details | String |
LocationId | A unique reference number for a location | Int |
CompanyCode |
| String |
Address | Address of the location | String |
Country | Country of the location | String |
State/Province | State of the location | String |
City | City of the location | String |
County | County of the location | String |
Postal/Zip | Zipcode of the location | Int |
LocationStatus | Location Status details | String |
BusinessType |
| String |
OperationType |
| String |
IndustryDescription |
| String |
Comments |
| String |
Enterprise Structure Field List and Mapping
Product Field Name | Description | Field Type and Size |
---|---|---|
LevelCode | Enterprise Structure name | String |
LevelId | Enterprise Structure unique identifier | Int |
ParentId | Parent Enterprise Structure Identifier | Int |
ParentName | Parent Enterprise Structure Name. Parent Level Name. In case of Root node the Parent Level name and Level name are the same. | String |
Depth | Hierarchy | Int |
Errors/Validation Messages
Generic Error codes are given below.
© 2018 ProcessMAP Corporation, All Rights Reserved Confidential, may not be disclosed without the express permission of ProcessMAP Corporation