REST API Resources

API request #index

For all projects

GET /resource_bookings.json 
or 
GET /resource_bookings.xml

For a project

GET /projects/<projects_id>/resources.json
or
GET /projects/<projects_id>/resources.xml

API request #show

GET /resource_bookings/<resource_id>.json
or
GET /resource_bookings/<resource_id>.xml

Example response json:

{
    "resource": {
        "id": 1,
        "assigned_to_id": 4,
        "project_id": 13,
        "issue_id": 578,
        "start_date": "2023-03-03T00:00:00Z",
        "end_date": "2023-03-18T00:00:00Z",
        "hours_per_day": 4.0,
        "notes": "",
        "created_at": "2018-12-18T06:12:49Z",
        "updated_at": "2023-03-21T02:00:30Z" 
    }
}

Example response xml:

<?xml version="1.0" encoding="UTF-8"?>
<resource>
    <id>1</id>
    <assigned_to_id>4</assigned_to_id>
    <project_id>13</project_id>
    <issue_id>578</issue_id>
    <start_date>2023-03-03T00:00:00Z</start_date>
    <end_date>2023-03-18T00:00:00Z</end_date>
    <hours_per_day>4.0</hours_per_day>
    <notes></notes>
    <created_at>2018-12-18T06:12:49Z</created_at>
    <updated_at>2023-03-21T02:00:30Z</updated_at>
</resource>

API request #create

POST /resource_bookings.json?key=<your_api_key>
  {
    "resource_booking": {
         "project_id": "1",
         "assigned_to_id": "2",
         "issue_id": "1",
         "start_date": "2022-08-01",
         "end_date": "2022-08-05",
         "hours_per_day": "4",
         "notes": "Some note" 
    }
}

API request #update

PUT /resource_bookings/<resource_id>.json?key=<your_api_key>
  {
    "resource_booking": {
         "notes": "An updated note" 
    }
}

API request #destroy (delete resource)

DELETE /resource_bookings/<resource_id>.json
or
DELETE /resource_bookings/<resource_id>.xml
Was this article helpful? Yes  No
153 from 185 found this helpful