JSON Format

Sharing Agreements are represented as JSON objects with the following properties:

Name Type Read-only Mandatory Description
created_at string true false The time the record was created
id integer true false Automatically assigned upon creation
name string false false Name of this sharing agreement
partner_name string false false Can be one of the following: "jira", null
remote_subdomain string false false Subdomain of the remote account or null if not associated with an account
status string false false Can be one of the following: "accepted", "declined", "pending", "inactive"
type string false false Can be one of the following: "inbound", "outbound"
url string true false URL of the sharing agreement record

Example

{  "created_at": "2012-02-20T22:55:29Z",  "id": 88335,  "name": "Ticket Sharing",  "partner_name": "jira",  "status": "accepted",  "type": "inbound",  "url": "https://company.zendesk.com/api/v2/agreements/88335.json"}

List Sharing Agreements

  • GET /api/v2/sharing_agreements

Allowed For

  • Agents

Using curl

curl https://{subdomain}.zendesk.com/api/v2/sharing_agreements.json \  -v -u {email_address}:{password}

Example Response

Status 200 OK
{  "sharing_agreements": [    {      "created_at": "2012-02-20T22:55:29Z",      "id": 1,      "name": "Foo @ Zendesk",      "partner_name": "jira",      "status": "accepted",      "type": "inbound",      "url": "https://company.zendesk.com/api/v2/agreements/1.json"    }  ]}

Show a Sharing Agreement

  • GET /api/v2/sharing_agreements/{sharing_agreement_id}

Returns a sharing agreement for your account.

Allowed For

  • Agents

Parameters

Name Type In Required Description
sharing_agreement_id integer Path true The ID of the sharing agreement

Using curl

curl https://{subdomain}.zendesk.com/api/v2/sharing_agreements/{sharing_agreement_id}.json \  -v -u {email_address}:{password}

Example Response

Status 200 OK
{  "sharing_agreement": {    "created_at": "2012-02-20T22:55:29Z",    "id": 1,    "name": "Foo @ Zendesk",    "partner_name": null,    "remote_subdomain": "foo",    "status": "accepted",    "type": "inbound",    "url": "https://company.zendesk.com/api/v2/agreements/1.json"  }}

Create Sharing Agreement

  • POST /api/v2/sharing_agreements

Allowed For

  • Admins

Using curl

curl https://{subdomain}.zendesk.com/api/v2/sharing_agreements.json \  -H "Content-Type: application/json" -X POST \  -d '{"sharing_agreement": {"remote_subdomain": "Foo"}}' \  -v -u {email_address}:{password}

Example Response

Status 201 Created
{  "sharing_agreement": {    "created_at": "2012-02-20T22:55:29Z",    "id": 1,    "name": "Foo @ Zendesk",    "partner_name": null,    "remote_subdomain": "foo",    "status": "accepted",    "type": "inbound",    "url": "https://company.zendesk.com/api/v2/agreements/1.json"  }}

Update a Sharing Agreement

  • PUT /api/v2/sharing_agreements/{sharing_agreement_id}

Returns an updated sharing agreement. Only status is allowed to be updated.

Allowed For

  • Admins

Parameters

Name Type In Required Description
sharing_agreement_id integer Path true The ID of the sharing agreement

Using curl

curl https://{subdomain}.zendesk.com/api/v2/sharing_agreements/{sharing_agreement_id}.json \  -H "Content-Type: application/json" -X PUT \  -d '{"sharing_agreement": {"status": "accepted"}}' \  -v -u {email_address}:{password}

Example Response

Status 200 OK
{  "sharing_agreement": {    "created_at": "2012-02-20T22:55:29Z",    "id": 1,    "name": "Foo @ Zendesk",    "partner_name": null,    "remote_subdomain": "foo",    "status": "accepted",    "type": "inbound",    "url": "https://company.zendesk.com/api/v2/agreements/1.json"  }}

Delete a Sharing Agreement

  • DELETE /api/v2/sharing_agreements/{sharing_agreement_id}

Deletes a sharing agreement.

Allowed For

  • Admins

Parameters

Name Type In Required Description
sharing_agreement_id integer Path true The ID of the sharing agreement

Using curl

curl https://{subdomain}.zendesk.com/api/v2/sharing_agreements/{sharing_agreement_id}.json \  -X DELETE -v -u {email_address}:{password}

Example Response

Status 204 No Content