REST API
The REST API handles CRUD (Create, Retrieve, Update, Delete) operations for all entities, retrieving data using the FETCH language and executing custom workflows.
All URLs in this documentation are relative to the base REST URL https://{instanceName}/rest
.
- 1 GET, POST: /
- 1.1 Parameters
- 1.2 Responses
- 2 GET, OPTIONS: /auth
- 2.1 Parameters
- 2.2 Responses
- 3 GET: /entity/{entityName}/{key}
- 3.1 Parameters
- 3.2 Responses
- 4 POST: /entity/{entityName}
- 5 POST: /entity/{entityName}/{key}
- 5.1 Parameters
- 5.2 Payload
- 5.3 Responses
- 6 DELETE: /entity/{entityName}/{key}
- 6.1 Parameters
- 6.2 Responses
- 7 POST: /workflow/{workflowName}/{workflowMethod}
- 7.1 Parameters
- 7.2 Payload
- 7.3 Responses
- 7.4 Example
- 8 POST: /fetch
- 8.1 Parameters
- 8.2 Payload
- 8.3 Response
- 8.4 Example
GET, POST: /
Server information and authentication.
Until 1.7.0
Parameters
Name | Where | Description | Schema |
---|---|---|---|
user | query | the user name | string |
password | query | the user password | string |
Responses
200 Ok
The operation was successful.
{
"name": "ONE ERP Server",
"version": "1.5.0",
"clientAdress": "192.168.0.1",
"userName": "root",
"userKey": 1,
"userBusinessUnitKey": 1,
"userOrganizationKey": 1
}
401 Unauthorized
The operation is not authorized.
Check if the authentication cookie is set or valid or a valid username and password are set in the URL.
GET, OPTIONS: /auth
Authentication providers.
Parameters
None.
Responses
200 Ok
The operation was successful.
{"providers": [
{
"name": "facebook",
"url": "https://www.facebook.com/v3.1/dialog/oauth?client_id=...&scope=email&state=...&redirect_uri=..."
},
{
"name": "google",
"url": "https://accounts.google.com/o/oauth2/v2/auth?scope=openid email&access_type=offline&state=...&include_granted_scopes=true&redirect_uri=...&response_type=code&client_id=..."
},
{
"name": "yahoo",
"url": "https://api.login.yahoo.com/oauth2/request_auth?scope=openid&redirect_uri=...&response_type=code&nonce=xxx&state=...&client_id=..."
}
]}
GET: /entity/{entityName}/{key}
Retrieve an entity from the database.
Parameters
Name | Where | Required Value | Description | Schema |
---|---|---|---|---|
entityName | url | the name of the entity to retrieve | string | |
key | url | the key of the entity ro retrieve | long | |
Content-Type | headers | application/json | The content-type. |
Responses
200 Ok
The operation was successful.
400 Bad Request
There was an error deserializing the JSON message.
401 Unauthorized
The operation is not authorized.
Check if the authentication cookie is set or valid or a valid username and password are set in the URL.
500 Internal Error
All errors except for JSON message deserialization errors.
POST: /entity/{entityName}
POST: /entity/{entityName}/{key}
Create or update an instance of an entity.
Parameters
Name | Where | Required Value | Description | Schema |
---|---|---|---|---|
entityName | url | The name of the entity to update. | string | |
key | url | Optional. Only for updates. | long | |
Content-Type | headers | application/json | The content-type. |
Payload
Responses
200 Ok
The operation was successful.
400 Bad Request
There was an error deserializing the JSON message.
424 Entity Validation Failed
There was a business rule validation failure.
401 Unauthorized
The operation is not authorized.
Check if the authentication cookie is set or valid or a valid username and password are set in the URL.
500 Internal Error
All errors except for JSON message deserialization errors.
DELETE: /entity/{entityName}/{key}
Delete an entity.
Parameters
Name | Where | Required Value | Description | Schema |
---|---|---|---|---|
entityName | url | The name of the entity to delete | string | |
key | url | The key of the entity to delete. | long | |
Content-Type | headers | application/json | The content-type. |
Responses
200 Ok
The operation was successful.
400 Bad Request
There was an error deserializing the JSON message.
424 Entity Validation Failed
There was a business rule validation failure.
401 Unauthorized
The operation is not authorized.
Check if the authentication cookie is set or valid or a valid username and password are set in the URL.
500 Internal Error
All errors except for JSON message deserialization errors.
POST: /workflow/{workflowName}/{workflowMethod}
Execute a workflow.
Parameters
Name | Where | Required Value | Description | Schema |
---|---|---|---|---|
workflowName | url | The name workflow to run. | string | |
workflowMethod | url | The name of the workflow method to run. | string | |
Content-Type | headers | application/json | The content-type. |
Payload
Responses
200 Ok
The operation was successful.
400 Bad Request
There was an error deserializing the JSON message.
401 Unauthorized
The operation is not authorized.
Check if the authentication cookie is set or valid or a valid username and password are set in the URL.
500 Internal Error
All errors except for JSON message deserialization errors.
Example
POST: /workflow/AgeConcat/main
Code
Input (body)
Response
POST: /fetch
Execute a query against the database.
Parameters
Name | Where | Required Value | Description | Schema |
---|---|---|---|---|
Content-Type | headers | text/plain | The content-type. | string |
Payload
The fetch query. See FETCH query language.
Response
200 Ok
The operation was successful. The resultset:
400 Bad Request
There was an error deserializing the JSON message.
401 Unauthorized
The operation is not authorized.
Check if the authentication cookie is set or valid or a valid username and password are set in the URL.
500 Internal Error
All errors except for JSON message deserialization errors.
Example
POST: /fetch
Input (body)
Response