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.

_pageunsigned intThe page of the list to display. For example, 5 will display the fifth page. Each page contains 10 resources.
_limitunsigned intThe maximum number of resources to return. Default is 10 and maximum is 50.
_offsetunsigned intThe 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.
_fieldspartial stringAllows you to specify optional fields and linked objects to include in the response.
_filterspartial string 

Filtering Contract Periods

You can filter the returned list using the _filters parameter.

NameExampleDescription
idid(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.
rolloverservice_item(yes)Only return periods by given rollover values.
contractcontract(12, 15)Only return periods by given contract ids.
contract_budgetcontract_budget(22, 867)Only return periods by given contract budget ids
standingstanding(opened)Only return periods by given standing statuses.
date_commenced_beforedate_commenced_before(1341281246)Unix Timestamp. e.g 1341281246- Filter out companies that were not commenced before this date.
date_commenced_afterdate_commenced_after(1341281246)Unix Timestamp. e.g 1341281246- Filter out companies that were not commenced after this date.
date_closed_beforedate_closed_before(1341281246) 
date_closed_afterdate_closed_after(1341281246) 
date_expires_beforedate_expires_before(1341281246) 
date_expires_afterdate_expires_after(1341281246) 
date_created_beforedate_created_before(1341281246) 
date_created_afterdate_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
contract
rate
rate_charged
budget
service_item

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.