unee-t / enterprise-rest-api Goto Github PK
View Code? Open in Web Editor NEWRestFUL API on Unee-T enterprise
Home Page: https://eapi.dev.unee-t.com/
RestFUL API on Unee-T enterprise
Home Page: https://eapi.dev.unee-t.com/
requestorApiKey
)removedUserApiKey
)Return timestamp: date and time (Z) when the user was successfully removed from the unit.
Include descriptive error message
As part of #3 we also need an endpoint so that the 3rd party can check if the unit has been correctly created:
The information is available in the UNTE Database in the table unte_api_add_unit
.
From this table, it is possible to retrieve the following information
mefe_unit_id
: The MEFE id of the unituneet_created_datetime
: the timestamp when the unit was created in Unee-Tis_api_success
:
1
if the unit was created correctly0
if the there was an error while creating the unit.NULL
we have no information (this is the initial state until we receive a reply from the downstream systems)api_error_message
: the error message if applicable.In this option the 3rd party only needs the information from it's internal source of truth
The user sends the following information as part of the payload:
organizationKey
varchar(255): The UNTE API key for the 3rd party.externalId
varchar(255): the Unique ID of the unit in the source system: the system where the user information is coming from. This cannot be empty. (see #3)externalSystem
varchar(100): This is the name of the source of truth for unit information from the 3rd party.tableInExternalSystem
varchar(100): This is the table where the unit information are stored in the the source of truth for unit information from the 3rd party.infoNeeded
: this could be one of the following values:
All
- this will be the default value if nothing is specified.mefeUnitId
createdDatetime
created
errorMessage
Based on the value specified in infoNeeded
All
or [unspecified]:return all the information:
mefeUnitId
: the mefe unit id of the unitcreatedDatetime
: The timestamp (Z) when the unit was created in Unee-Tstatus
: This can either be
1
: success0
: errorNULL
: we have no information about the status of the request, request is still pending.errorMessage
: The error message (if applicable)mefeUnitId
:return the information:
mefeUnitId
: the mefe unit id of the unitcreatedDatetime
:return the information:
createdDatetime
: The timestamp (Z) when the unit was created in Unee-Tstatus
:return the information:
status
: This can either be
1
: success0
: errorNULL
: we have no information about the status of the request, request is still pending.errorMessage
:return the information:
errorMessage
: The error message (if applicable)In this option the 3rd party only need to have stored the requestId
that was generated when the unit creation was request (see #3)
The user sends the following information as part of the payload:
organizationKey
varchar(255): The UNTE API key for the 3rd party.requestId
varchar(255): the Unique ID of the request that was sent when the 3rd party requested the unit to be created (see #3)infoNeeded
: this could be one of the following values:
All
- this will be the default value if nothing is specifiedmefeUnitId
createdDatetime
created
errorMessage
Based on the value specified in infoNeeded
All
or [unspecified]:return all the information:
mefeUnitId
: the mefe unit id of the unitcreatedDatetime
: The timestamp (Z) when the unit was created in Unee-Tstatus
: This can either be
1
: success0
: errorNULL
: we have no information about the status of the request, request is still pending.errorMessage
: The error message (if applicable)mefeUnitId
:return the information:
mefeUnitId
: the mefe unit id of the unitcreatedDatetime
:return the information:
createdDatetime
: The timestamp (Z) when the unit was created in Unee-Tstatus
:return the information:
status
: This can either be
1
: success0
: errorNULL
: we have no information about the status of the request, request is still pending.errorMessage
:return the information:
errorMessage
: The error message (if applicable)This is done by passing some SQL variables and calling a specific procedure
@organization_key
: This can NOT be NULL
@request_id
:
@external_id
is NOT NULL (this means we are in Option 1)NULL
IF @external_id
is NULL (this means we are in Option 2)@external_id
: This can NOT be NULL
@request_id
is NULL (this means we are in Option 1)NULL
IF @request_id
is NOT NULL (this means we are in Option 2)@external_system
: This MUST be NULL
@request_id
is NOT NULL (this means we are in Option 2)@table_in_external_system
: This MUST be NULL
@request_id
is NOT NULL (this means we are in Option 2)@info_needed
: This MUST be NULL
if this is NOT specified by the 3rd partySET @organization_key = [organizationKey];
SET @request_id = [requestId];
SET @external_id = [externalId];
SET @external_system = [externalSystem OR NULL];
SET @table_in_external_system = [tableInExternalSystem OR NULL];
SET @info_needed = [infoNeeded OR NULL];
CALL `proc_unte_api_check_unit_creation` ;
external_property_id
: the Unique ID of the unit in the source system: the system where the user information is coming from. This cannot be empty.external_system
: System where this information is stored (if empty, we use the default table configured when the UNTE master account was created)table_in_external_system
: Table in the system where this information is stored (if empty, we use the default table configured when the UNTE master account was created)tower
: the block where the unit is located. if empty, we use 1
.SG
or AU
Return:
Include descriptive error message.
creator_id
is allowed to create a new unit.For example /persons maps to the persons table.
https://media.dev.unee-t.com/2019-04-04/tables.txt
What are the others?
THIS NEEDS TO BE UPDATED IN LINE WITH WHAT WAS DISCUSSED IN #3
Return timestamp: date and time (Z) when the unit was successfully modified
The request ID for the update request
Include descriptive error message.
requestorUserId
is allowed to edit the unit.requestorAPIKey
: the MEFE API Key of the user requesting the modification of the userModifiedUserApiKey
: the MEFE API Key for the user who needs to be addedSG
or AU
Return timestamp: date and time (Z) when the unit was successfully modified
Include descriptive error message.
requestorAPIKey
is allowed to Edit the user.requestorApiKey
)addedUserApiKey
)Return timestamp: date and time (Z) when the user was successfully added to the unit.
Include descriptive error message
requestorAPIKey
is allowed to add the user to the unit.One of the requirement of #3 is that the 3rd party uses a valid Unit Type when a unit is created or modified.
This document the API to retrieve the list of Active Unit Type
active
The list of active unit types
Below is the query to list this in the UNTE Database
SELECT `designation`
FROM `ut_unit_types`
WHERE `is_obsolete` = 0
;
all
The list of ALL unit types:
Below is the query to list this in the UNTE Database
SELECT `designation`
, `is_obsolete`
FROM `ut_unit_types`
;
One of the requirement of #3 is that the 3rd party uses a valid Country code when a unit is created or modified.
This document the API to retrieve the list of possible country codes.
not applicable (no input needed)
The list of countries and country codes
Below is the query to list this in the UNTE Database
SELECT `country_code`
, `country_name`
FROM `property_groups_countries`
;
SG
or AU
Returns:
Keep in mind that the same user can be associated to several different API keys giving him/her access to different units.
A user [email protected]
is created in Unee-T by a user [email protected]
.
The user [email protected]
will need to grant access to several units in his organization:
Unit 1-A
Unit 2-A
The user [email protected]
has:
mefe_unique_user_id
apikey_A
that grants him/her accesses and permissions to Unit 1-A
and Unit 2-A
User [email protected]
can only see the API key apikey_A
associated to [email protected]
.
User [email protected]
can use the API key apikey_A
to allow access to Unee-T via a 3rd party app created by Enterpirse A.
Another user [email protected]
"creates" the same user [email protected]
in Unee-T.
The user [email protected]
will need to grant access to several units in his organization:
Unit 1-B
Unit 2-B
The user [email protected]
has:
mefe_unique_user_id
apikey_B
that grants him/her accesses and permissions to Unit 1-B
and Unit 2-B
User [email protected]
can only see the API key apikey_B
associated to [email protected]
.
User [email protected]
can use the API key apikey_B
to allow access to Unee-T via a 3rd party app created by Enterpirse B.
Include descriptive error message.
creator_id
is allowed to create a new user.A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.