zendesk_api 0.1.11 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +3 -0
- data/.travis.yml +1 -3
- data/Gemfile +24 -0
- data/Gemfile.lock +75 -10
- data/Procfile +1 -0
- data/Rakefile +10 -3
- data/Readme.md +65 -0
- data/bin/zendesk +26 -0
- data/config.ru +6 -0
- data/config/mongoid.yml +81 -0
- data/lib/zendesk_api/actions.rb +2 -2
- data/lib/zendesk_api/collection.rb +15 -4
- data/lib/zendesk_api/console/base.rb +12 -0
- data/lib/zendesk_api/console/console.rb +144 -0
- data/lib/zendesk_api/console/extensions.rb +183 -0
- data/lib/zendesk_api/console/options.rb +41 -0
- data/lib/zendesk_api/resource.rb +12 -1
- data/lib/zendesk_api/resources.rb +28 -8
- data/lib/zendesk_api/server/base.rb +119 -0
- data/lib/zendesk_api/server/docs/account_settings.md +145 -0
- data/lib/zendesk_api/server/docs/activity_stream.md +121 -0
- data/lib/zendesk_api/server/docs/attachments.md +73 -0
- data/lib/zendesk_api/server/docs/autocomplete.md +29 -0
- data/lib/zendesk_api/server/docs/categories.md +193 -0
- data/lib/zendesk_api/server/docs/custom_roles.md +88 -0
- data/lib/zendesk_api/server/docs/forum_subscriptions.md +139 -0
- data/lib/zendesk_api/server/docs/forums.md +229 -0
- data/lib/zendesk_api/server/docs/group_memberships.md +229 -0
- data/lib/zendesk_api/server/docs/groups.md +212 -0
- data/lib/zendesk_api/server/docs/introduction.md +159 -0
- data/lib/zendesk_api/server/docs/job_statuses.md +86 -0
- data/lib/zendesk_api/server/docs/locales.md +124 -0
- data/lib/zendesk_api/server/docs/macros.md +287 -0
- data/lib/zendesk_api/server/docs/organizations.md +253 -0
- data/lib/zendesk_api/server/docs/problems.md +117 -0
- data/lib/zendesk_api/server/docs/requests.md +256 -0
- data/lib/zendesk_api/server/docs/satisfaction_ratings.md +136 -0
- data/lib/zendesk_api/server/docs/search.md +106 -0
- data/lib/zendesk_api/server/docs/sharing_agreements.md +57 -0
- data/lib/zendesk_api/server/docs/side_loading.md +125 -0
- data/lib/zendesk_api/server/docs/suspended_tickets.md +182 -0
- data/lib/zendesk_api/server/docs/tags.md +36 -0
- data/lib/zendesk_api/server/docs/ticket_audits.md +657 -0
- data/lib/zendesk_api/server/docs/ticket_export.md +121 -0
- data/lib/zendesk_api/server/docs/ticket_fields.md +277 -0
- data/lib/zendesk_api/server/docs/ticket_import.md +65 -0
- data/lib/zendesk_api/server/docs/ticket_metrics.md +125 -0
- data/lib/zendesk_api/server/docs/tickets.md +622 -0
- data/lib/zendesk_api/server/docs/topic_comments.md +221 -0
- data/lib/zendesk_api/server/docs/topic_subscriptions.md +140 -0
- data/lib/zendesk_api/server/docs/topic_votes.md +154 -0
- data/lib/zendesk_api/server/docs/topics.md +335 -0
- data/lib/zendesk_api/server/docs/triggers.md +199 -0
- data/lib/zendesk_api/server/docs/user_identities.md +279 -0
- data/lib/zendesk_api/server/docs/users.md +400 -0
- data/lib/zendesk_api/server/docs/views.md +505 -0
- data/lib/zendesk_api/server/helper.rb +104 -0
- data/lib/zendesk_api/server/html_renderer.rb +98 -0
- data/lib/zendesk_api/server/models/user_request.rb +16 -0
- data/lib/zendesk_api/server/models/zlib_json.rb +13 -0
- data/lib/zendesk_api/server/public/config.rb +26 -0
- data/lib/zendesk_api/server/public/favicon.ico +0 -0
- data/lib/zendesk_api/server/public/images/glyphicons-halflings-white.png +0 -0
- data/lib/zendesk_api/server/public/images/glyphicons-halflings.png +0 -0
- data/lib/zendesk_api/server/public/images/spinner.gif +0 -0
- data/lib/zendesk_api/server/public/images/zendesk_developers_bg.png +0 -0
- data/lib/zendesk_api/server/public/images/zendesk_developers_header.png +0 -0
- data/lib/zendesk_api/server/public/javascripts/application.js +186 -0
- data/lib/zendesk_api/server/public/javascripts/bootstrap-alert.js +90 -0
- data/lib/zendesk_api/server/public/javascripts/bootstrap-button.js +96 -0
- data/lib/zendesk_api/server/public/javascripts/bootstrap-carousel.js +169 -0
- data/lib/zendesk_api/server/public/javascripts/bootstrap-collapse.js +157 -0
- data/lib/zendesk_api/server/public/javascripts/bootstrap-dropdown.js +100 -0
- data/lib/zendesk_api/server/public/javascripts/bootstrap-modal.js +218 -0
- data/lib/zendesk_api/server/public/javascripts/bootstrap-popover.js +98 -0
- data/lib/zendesk_api/server/public/javascripts/bootstrap-scrollspy.js +151 -0
- data/lib/zendesk_api/server/public/javascripts/bootstrap-tab.js +135 -0
- data/lib/zendesk_api/server/public/javascripts/bootstrap-tooltip.js +275 -0
- data/lib/zendesk_api/server/public/javascripts/bootstrap-transition.js +61 -0
- data/lib/zendesk_api/server/public/javascripts/bootstrap-typeahead.js +285 -0
- data/lib/zendesk_api/server/public/sass/screen.scss +102 -0
- data/lib/zendesk_api/server/public/sass/styles.scss +5 -0
- data/lib/zendesk_api/server/public/stylesheets/developer.screen.css +836 -0
- data/lib/zendesk_api/server/public/stylesheets/screen.css +129 -0
- data/lib/zendesk_api/server/public/stylesheets/styles.css +6208 -0
- data/lib/zendesk_api/server/templates/footer.haml +13 -0
- data/lib/zendesk_api/server/templates/header.haml +20 -0
- data/lib/zendesk_api/server/templates/index.haml +68 -0
- data/lib/zendesk_api/server/templates/layout.haml +44 -0
- data/lib/zendesk_api/server/templates/param.haml +4 -0
- data/lib/zendesk_api/server/templates/search.haml +23 -0
- data/lib/zendesk_api/server/templates/sidebar.haml +7 -0
- data/lib/zendesk_api/version.rb +1 -1
- data/spec/{association_spec.rb → core/association_spec.rb} +1 -1
- data/spec/{client_spec.rb → core/client_spec.rb} +1 -1
- data/spec/{collection_spec.rb → core/collection_spec.rb} +1 -1
- data/spec/{configuration_spec.rb → core/configuration_spec.rb} +1 -1
- data/spec/{create_resource_spec.rb → core/create_resource_spec.rb} +1 -1
- data/spec/{data_resource_spec.rb → core/data_resource_spec.rb} +1 -1
- data/spec/{inflection_spec.rb → core/inflection_spec.rb} +1 -1
- data/spec/{lru_cache_spec.rb → core/lru_cache_spec.rb} +1 -1
- data/spec/{middleware → core/middleware}/request/etag_cache_spec.rb +1 -1
- data/spec/{middleware → core/middleware}/request/retry_spec.rb +1 -1
- data/spec/{middleware → core/middleware}/request/test.jpg +0 -0
- data/spec/{middleware → core/middleware}/request/upload_spec.rb +1 -1
- data/spec/{middleware → core/middleware}/response/callback_spec.rb +1 -1
- data/spec/{middleware → core/middleware}/response/deflate_spec.rb +1 -1
- data/spec/{middleware → core/middleware}/response/gzip_spec.rb +1 -1
- data/spec/{middleware → core/middleware}/response/parse_iso_dates_spec.rb +1 -1
- data/spec/{read_resource_spec.rb → core/read_resource_spec.rb} +1 -1
- data/spec/{rescue_spec.rb → core/rescue_spec.rb} +1 -1
- data/spec/{resource_spec.rb → core/resource_spec.rb} +1 -1
- data/spec/{search_spec.rb → core/search_spec.rb} +1 -1
- data/spec/{spec_helper.rb → core/spec_helper.rb} +5 -5
- data/spec/{trackie_spec.rb → core/trackie_spec.rb} +1 -1
- data/{live → spec/live}/Readme.md +0 -0
- data/{live → spec/live}/activity_spec.rb +1 -1
- data/{live → spec/live}/audit_spec.rb +1 -1
- data/{live → spec/live}/bookmark_spec.rb +1 -1
- data/{live → spec/live}/category_spec.rb +1 -1
- data/{live → spec/live}/collection_spec.rb +1 -1
- data/{live → spec/live}/crm_spec.rb +1 -1
- data/{live → spec/live}/custom_role_spec.rb +1 -1
- data/{live → spec/live}/forum_spec.rb +1 -1
- data/{live → spec/live}/forum_subscription_spec.rb +1 -1
- data/{live → spec/live}/group_membership_spec.rb +1 -1
- data/{live → spec/live}/group_spec.rb +1 -1
- data/{live → spec/live}/identity_spec.rb +1 -1
- data/{live → spec/live}/locale_spec.rb +1 -1
- data/{live → spec/live}/macro_spec.rb +1 -1
- data/{live → spec/live}/mobile_device_spec.rb +1 -1
- data/{live → spec/live}/organization_spec.rb +1 -1
- data/{live → spec/live}/request_spec.rb +1 -1
- data/{live → spec/live}/satisfaction_rating_spec.rb +1 -1
- data/{live → spec/live}/setting_spec.rb +1 -1
- data/{live → spec/live}/suspended_ticket_spec.rb +1 -1
- data/{live → spec/live}/ticket_field_spec.rb +1 -1
- data/{live → spec/live}/ticket_metrics_spec.rb +1 -1
- data/{live → spec/live}/ticket_spec.rb +1 -1
- data/spec/live/topic_comment_spec.rb +24 -0
- data/{live → spec/live}/topic_spec.rb +1 -1
- data/{live → spec/live}/topic_subscription_spec.rb +1 -1
- data/{live → spec/live}/topic_vote_spec.rb +1 -1
- data/{live → spec/live}/upload_spec.rb +1 -1
- data/{live → spec/live}/user_spec.rb +1 -1
- data/{live → spec/live}/view_spec.rb +1 -1
- data/spec/macros/resource_macros.rb +1 -1
- data/spec/server/app_spec.rb +140 -0
- data/spec/server/helper_spec.rb +97 -0
- data/spec/server/html_renderer_spec.rb +130 -0
- data/spec/server/spec_helper.rb +43 -0
- metadata +198 -77
- data/live/topic_comment_spec.rb +0 -13
@@ -0,0 +1,121 @@
|
|
1
|
+
## Incremental Tickets
|
2
|
+
|
3
|
+
The incremental ticket API is designed for API consumers that want to know about tickets that changed in Zendesk "since you last asked". It works something like this:
|
4
|
+
|
5
|
+
```
|
6
|
+
You: Hello Zendesk, give me the tickets since 0 o'clock
|
7
|
+
Us: Sure, here are the tickets up until, and including, 5 o'clock
|
8
|
+
You: Hello Zendesk, give me the tickets since 5 o'clock
|
9
|
+
Us: Sure, here are the tickets up until, and including, 7 o'clock
|
10
|
+
```
|
11
|
+
|
12
|
+
Because of this API behavior, the incremental ticket API is different in behavior, requirements and semantics than other API endpoints. Most important to note is that **the ticket response returns a lightweight representation of each ticket and does not include comments**. To retrieve the full ticket response, use our [Tickets API](tickets.html) to retrieve the full ticket.
|
13
|
+
|
14
|
+
Please study the docs below and the data you get in response.
|
15
|
+
|
16
|
+
### JSON Format
|
17
|
+
The tickets updated since a given point in time are represented as simple flat JSON objects with these attributes:
|
18
|
+
|
19
|
+
| Name | Type | Read-only | Mandatory | Comment
|
20
|
+
| --------------- | ------- | --------- | --------- | -------
|
21
|
+
| end_time | date | yes | no | The most recent time present in this result set in Unix epoch time; this should be used as the next start_time
|
22
|
+
| next_page | string | yes | no | The URL that should be called to get the next set of results
|
23
|
+
| results | array | yes | no | An array of hashes, one per ticket. Each hash contains key/value pairs corresponding to ticket attributes
|
24
|
+
| field_headers | array | yes | no | A hash of field keys and their human-readable names
|
25
|
+
| options | hash | yes | no | Contains the timezone of the account and the time offset in hours after midnight for the next sync
|
26
|
+
|
27
|
+
#### Example
|
28
|
+
```js
|
29
|
+
{
|
30
|
+
"end_time": 1332034771,
|
31
|
+
"next_page":"https://domain.zendesk.com/api/v2/exports/tickets.json?start_time=1332034771",
|
32
|
+
"field_headers": {
|
33
|
+
"group_name": "Group",
|
34
|
+
"id": "Id",
|
35
|
+
"created_at": "Created at",
|
36
|
+
...
|
37
|
+
},
|
38
|
+
"results": [
|
39
|
+
{
|
40
|
+
"group_name": "Support",
|
41
|
+
"id": 2,
|
42
|
+
"created_at": "2012-02-02T04:31:29Z",
|
43
|
+
...
|
44
|
+
},
|
45
|
+
...
|
46
|
+
],
|
47
|
+
|
48
|
+
}
|
49
|
+
```
|
50
|
+
|
51
|
+
### Incremental Ticket Export
|
52
|
+
`GET /api/v2/exports/tickets.json`
|
53
|
+
|
54
|
+
#### Allowed For
|
55
|
+
|
56
|
+
* Admins
|
57
|
+
|
58
|
+
#### Request Parameters
|
59
|
+
|
60
|
+
* start_time: The time of the oldest ticket you are interested in. Tickets modified on or since this time will be returned.
|
61
|
+
The start time is provided as the number of seconds since epoch UTC.
|
62
|
+
|
63
|
+
#### Using curl
|
64
|
+
|
65
|
+
```bash
|
66
|
+
curl https://{subdomain}.zendesk.com/api/v2/exports/tickets.json?start_time=1332034771 \
|
67
|
+
-v -u {email_address}:{password}
|
68
|
+
```
|
69
|
+
|
70
|
+
#### Usage Notes
|
71
|
+
|
72
|
+
The API consumer should call this API to initially export a complete list of ticket details from a help desk,
|
73
|
+
and periodically poll the API to incrementally export ticket details for tickets that have been updated since
|
74
|
+
the previous poll. This API should not be used to frequently export a full list of all tickets.
|
75
|
+
|
76
|
+
This API does not protect against duplicate tickets, and in fact it will include plenty of duplicates,
|
77
|
+
as the query boils down to tickets whose updated time stamp is after or equal to the `start_time` parameter
|
78
|
+
|
79
|
+
Requests with start_time less than 5 minutes old will be rejected. You are only allowed to make 1 API call to this
|
80
|
+
API end point every 5 minute and we will return up to 1000 tickets per request. Please see the `sample` end point
|
81
|
+
below for an way to test this API without getting throttled continuiously. The rate limiting mechanism here
|
82
|
+
behaves identically to the one described in our [API introduction](introduction.md) and we recommend that you obey
|
83
|
+
the `Retry-After` header values as also elaborated in the [API introduction](introduction.md).
|
84
|
+
|
85
|
+
#### Example Response
|
86
|
+
|
87
|
+
```http
|
88
|
+
Status: 200 OK
|
89
|
+
|
90
|
+
{
|
91
|
+
"end_time": 1332034771,
|
92
|
+
"next_page":"https://domain.zendesk.com/api/v2/exports/tickets.json?start_time=1332034771",
|
93
|
+
"field_headers": {
|
94
|
+
"group_name": "Group",
|
95
|
+
"id": "Id",
|
96
|
+
"created_at": "Created at",
|
97
|
+
...
|
98
|
+
},
|
99
|
+
"results": [
|
100
|
+
{
|
101
|
+
"group_name": "Support",
|
102
|
+
"id": 2,
|
103
|
+
"created_at": "2012-02-02T04:31:29Z",
|
104
|
+
...
|
105
|
+
},
|
106
|
+
...
|
107
|
+
]
|
108
|
+
}
|
109
|
+
```
|
110
|
+
|
111
|
+
### Sample Incremental Tickets
|
112
|
+
|
113
|
+
This end point is only to be used for testing the incremental export format. It is more relaxed in terms of
|
114
|
+
rate limiting, but will only return up to 50 records. Outside this, it's identical to the above API.
|
115
|
+
|
116
|
+
#### Using curl
|
117
|
+
|
118
|
+
```bash
|
119
|
+
curl https://{subdomain}.zendesk.com/api/v2/exports/tickets/sample.json?start_time=1332034771 \
|
120
|
+
-v -u {email_address}:{password}
|
121
|
+
```
|
@@ -0,0 +1,277 @@
|
|
1
|
+
## Ticket Fields
|
2
|
+
|
3
|
+
Zendesk allows admins to customize fields that display on the ticket form. Basic text fields as well as customizable dropdown and number fields are available. The visibility of these fields can be customized for end-users in the portal interface as well as to agent interfaces.
|
4
|
+
|
5
|
+
### JSON Format
|
6
|
+
Ticket fields have the following attributes
|
7
|
+
|
8
|
+
| Name | Type | Read-only | Mandatory | Comment
|
9
|
+
| --------------------- | ------- | --------- | --------- | -------
|
10
|
+
| id | integer | yes | no | Automatically assigned upon creation
|
11
|
+
| url | string | yes | no | The URL for this resource
|
12
|
+
| type | string | no | yes | The type of the ticket field
|
13
|
+
| title | string | no | yes | The title of the ticket field
|
14
|
+
| description | string | no | no | The description of the purpose of this ticket field, shown to users
|
15
|
+
| position | integer | no | no | A relative position for the ticket fields, determines the order of ticket fields on a ticket
|
16
|
+
| active | boolean | no | no | Whether this field is available
|
17
|
+
| required | boolean | no | no | If it's required for this field to have a value when updated by agents
|
18
|
+
| collapsed_for_agents | string | no | no | If this field should be shown to agents by default or be hidden alongside infrequently used fields
|
19
|
+
| regexp_for_validation | string | no | no | Regular expression field only. The validation pattern for a field value to be deemed valid.
|
20
|
+
| title_in_portal | string | no | no | The title of the ticket field when shown to end users
|
21
|
+
| visible_in_portal | boolean | no | no | Whether this field is available to end users
|
22
|
+
| editable_in_portal | boolean | no | no | Whether this field is editable by end users
|
23
|
+
| required_in_portal | boolean | no | no | If it's required for this field to have a value when updated by end users
|
24
|
+
| tag | string | no | no | A tag value to set for checkbox fields when checked
|
25
|
+
| created_at | date | yes | no | The time the ticket field was created
|
26
|
+
| updated_at | date | yes | no | The time of the last update of the ticket field
|
27
|
+
| custom_field_options | array | no | yes | Required and presented for a ticket field of type "tagger"
|
28
|
+
|
29
|
+
#### Example
|
30
|
+
```js
|
31
|
+
{
|
32
|
+
"id": 34,
|
33
|
+
"url": "https://company.zendesk.com/api/v2/ticket_fields/34.json",
|
34
|
+
"type": "subject",
|
35
|
+
"title": "Subject",
|
36
|
+
"description": "This is the subject field of a ticket",
|
37
|
+
"position": 21,
|
38
|
+
"active": true,
|
39
|
+
"required": true,
|
40
|
+
"collapsed_for_agents": false,
|
41
|
+
"regexp_for_validation": null,
|
42
|
+
"title_in_portal": "Subject",
|
43
|
+
"visible_in_portal": true,
|
44
|
+
"editable_in_portal": true,
|
45
|
+
"required_in_portal": true,
|
46
|
+
"tag": null,
|
47
|
+
"created_at": "2009-07-20T22:55:29Z",
|
48
|
+
"updated_at": "2011-05-05T10:38:52Z"
|
49
|
+
}
|
50
|
+
```
|
51
|
+
|
52
|
+
### List Ticket Fields
|
53
|
+
`GET /api/v2/ticket_fields.json`
|
54
|
+
|
55
|
+
Returns a list of all ticket fields in your account. Fields are returned in the order that you specify
|
56
|
+
in your Ticket Fields configuration in Zendesk. Clients should cache this resource for the duration of
|
57
|
+
their API usage and map the id for each ticket field to the values returned under the
|
58
|
+
fields attributes on the [Ticket](tickets.md) resource.
|
59
|
+
|
60
|
+
#### Allowed For
|
61
|
+
|
62
|
+
* Agents
|
63
|
+
|
64
|
+
#### Using curl
|
65
|
+
|
66
|
+
```bash
|
67
|
+
curl https://{subdomain}.zendesk.com/api/v2/ticket_fields.json \
|
68
|
+
-v -u {email_address}:{password}
|
69
|
+
```
|
70
|
+
|
71
|
+
#### Example Response
|
72
|
+
|
73
|
+
```http
|
74
|
+
Status: 200 OK
|
75
|
+
|
76
|
+
{
|
77
|
+
"ticket_fields": [
|
78
|
+
{
|
79
|
+
"id": 34,
|
80
|
+
"url": "https://company.zendesk.com/api/v2/ticket_fields/34.json",
|
81
|
+
"type": "subject",
|
82
|
+
"title": "Subject",
|
83
|
+
"description": "This is the subject field of a ticket",
|
84
|
+
"position": 21,
|
85
|
+
"active": true,
|
86
|
+
"required": true,
|
87
|
+
"collapsed_for_agents": false,
|
88
|
+
"regexp_for_validation": null,
|
89
|
+
"title_in_portal": "Subject",
|
90
|
+
"visible_in_portal": true,
|
91
|
+
"editable_in_portal": true,
|
92
|
+
"required_in_portal": true,
|
93
|
+
"tag": null,
|
94
|
+
"created_at": "2009-07-20T22:55:29Z",
|
95
|
+
"updated_at": "2011-05-05T10:38:52Z"
|
96
|
+
}
|
97
|
+
]
|
98
|
+
}
|
99
|
+
```
|
100
|
+
|
101
|
+
|
102
|
+
### Show Ticket Field
|
103
|
+
`GET /api/v2/ticket_fields/{id}.json`
|
104
|
+
|
105
|
+
#### Allowed For
|
106
|
+
|
107
|
+
* Agents
|
108
|
+
|
109
|
+
#### Using curl
|
110
|
+
|
111
|
+
```bash
|
112
|
+
curl https://{subdomain}.zendesk.com/api/v2/ticket_fields/{id}.json \
|
113
|
+
-v -u {email_address}:{password}
|
114
|
+
```
|
115
|
+
|
116
|
+
#### Example Response
|
117
|
+
|
118
|
+
```http
|
119
|
+
Status: 200 OK
|
120
|
+
|
121
|
+
{
|
122
|
+
"ticket_field": {
|
123
|
+
"id": 34,
|
124
|
+
"url": "https://company.zendesk.com/api/v2/ticket_fields/34.json",
|
125
|
+
"type": "subject",
|
126
|
+
"title": "Subject",
|
127
|
+
"description": "This is the subject field of a ticket",
|
128
|
+
"position": 21,
|
129
|
+
"active": true,
|
130
|
+
"required": true,
|
131
|
+
"collapsed_for_agents": false,
|
132
|
+
"regexp_for_validation": null,
|
133
|
+
"title_in_portal": "Subject",
|
134
|
+
"visible_in_portal": true,
|
135
|
+
"editable_in_portal": true,
|
136
|
+
"required_in_portal": true,
|
137
|
+
"tag": null,
|
138
|
+
"created_at": "2009-07-20T22:55:29Z",
|
139
|
+
"updated_at": "2011-05-05T10:38:52Z"
|
140
|
+
}
|
141
|
+
}
|
142
|
+
```
|
143
|
+
|
144
|
+
### Create Ticket Fields
|
145
|
+
`POST /api/v2/ticket_fields.json`
|
146
|
+
|
147
|
+
Types of custom fields that can be created are:
|
148
|
+
|
149
|
+
* `text` (default when no "type" is specified)
|
150
|
+
* `textarea`
|
151
|
+
* `checkbox`
|
152
|
+
* `date`
|
153
|
+
* `integer`
|
154
|
+
* `decimal`
|
155
|
+
* `regexp`
|
156
|
+
* `tagger` (custom dropdown)
|
157
|
+
|
158
|
+
#### Allowed For
|
159
|
+
|
160
|
+
* Admins
|
161
|
+
|
162
|
+
#### Using curl
|
163
|
+
|
164
|
+
```bash
|
165
|
+
curl https://{subdomain}.zendesk.com/api/v2/ticket_fields.json \
|
166
|
+
-H "Content-Type: application/json" -X POST \
|
167
|
+
-d '{"ticket_field": {"type": "text", "title": "Age"}}' \
|
168
|
+
-v -u {email_address}:{password}
|
169
|
+
```
|
170
|
+
|
171
|
+
#### Example Response
|
172
|
+
|
173
|
+
```http
|
174
|
+
Status: 201 Created
|
175
|
+
Location: https://{subdomain}.zendesk.com/api/v2/ticket_fields/{id}.json
|
176
|
+
|
177
|
+
{
|
178
|
+
"ticket_field": {
|
179
|
+
"id": 89,
|
180
|
+
"url": "https://company.zendesk.com/api/v2/ticket_fields/89.json",
|
181
|
+
"type": "text",
|
182
|
+
"title": "Age",
|
183
|
+
"description": "Age",
|
184
|
+
"position": 9999,
|
185
|
+
"active": true,
|
186
|
+
"required": true,
|
187
|
+
"collapsed_for_agents": false,
|
188
|
+
"regexp_for_validation": null,
|
189
|
+
"title_in_portal": "Age",
|
190
|
+
"visible_in_portal": false,
|
191
|
+
"editable_in_portal": false,
|
192
|
+
"required_in_portal": false,
|
193
|
+
"tag": null,
|
194
|
+
"created_at": "2012-04-02T22:55:29Z",
|
195
|
+
"updated_at": "2012-04-02T22:55:29Z"
|
196
|
+
}
|
197
|
+
}
|
198
|
+
```
|
199
|
+
|
200
|
+
### Update Ticket Fields
|
201
|
+
`PUT /api/v2/ticket_fields/{id}.json`
|
202
|
+
|
203
|
+
#### Allowed For
|
204
|
+
|
205
|
+
* Admins
|
206
|
+
|
207
|
+
#### Using curl
|
208
|
+
|
209
|
+
```bash
|
210
|
+
curl https://{subdomain}.zendesk.com/api/v2/ticket_fields/{id}.json \
|
211
|
+
-H "Content-Type: application/json" -X PUT \
|
212
|
+
-d '{ "ticket_field": { "title": "Your age" }}' \
|
213
|
+
-v -u {email_address}:{password}
|
214
|
+
```
|
215
|
+
|
216
|
+
#### Example Response
|
217
|
+
|
218
|
+
```http
|
219
|
+
Status: 200 OK
|
220
|
+
Location: https://{subdomain}.zendesk.com/api/v2/ticket_fields/89.json
|
221
|
+
|
222
|
+
{
|
223
|
+
"ticket_field": {
|
224
|
+
"id": 89,
|
225
|
+
"url": "https://company.zendesk.com/api/v2/ticket_fields/89.json",
|
226
|
+
"type": "text",
|
227
|
+
"title": "Your age",
|
228
|
+
"description": "Your age",
|
229
|
+
"position": 9999,
|
230
|
+
"active": true,
|
231
|
+
"required": true,
|
232
|
+
"collapsed_for_agents": false,
|
233
|
+
"regexp_for_validation": null,
|
234
|
+
"title_in_portal": "Your age",
|
235
|
+
"visible_in_portal": false,
|
236
|
+
"editable_in_portal": false,
|
237
|
+
"required_in_portal": false,
|
238
|
+
"tag": null,
|
239
|
+
"created_at": "2012-04-02T22:55:29Z",
|
240
|
+
"updated_at": "2012-04-02T23:11:23Z"
|
241
|
+
}
|
242
|
+
}
|
243
|
+
```
|
244
|
+
|
245
|
+
### Updating a Custom Dropdown (Tagger) Field
|
246
|
+
|
247
|
+
Updating a custom dropdown field replaces the ticket field options. Pass all options that you require in the ticket field.
|
248
|
+
|
249
|
+
#### Using curl
|
250
|
+
|
251
|
+
```bash
|
252
|
+
curl https://{subdomain}.zendesk.com/api/v2/ticket_fields/{id}.json \
|
253
|
+
-H "Content-Type: application/json" -X PUT \
|
254
|
+
-d '{"ticket_field": {"custom_field_options": [{"name": "Option 1", "value": "option_1"}, {"name": "Option 2","value": "option_2"}]}}' \
|
255
|
+
-v -u {email_address}:{password}
|
256
|
+
```
|
257
|
+
|
258
|
+
|
259
|
+
### Delete Ticket Field
|
260
|
+
`DELETE /api/v2/ticket_fields/{id}.json`
|
261
|
+
|
262
|
+
#### Allowed For
|
263
|
+
|
264
|
+
* Admins
|
265
|
+
|
266
|
+
#### Using curl
|
267
|
+
|
268
|
+
```bash
|
269
|
+
curl https://{subdomain}.zendesk.com/api/v1/ticket_fields/{id}.json \
|
270
|
+
-v -u {email_address}:{password} -X DELETE
|
271
|
+
```
|
272
|
+
|
273
|
+
#### Example Response
|
274
|
+
|
275
|
+
```http
|
276
|
+
Status: 200 OK
|
277
|
+
```
|
@@ -0,0 +1,65 @@
|
|
1
|
+
## Ticket Import
|
2
|
+
|
3
|
+
This end-point is for bulk importing tickets. It will allow you to move data from legacy systems into Zendesk. We do not run triggers or the likes during bulk imports like these.
|
4
|
+
|
5
|
+
### Ticket Import
|
6
|
+
`POST /api/v2/imports/tickets.json`
|
7
|
+
|
8
|
+
#### Allowed For
|
9
|
+
|
10
|
+
* Admins
|
11
|
+
|
12
|
+
#### Request Parameters
|
13
|
+
|
14
|
+
* ticket: a hash holding the parameters for the ticket
|
15
|
+
|
16
|
+
```js
|
17
|
+
{
|
18
|
+
"ticket": {
|
19
|
+
"requester_id": 827,
|
20
|
+
"assignee_id": 19,
|
21
|
+
"subject": "Some subject",
|
22
|
+
"description": "A description",
|
23
|
+
"tags": [ "foo", "bar" ],
|
24
|
+
"comments": [
|
25
|
+
{ "author_id": 827, "value": "This is a comment", "created_at": "2009-06-25T10:15:18Z" },
|
26
|
+
{ "author_id": 19, "value": "This is a private comment", "public": false }
|
27
|
+
]
|
28
|
+
}
|
29
|
+
}
|
30
|
+
```
|
31
|
+
|
32
|
+
In addition to the parameters that we generally accept for a ticket, the import also allows
|
33
|
+
you to set the following time stamps on the ticket being imported: `solved_at`, `updated_at`, `created_at`
|
34
|
+
|
35
|
+
Handling attachments is done the same way as in the regular tickets API, you upload the files first
|
36
|
+
and supply the token needed in the comment parameters.
|
37
|
+
|
38
|
+
No triggers will be run on tickets imported in this fashion and hence there will not be any detailed
|
39
|
+
ticket metrics to report on for these kinds of tickets. We recommend you set a tag to signify that these
|
40
|
+
tickets were added to Zendesk using bulk import.
|
41
|
+
|
42
|
+
#### Using curl
|
43
|
+
|
44
|
+
```bash
|
45
|
+
curl https://{subdomain}.zendesk.com/api/v2/imports/tickets.json \
|
46
|
+
-v -u {email_address}:{password} -X POST
|
47
|
+
-d '{"ticket": {"subject": "Help", "comments": [{ "author_id": 19, "value": "This is a comment" }]}}'
|
48
|
+
```
|
49
|
+
|
50
|
+
#### Example Response
|
51
|
+
|
52
|
+
```http
|
53
|
+
Status: 201 Created
|
54
|
+
Location: https://{subdomain}.zendesk.com/api/v2/tickets/{id}.json
|
55
|
+
|
56
|
+
{
|
57
|
+
"ticket": {
|
58
|
+
{
|
59
|
+
"id": 35436,
|
60
|
+
"subject": "Help",
|
61
|
+
...
|
62
|
+
}
|
63
|
+
}
|
64
|
+
}
|
65
|
+
```
|