Resource Collections

Resource collection allows admins to create a collection of Zendesk Support resources (a ticket field, a target etc.) in one go.

JSON Format

Resource Collections have the following keys:

Name Type Read-only Mandatory Comment
id integer yes no Automatically assigned upon creation
created_at date yes no The time the identity got created
updated_at date yes no The time the identity got updated
Example
{
  "id":              35436,
  "updated_at":      "2011-07-20T22:55:29Z",
  "created_at":      "2011-07-20T22:55:29Z"
}

List Resource Collections

GET /api/v2/resource_collections.json

Lists all resource collections that have been created.

Allowed For
  • Admins
Using curl
curl https://{subdomain}.zendesk.com/api/v2/resource_collections.json \
  -v -u {email_address}:{password}
Example Response
Status: 200 OK

{
  "resource_collections": [
    {
      "id":10002,
      "created_at":"2015-09-09T01:57:24Z",
      "updated_at":"2015-09-09T01:57:24Z"
    }
  ],
  "next_page":        null,
  "previous_page":    null,
  "count":            0
}

Retrieve a Resource Collection

GET /api/v2/resource_collections/{id}.json

Retrieves details of a specified resource collection.

Allowed For:
  • Admins
Using curl
curl https://{subdomain}.zendesk.com/api/v2/resource_collections/{id}.json \
  -v -u {email_address}:{password}
Example Response
Status: 200 OK

{
  "resource_collection": {
    "id":            10002,
    "created_at":    "2015-09-09T01:57:24Z",
    "updated_at":    "2015-09-09T01:57:24Z"
  }
}

Create a Resource Collection

POST /api/v2/resource_collections.json

Creates a resource collection with a provided payload. The payload is specified the same way as the content of a requirements.json file in a Zendesk app. See Apps Requirements in the Zendesk Apps framework docs.

Allowed For:
  • Admins
Using curl
curl https://{subdomain}.zendesk.com/api/v2/resource_collections.json \
  -X POST -d '{"payload": {payload}}' \
  -v -u {email_address}:{password} -H "Content-Type: application/json"
Example Response
Status: 200 OK

{
  "job_status": {
    "id":          "0a3e49b038c40133d7380242ac110031",
    "url":         "https://company.zendesk.com/api/v2/job_statuses/0a3e49b038c40133d7380242ac110031.json",
    "total":       null,
    "progress":    null,
    "status":      "queued",
    "message":     null,
    "results":     null
  },
  "collection_id": 10002
}

Update a Resource Collection

PUT /api/v2/resource_collections.json

Updates a resource collection with a provided payload. The payload is specified the same way as the content of a requirements.json file in a Zendesk app. See Apps Requirements in the Zendesk Apps framework docs.

Allowed For:
  • Admins
Using curl
curl https://{subdomain}.zendesk.com/api/v2/resource_collections/{id}.json \
  -X PUT -d '{"payload": {payload}}' \
  -v -u {email_address}:{password} -H "Content-Type: application/json"
Example Response
Status: 200 OK

{
  "job_status": {
    "id":          "4555831038d20133d7390242ac110031",
    "url":         "https://company.zendesk.com/api/v2/job_statuses/4555831038d20133d7390242ac110031.json",
    "total":       null,
    "progress":    null,
    "status":      "queued",
    "message":     null,
    "results":     null
  },
  "collection_id": 10002
}

Delete a Resource Collection

DELETE /api/v2/resource_collections/{id}.json

Allowed For
  • Admins
Using curl
curl https://{subdomain}.zendesk.com/api/v2/resource_collections/{id}.json \
  -v -u {email_address}:{password} -X DELETE
Example Response
Status: 200 OK

{
  "job_status": {
    "id":          "2ee570d0398e0133e26e0242ac110017",
    "url":         "https://company.zendesk.com/api/v2/job_statuses/2ee570d0398e0133e26e0242ac110017.json",
    "total":       null,
    "progress":    null,
    "status":      "queued",
    "message":     null,
    "results":     null
  },
  "collection_id": 10002
}