The following macros are not currently supported in the header:
- style
List contract periods
UNDER DEVELOPMENT
The following endpoint can be used to grab periods available to a given contact.
GET /contracts/:id/periods
Â
Parameters
Table of allowed parameters.
_page | unsigned int | The page of the list to display. For example, 5 will display the fifth page. Each page contains 10 resources. |
---|---|---|
_limit | unsigned int | The maximum number of resources to return. Default is 10 and maximum is 50. |
_offset | unsigned int | The position in the list of resources to return from. For example, if you had 20 resources and requested an offset of 10. Resources 10 to 19 would be returned. Offset cannot be used in conjunction with _page . |
_fields | partial string | Allows you to specify optional fields and linked objects to include in the response. |
_filters | partial string | Â |
Filtering Contract Periods
You can filter the returned list using the _filters
 parameter.
Name | Example | Description |
---|---|---|
id | id(12,32) | Only return periods by given ids |
budget_type(<types>) | budget_types(pre-paid) | Only return periods by given budget types. |
allowance_type(<types>) | allowance_type(fixed-hours) | Only return periods by given allowance types. |
duration_type(<types>) | duration_type(fixed) | Only return periods by given duration types. |
rollover | service_item(yes) | Only return periods by given rollover values. |
contract | contract(12, 15) | Only return periods by given contract ids. |
contract_budget | contract_budget(22, 867) | Only return periods by given contract budget ids |
standing | standing(opened) | Only return periods by given standing statuses. |
date_commenced_before | date_commenced_before(1341281246) | Unix Timestamp. e.g 1341281246- Filter out companies that were not commenced before this date. |
date_commenced_after | date_commenced_after(1341281246) | Unix Timestamp. e.g 1341281246- Filter out companies that were not commenced after this date. |
date_closed_before | date_closed_before(1341281246) | Â |
date_closed_after | date_closed_after(1341281246) | Â |
date_expires_before | date_expires_before(1341281246) | Â |
date_expires_after | date_expires_after(1341281246) | Â |
date_created_before | date_created_before(1341281246) | Â |
date_created_after | date_created_after(1341281246) | Â |
NEW <field_name>_greater_than(<value>), <field_name>_less_than(<value>), <field_name>_greater_than_or_equal(<value>), <field_name>_less_than_or_equal(<value>) | _filters=id_greater_than(5) | Available fields: id |
NEW order_by_asc(<type>), order_by_desc(<type>) | _filters=order_by_desc(id) | Accepts: id, date_created, date_commenced, date_expires and date_closed |
Sample Response
GET //contracts/50/periods.json
{ "meta": { "status": "ok", "message": "Everything executed as expected.", "more_info": "https://affinitylive.jira.com/wiki/display/APIS/Status+Codes#ok" }, "response": { "periods": [ { "id": "164", "allowance_type": "fixed_hours", "budget_type": "pre-paid" }, { "id": "165", "allowance_type": "fixed_hours", "budget_type": "pre-paid" }, { "id": "166", "allowance_type": "fixed_hours", "budget_type": "pre-paid" } ] } }
Handling the response
Please see the get contract period  for controlling the response.
Â