Targets are pointers to cloud-based applications and services, as well as to HTTP and email addresses. Targets are used with triggers and automations to send a notification to the target when a condition is met in Zendesk Support. See Notifying external targets. A target failure record is created when the target returns an error.

JSON Format

Target Failures are represented as JSON objects with the following properties:

Name Type Read-only Mandatory Description
consecutive_failure_count integer true false Number of times the target failed consecutively
created_at string true false Time of the failure
id integer true false The ID of the target failure
raw_request string true false The raw message of the target request
raw_response string true false The raw response of the failure
status_code integer true false HTTP status code of the target failure
target_name string true false Name of the target failure
url string true false The API url of the failure record

Example

{  "consecutive_failure_count": 1,  "created_at": "2017-09-05T10:38:52Z",  "id": 6001326,  "raw_request": "GET /api/v2/tickets.json HTTP/1.1\r\nUser-Agent: Zendesk Target\r\n ...",  "raw_response": "HTTP/1.1 401 Unauthorized\r\nServer: nginx\r\n ...",  "status_code": 401,  "target_name": "My URL Target",  "url": "https://example.zendesk.com/api/v2/target_failures/6001326.json"}

List Target Failures

  • GET /api/v2/target_failures

Returns the 25 most recent target failures, per target.

Stability

  • Development

Allowed For

  • Admins

Using curl

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

Example Response

Status 200 OK
{  "target_failures": [    {      "id": 1,      "status_code": 401,      "target_name": "My URL Target"    },    {      "id": 2,      "status_code": 401,      "target_name": "My URL Target"    }  ]}

Show Target Failure

  • GET /api/v2/target_failures/{target_failure_id}

Stability

  • Development

Allowed For

  • Admins

Parameters

Name Type In Required Description
target_failure_id integer Path true The ID of the target failure

Using curl

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

Example Response

Status 200 OK
{  "target_failure": {    "id": 1,    "raw_request": "GET /api/v2/tickets.json HTTP/1.1\r\nUser-Agent: Zendesk Target\r\n ...",    "raw_response": "HTTP/1.1 401 Unauthorized\r\nServer: nginx\r\n ...",    "status_code": 401,    "target_name": "My URL Target"  }}