๐ก Our APIs are undergoing a transition. In our effort to support a connected ecosystem of construction tools, we are building a catalogue of APIs that allow customers or partners to create integrations or applications on top of the Aphex platform.
The Aphex Tasks API is the first of these new endpoints, providing structured access to the live production dataset. This endpoint is currently in closed testing for selected partners. To talk about integrating with Aphex, shout out at hello@aphex.co
Overview
The foundation of the Aphex data model is a task. Tasks reflect the planned work of users and projects and contain all of the crucial known attributes as properties.
For customers and partners seeking to consume or present information about plans in other applications or services, the Tasks API is likely the primary source.
Our APIs follow the essence of REST and all queries must be made via HTTPS to pass the endpoint security rules.
Understanding the Aphex Data Model
The Aphex APIs provide access to objects and records in the Aphex Hierarchy. The following are the standard objects in Aphex;
Object | Description | API Status |
Tasks | Partner Testing | |
Packages | Planned | |
Projects | Planned | |
Task Revisions | Complete revision history of the Task Object | Planned (object currently accessible via the Task Events API) |
Published Versions | The periodic history of project plans reflects the state of a project over time. | Planned (object currently accessible via the Power BI API) |
Records | A log of actuals or quasi-actual events that relate to a planned task | Planned |
Querying the Tasks API
Get Tasks
Returns a list of tasks meeting the conditions specified in the filter parameters. Operators on the same parameter type are treated as OR queries, whilst different parameters are treated as AND queries.
curl https://data.aphex.co/v1/tasks
-H "Authorization: Bearer {project_api_token}"
Query Parameters
The query accepts the following parameters;
Parameters | Description |
start string | YYYY-MM-DD formatted date |
shift string | day | afternoon | night | 24hr |
owner.id string | owner ID |
package.id string | package ID |
wbsCode.id string | WBS code ID |
location.id string | location ID |
calendar.id string | calendar ID |
subcontractor.id string | subcontractor ID |
assignedTo.ids string | comma-delimited user IDs |
Response
{
"paging": {
"next": {
"after": "string",
"link": "string"
}
},
"results": {
"assignedTo": [
{
"email": "string",
"id": "string",
"name": "string"
}
],
"calendar": {
"id": "string",
"name": "string",
"type": "five-day"
},
"duration": 0,
"externalId": "string",
"finish": "string",
"id": "string",
"keyTask": true,
"labour": [
{
"id": "string",
"name": "string",
"quantity": 0
}
],
"location": {
"id": "string",
"name": "string",
"type": "map"
},
"materials": [
{
"dailyActual": [
{
"date": "string",
"quantity": 0
}
],
"dailyPlanned": [
{
"date": "string",
"quantity": 0
}
],
"id": "string",
"name": "string",
"quantity": 0,
"unit": "string"
}
],
"name": "string",
"owner": {
"email": "string",
"id": "string",
"name": "string"
},
"package": {
"code": "string",
"id": "string",
"name": "string"
},
"parent": {
"id": "string",
"name": "string"
},
"plant": [
{
"category": "string",
"id": "string",
"name": "string",
"quantity": 0
}
],
"relatedTasks": [
{
"id": "string",
"lag": 0,
"name": "string",
"relation": "predecessor",
"type": "start-start"
}
],
"shift": "day",
"start": "string",
"status": [
{
"amount": 0,
"date": "string",
"name": "string",
"type": "delay"
}
],
"subcontractor": {
"id": "string",
"name": "string"
},
"wbsCode": {
"code": "string",
"id": "string",
"name": "string",
"parentId": "string",
"path": "string"
},
"workArea": {
"bbox": [
0
],
"geometry": "string",
"id": "string",
"properties": {
"additionalProp1": {}
},
"type": "string"
}
}
}
Authentication
You can access the Work Area API by querying the endpoint URL for your desired project and providing a valid Token.
Whilst in Preview Mode, tokens are generated on request by the AphexHQ team. Please contact us at hello@aphex.co.
Limits and Restrictions
When widely available, the Tasks API will have a small number of restrictions and limits to ensure the availability of the system and the security of customer data.
Token Management Restrictions: Tokens will be generated on Aphex Projects by a project administrator to provide visibility and control of their data and support partners to build and test integrations for specific projects.
Publication Limit: To maintain system availability, a Publication Limit exists for the Work Area API. Successful API requests will return up to a maximum of five (5) of the most recent Publications of data.
Limits: The new Aphex APIs will have daily and interval-based limits to ensure the availability of the service for all users. During partner testing, a sensible use policy applies.
API Errors
The following errors may be returned;
403: Unauthorized
The query does meet the authorization requirements. Please check your Token and use the Bearer Authorization schema
422: Invalid Query
The query is invalid. Check your query parameters are supported by this API
500: Internal Server Error