curl Examples
This section includes some examples of how to send requests to the Oracle Construction and Engineering Lobby API using curl.
curl Options
The following table summarizes the curl options used in the examples:
Option | Description |
---|---|
-location
|
API endpoint. |
-request
|
Type of command:
|
-header
|
Content-Type: Media type of the body of the request:
Authorization:
|
-raw data
|
Identifies the json data. |
To use curl to interact with the API, enter the curl command followed by one or more curl options and a valid API endpoint.
For example:
curl --request <command> --location https://<SERVER_URL>/api/<endpoint> \
Element | Description |
---|---|
<SERVER_URL>
|
The server URL where the application is deployed. For example: constructionandengineering.oraclecloud.com constructionandengineering-ea.oraclecloud.com constructionandengineering-au2.oraclecloud.com |
<command>
|
The REST API method of the API. Example:
GET ,
POST
|
API Examples
The following examples demonstrate how to use curl to access the Oracle Construction and Engineering Lobby API.
Note:
Note: You must generate the token with a Lobby user that has the organization admin role assigned.To get a list of my organizations
curl –request GET --location 'https://constructionandengineering.oraclecloud.com/api/user/organizations' \
To get a list of the applications I use
curl –request GET --location 'https://constructionandengineering.oraclecloud.com/api/user/appinstance' \
To create a Lobby user using JSON data
API requests that use the
POST
method require additional data. Pass additional data to curl using the
-data-raw
option.
curl –-request POST --location 'https://constructionandengineering.oraclecloud.com/api/user' \ --header 'Content-Type: application/json' \ --header 'Authorization: <Bearer Token>' \ --data-raw '{"lobbyUser" : { "email": "poleary@majestic.com", "firstName": "P", "lastName": "Oleary", "middleName": "D", "language": "en_AU", "lobbyOrganizationId": "00005", "setPassword": "true", }, "aconexUsers":[] } }'
To create a Lobby user and Aconex user with no assigned projects using JSON data
curl –-request POST --location 'https://constructionandengineering.oraclecloud.com/api/user' \ --header 'Content-Type: application/json' \ --data-raw '{"lobbyUser" : { "email": "poleary@majestic.com", "firstName": "P", "lastName": "Oleary", "middleName": "D", "language": "en_AU", "lobbyOrganizationId": "00005", "setPassword": "true", }, "aconexUsers": [ { "appInstanceId": "8001", "aconexOrganizationId": "99990000" } ] }'
To create a Lobby user and 2 Aconex users with no assigned projects using JSON data
curl –-request POST --location 'https://constructionandengineering.oraclecloud.com/api/user' \ --header 'Content-Type: application/json' \ --data-raw '{"lobbyUser" : { "email": "poleary@majestic.com", "firstName": "P", "lastName": "Oleary", "middleName": "D", "language": "en_AU", "lobbyOrganizationId": "00005", "setPassword": "true", }, "aconexUsers": [ { "appInstanceId": "8001", "aconexOrganizationId": "99990000"}, { "appInstanceId": "8004", "aconexOrganizationId": "123498575"} ] }'
To create a Lobby user and Aconex users one assigned to projects and one not using JSON data
curl –-request POST --location 'https://constructionandengineering.oraclecloud.com/api/user' \ --header 'Content-Type: application/json' \ --data-raw '{"lobbyUser" : { "email": "poleary@majestic.com", "firstName": "P", "lastName": "Oleary", "middleName": "D", "language": "en_AU", "lobbyOrganizationId": "00005", "setPassword": "true", }, "aconexUsers": { "appInstanceId": "8001" "aconexOrganizationId": "99990000", "projectIds":["34557890", "4322456","234450000"}, { "appInstanceId": "8004", "aconexOrganizationId": "123498575"} ] }'