WorkPoint API
Architecture
WorkPoint implements the OData v4 API. In most cases, any entity is support standard queries (POST, PUT, DELETE, GET, PATCH). The OData query language is supported (
http://www.odata.org/getting-started/basic-tutorial/#queryData). For specific entities, specialized actions and functions are available.
A full description of the metadata is
https://workpoint-app.com/odata/$metadata.
Authentication
Authentication is implemented using the OAuth 2.0 protocol. To get Access Token and Refresh Token, you need to call the endpoint:
[POST] https://passport.workpoint-app.com/connect/token Content-Type: application/x-www-form-urlencoded client_id=external&scope=wp_api offline_access&grant_type=password&username=***&password=****
In response, two keys are transmitted. Lifetime: Access Token - 1 hour, Refresh Token - 15 days.
Keeping a login and password is strongly not recommended - you need to get Refresh Token and use it to get Access Token. To update Access Token, you must call the endpoint:
[POST] https://passport.workpoint-app.com/connect/token Content-Type: application/x-www-form-urlencoded client_id=external&scope=wp_api offline_access&grant_type=refresh_token&refresh_token=***
To use Access Token, add it to the Authorization header as a line:
Bearer ***
Examples
Creating a User
[POST] http://workpoint-app.com/odata/Users Body: { Name: "Max Fry", Email: "MFry@demo.com", SupervisorId: "bcd753cc-0b80-57ae-a471-6ff7f06010e1", DepartmentId: "9468cd5c-ea04-4adb-a1d7-94b6b910ab2e" }
Adding a Permission Set for a User
[POST] http://workpoint-app.com/odata/UserPermissionSets Body: { UserId: "bcd753cc-0b80-57ae-a471-6ff7f06010e1", PermissionSetId: "9468cd5c-ea04-4adb-a1d7-94b6b910ab2e" }
Updating a User
[PATCH] http://workpoint-app.com/odata/Users(bcd753cc-0b80-57ae-a471-6ff7f06010e1) Body: { IsActive: false }
Querying users
[GET] workpoint-app.com/odata/Users? $select=Code,Name& $filter=DepartmentId eq 9468cd5c-ea04-4adb-a1d7-94b6b910ab2e& $expand=Supervisor($select=Name) Response: [{ "Code": "020", "Name": "Bill Troy", "Supervisor": null }, { "Code": "001", "Name": "Max Fry", "Supervisor":{ "Name": "Bill Troy" } }]