Principle
Some endpoints support relations expansion.
By default a GET endpoint will only return IDs of related data. For example this is what you get when calling the projects endpoint:
{
"id": "beb8c33c-9b2d-4285-a71e-2c369945ce37",
"name": "My project",
"owner": "39b5bca2-9fdf-4e7c-9a42-c3d0dfcf9b03",
"program": "94aa15f9-1156-41cc-86a2-86bc9cade0b6",
"status": "backlog",
"importance": "life-changing",
"risk": "high",
"mood": "complicated",
"progress": 20,
"start_date": "2022-02-15",
"end_date": "2022-12-30",
...
}On the project endpoints, relations owner and program only reference the ID of the corresponding object by default.
If you also need details about those relations, you can expand them and get a response like:
{
"id": "beb8c33c-9b2d-4285-a71e-2c369945ce37",
"name": "My project",
"owner": {
"id": "39b5bca2-9fdf-4e7c-9a42-c3d0dfcf9b03",
"given_name": "John",
"family_name": "Doe",
"name": "John Doe",
"initials": "JD",
"picture": "",
"current_position": "Project Manager"
},
"program": {
"id": "94aa15f9-1156-41cc-86a2-86bc9cade0b6",
"name": "Programme 1"
},
"status": "backlog",
"importance": "life-changing",
"risk": "high",
"mood": "complicated",
"progress": 20,
"start_date": "2022-02-15",
"end_date": "2022-12-30",
...
}Reference
Each endpoint in this API reference lists which properties can be expanded, if any. Expansion is available on some retrieve endpoints and some list endpoints.
You have the choice to expand all, some, or no properties. By default no property is expanded.
To expand one property, append ?expand=property_name to the request url. For example to expand the owner property of the projects endpoints, call GET https://api.airsaas.io/v1/project/?expand=owner.
To expand several properties, separate their names by ,. For example to expand owner and program on the project endpoints, call GET https://api.airsaas.io/v1/project/?expand=owner,program.
To expand all properties that are expandable, you can use the shortcut ?expand=*. For example to expand all fields of the projects endpoints, call GET https://api.airsaas.io/v1/project/?expand=*.
