Copyright © Bentley Systems, Incorporated. All rights reserved.
A sample application that demonstrates how to use the endpoints from the 4D Schedules External API in a machine-to-machine context.
Detailed in the root directory README.md.
- Clone Repository
- Open
4D Schedules API Consumer.slnand Build - Set valid access token with scope 'enterprise' in command line argument
--tokeninProperties/launchSettings.json. - Set valid schedule ID in command line argument
--scheduleinProperties/launchSettings.json- this is equivalent to the project ID for the initial release. - Set a valid operation value, either
--singlefor querying a single endpoint (simply gets information on the given schedule),--postto send a POST request to the Resource Status History endpoint, or--paginationto send a query to a custom endpoint, which will keep querying that endpoint using the nextPageToken until it isnull. You must supply the page size after this option, which can be between 1-10000. If using the--paginationoption, you must specify the--endpointoption also, i.e./resources/userFieldValues.- The default behaviour (i.e. none of these options set) is to demonstrate an example workflow using the 4D Schedules External API - the program will fetch all Resource Status History items then get an individual ID from this list. Afterwards, it will send a POST request to the Resource Status History endpoint which will return a Change Request ID. This ID is then used to query the Change Requests endpoint, to show that the API has picked up this request.
- Run to debug
- Clone Repository
- Change directory into cloned folder
cd EsApi4DScheduleSampleApp - Build app with
dotnet build - Change directory into build folder
cd EsApi4DScheduleSampleApp/bin/Debug/net6.0/ - Run app with
dotnet EsApi4DScheduleSampleApp.dll --token "{your_token}" --schedule "{your_schedule}", additionally add either--single,--post, or--pagination {page_size}to the arguments. Note that only one of these can be used at a time, and if using the--paginationoption, you must also supply the--endpoint {your_endpoint}option with the specific endpoint you wish to query, i.e./resources/userFieldValues.
Detailed in the root directory README.md.
API documentation in OpenAPI V3 format:
- 4D Schedules External API: https://es-api.bentley.com/4dschedule/swagger/index.html
A token can also be acquired from this page for testing.