Articles are content items such as help topics or tech notes contained insections. SeeCreating and editing articles in the knowledge basein Zendesk help.

Guide admins can create articles and edit all existing articles in the knowledge base. Agents who are not Guide admins can create and edit articles if they havemanagement permissions. End users can neither create nor edit articles. SeeUnderstanding Guide roles and privileges.

The Articles API has certain limitations if content blocks have been enabled for one or more articles in the help center. SeeHelp Center API limitations with content blocks.

JSON format

Articles are represented as JSON objects with the following properties:

Name Type Read-only Mandatory Description
author_id integer false false The id of the user who wrote the article (set to the user who made the request on create by default)
body string false false HTML body of the article. Unsafe tags and attributes may be removed before display. For a list of safe tags and attributes, seeAllowing unsafe HTML in Help Center articlesin Zendesk help
comments_disabled boolean false false True if comments are disabled; false otherwise
content_tag_ids array false false list of content tags attached to the article
created_at string true false The time the article was created
draft boolean true false True if the translation for the current locale is a draft; false otherwise. false by default. Can be set when creating but not when updating. For updating, see Translations
edited_at string true false The time the article was last edited in its displayed locale
html_url string true false The url of the article in Help Center
id integer true false Automatically assigned when the article is created
label_names array false false An array of label names associated with this article. By default no label names are used. Only available on certain plans
locale string false true locale that the article is being displayed in
outdated boolean true false Deprecated. Always false because the source translation is always the most up-to-date translation
outdated_locales array true false Locales in which the article was marked as outdated
permission_group_id integer false true The id of the permission group which defines who can edit and publish this article
position integer false false The position of this article in the article list. 0 by default
promoted boolean false false True if this article is promoted; false otherwise. false by default
section_id integer false false The id of the section to which this article belongs
source_locale string true false The source (default) locale of the article
title string false true The title of the article
updated_at string true false The time the article was last updated
url string true false The API url of the article
user_segment_id integer false true The id of the user segment which defines who can see this article. Set to null to make it accessible to everyone
vote_count integer true false The total number of upvotes and downvotes
vote_sum integer true false The sum of upvotes (+1) and downvotes (-1), which may be positive or negative

Example

             
{"author_id":3465,"comments_disabled":false,"id":1635,"locale":"en","permission_group_id":13,"title":"The article","user_segment_id":12}

List Articles

  • GET /api/v2/help_center{/locale}/articles
  • GET /api/v2/help_center{/locale}/categories/{category_id}/articles
  • GET /api/v2/help_center{/locale}/sections/{section_id}/articles
  • GET /api/v2/help_center/users/{user_id}/articles
  • GET /api/v2/help_center/incremental/articles?start_time={start_time}

These endpoints let you list all articles in Help Center, all articles in a given category or section, or all the articles authored by a specific agent. You can also list all articles with metadata that changed since a specifiedstart time.

To list articles by content changes, not metadata changes, filter the articles by theupdated_attimestamp of the articles'translations.

{/locale}是只需要最终用户或匿名用户。Admins and agents can omit it.

You can also use the Search API to list articles. SeeSearch.

Allowed for

  • Agents
  • End users
  • 匿名用户

The response lists only the articles that the requesting agent, end user, or anonymous user can view in Help Center.

Pagination

  • Cursor pagination (recommended)
  • Offset pagination

SeePagination.

Sorting

You can sort the results with thesort_byandsort_orderquery string parameters.

             
GET/api/v2/help_center/en-us/articles.json?sort_by=updated_at&sort_order=asc

Thesort_byparameter can have one of the following values:

value description
position order set manually using the Arrange Content page. Default order
title order alphabetically by title
created_at order by creation time
updated_at order by update time
edited_at order by the last time the title or body was edited

When sorting bytitle, the endpoint must specify a locale for the titles. Example:

             
/api/v2/help_center/en-us/articles.json?sort_by=title

Sorting byedited_atalso requires a locale. The value specifies the locale in which the title or body was last changed.

Thesort_orderparameter can have one of the following values:

value description
asc ascending order
desc descending order

Note that if sorting parameters are not passed to the section-scoped articles endpoint (/api/v2/help_center/{locale}/sections/{section_id}/articles.json), articles will be returned in the order defined on the section itself. SeeOrganizing knowledge base content in categories and sectionsfor more information about defining sort orders on sections.

Options

Start Time

You can use the incremental article endpoint to list all the articles that were updated since a certain date and time. The endpoint takes astart_timeparameter with aUnix epoch time. Example:

             
/api/v2/help_center/incremental/articles.json?start_time=1404345231
Label Names

You can specify that only articles with specific labels should be returned by adding alabel_names参数。The parameter takes a comma-separated list of up to 10 label names. Example:

             
/api/v2/help_center/en-us/articles.json?label_names=photos,camera

Only articles that have all the labels are returned. For example,label_names=photos,camerareturns all articles that have both 'photo' AND 'camera' labels. If you want the articles that have either 'photo' OR 'camera' labels, you can use theSearch Articleendpoint with thelabel_namesparameter (Professional and Enterprise).

Matching is case-sensitive. For example, 'camera' matches 'camera' but not 'Camera'.

Sideloads

The following sideloads are supported:

Name Will sideload
users the author
sections the section
categories the category
translations the article, section and category translations, if any

Unlike other sideloads, translations are embedded within the article because they're not shared between resources. Section and category translations are only sideloaded if present.

Parameters

Name Type In Required Description
label_names string 查询 false Only articles that have all the labels are returned.
sort_by string 查询 false Sorts the articles by one of the accepted values. Allowed values are "position", "title", "created_at", or "updated_at".
sort_order string 查询 false Selects the order of the results. Allowed values are "asc", or "desc".
start_time integer 查询 false You can use the incremental article endpoint to list all the articles that were updated since a certain date and time.
locale string Path false locale the item is displayed in

Code Samples

curl
              
curlhttps://{子域名}.zendesk.com/api/v2/help_center/{locale}/articles.json\-v -u{email_address}:{password}
Go
              
import("fmt""io""net/http")funcmain(){url:="https://support.zendesk.com/api/v2/help_center{/locale}/articles?label_names=photos%2Ccamera&sort_by=&sort_order=&start_time=1404345231"method:="GET"req,err:=http.NewRequest(method,url,nil)iferr!=nil{fmt.Println(err)return}req.Header.Add("Content-Type","application/json")req.Header.Add("Authorization","Basic ")// Base64 encoded "username:password"client:=&http.Client{}res,err:=client.Do(req)iferr!=nil{fmt.Println(err)return}deferres.Body.Close()body,err:=io.ReadAll(res.Body)iferr!=nil{fmt.Println(err)return}fmt.Println(string(body))}
Java
              
importcom.squareup.okhttp.*;OkHttpClientclient=newOkHttpClient();HttpUrl.BuilderurlBuilder=HttpUrl.parse("https://support.zendesk.com/api/v2/help_center{/locale}/articles").newBuilder().addQueryParameter("label_names","photos,camera").addQueryParameter("sort_by","").addQueryParameter("sort_order","").addQueryParameter("start_time","1404345231");Requestrequest=newRequest.Builder().url(urlBuilder.build()).method("GET",null).addHeader("Content-Type","application/json").addHeader("Authorization",Credentials.basic("your-email","your-password")).build();Responseresponse=client.newCall(request).execute();
Nodejs
              
varaxios=require('axios');varconfig={method:'GET',url:'https://support.zendesk.com/api/v2/help_center{/locale}/articles',headers:{'Content-Type':'application/json','Authorization':'Basic ',// Base64 encoded "username:password"},params:{'label_names':'photos%2Ccamera','sort_by':'','sort_order':'','start_time':'1404345231',},};axios(config).then(function(response){console.log(JSON.stringify(response.data));}).catch(function(error){console.log(error);});
Python
              
importrequestsurl="https://support.zendesk.com/api/v2/help_center{/locale}/articles?label_names=photos%2Ccamera&sort_by=&sort_order=&start_time=1404345231"headers={"Content-Type":"application/json",}response=requests.request("GET",url,auth=('',''),headers=headers)print(response.text)
Ruby
              
require"net/http"uri=URI("https://support.zendesk.com/api/v2/help_center{/locale}/articles")uri.query=URI.encode_www_form("label_names":"photos,camera","sort_by":"","sort_order":"","start_time":"1404345231")request=Net::HTTP::Get.new(uri,"Content-Type":"application/json")request.basic_auth"username","password"response=Net::HTTP.start uri.hostname,uri.port,use_ssl:truedo|http|http.request(request)end

Example response(s)

200 OK
              
// Status 200 OK{"articles":[{"author_id":888887,"draft":true,"id":35467,"locale":"en","permission_group_id":123,"title":"Article title","user_segment_id":12}]}

Show Article

  • GET /api/v2/help_center{/locale}/articles/{article_id}

Shows the properties of an article.

Note:{/locale}is an optional parameter for admins and agents. End users and anonymous users must provide the parameter.

Allowed for

  • Agents
  • End users
  • 匿名用户

Sideloads

The following sideloads are supported:

Name Will sideload
users the author
sections the section
categories the category
translations the article, section and category translations, if any

Unlike other sideloads, translations are embedded within the article because they're not shared between resources. Section and category translations are only sideloaded if present.

Parameters

Name Type In Required Description
article_id integer Path true The unique ID of the article
locale string Path false locale the item is displayed in

Code Samples

curl
              
curlhttps://{子域名}.zendesk.com/api/v2/help_center/{locale}/articles/{article_id}.json\-v -u{email_address}:{password}
Go
              
import("fmt""io""net/http")funcmain(){url:="https://support.zendesk.com/api/v2/help_center{/locale}/articles/360026053753"method:="GET"req,err:=http.NewRequest(method,url,nil)iferr!=nil{fmt.Println(err)return}req.Header.Add("Content-Type","application/json")req.Header.Add("Authorization","Basic ")// Base64 encoded "username:password"client:=&http.Client{}res,err:=client.Do(req)iferr!=nil{fmt.Println(err)return}deferres.Body.Close()body,err:=io.ReadAll(res.Body)iferr!=nil{fmt.Println(err)return}fmt.Println(string(body))}
Java
              
importcom.squareup.okhttp.*;OkHttpClientclient=newOkHttpClient();HttpUrl.BuilderurlBuilder=HttpUrl.parse("https://support.zendesk.com/api/v2/help_center{/locale}/articles/360026053753").newBuilder();Requestrequest=newRequest.Builder().url(urlBuilder.build()).method("GET",null).addHeader("Content-Type","application/json").addHeader("Authorization",Credentials.basic("your-email","your-password")).build();Responseresponse=client.newCall(request).execute();
Nodejs
              
varaxios=require('axios');varconfig={method:'GET',url:'https://support.zendesk.com/api/v2/help_center{/locale}/articles/360026053753',headers:{'Content-Type':'application/json','Authorization':'Basic ',// Base64 encoded "username:password"},};axios(config).then(function(response){console.log(JSON.stringify(response.data));}).catch(function(error){console.log(error);});
Python
              
importrequestsurl="https://support.zendesk.com/api/v2/help_center{/locale}/articles/360026053753"headers={"Content-Type":"application/json",}response=requests.request("GET",url,auth=('',''),headers=headers)print(response.text)
Ruby
              
require"net/http"uri=URI("https://support.zendesk.com/api/v2/help_center{/locale}/articles/360026053753")request=Net::HTTP::Get.new(uri,"Content-Type":"application/json")request.basic_auth"username","password"response=Net::HTTP.start uri.hostname,uri.port,use_ssl:truedo|http|http.request(request)end

Example response(s)

200 OK
              
// Status 200 OK{"article":{"author_id":3465,"comments_disabled":true,"content_tag_ids":["01GT23D51Y","01GT23FWWN"],"id":37486578,"locale":"en_us","permission_group_id":123,"position":42,“提升”:false,"title":"Article title","user_segment_id":12}}

Create Article

  • POST /api/v2/help_center{/locale}/sections/{section_id}/articles

Creates an article in the specifiedsection. You must specify an article title,user_segment_id, andpermission_group_id. A locale must be specified for the article, either as a parameter in the API request or in the URL. The specified locales must be enabled for the current Help Center. Optionally, you can attach existingcontent tagsby their ids or specify multipletranslations.

The current user is automatically subscribed to the article and will receive notifications when it changes.

The current user must be a member of the specified permission_group_id. To create a published article (draft=falseor missing), the current user must have publishing rights as part of the permission_group_id that is provided. Otherwise, the article must be created usingdraft=true.

Supplying anotify_subscribersproperty with a value of false will prevent subscribers to the article from receiving an article creation email notification. This can be helpful when creating many articles at a time. Specify the property in the root of the JSON object, not in the "article" object.

Allowed for

  • Agents

Parameters

Name Type In Required Description
locale string Path false locale the item is displayed in
section_id integer Path true The unique ID of the section

Example body

             
{"article":{"body":"Use a tripod","locale":"en-us","permission_group_id":56,"title":"Taking photos in low light","user_segment_id":123},"notify_subscribers":false}

Code Samples

curl

For clarity, the example places the JSON payload in a separate file and the cURL statement imports the file.

article.json

              
{"article":{"title":"Taking photos in low light","body":"Use a tripod","locale":"en-us","user_segment_id":123,"permission_group_id":56},"notify_subscribers":false}With translations{"article":{"translations":[{"locale":"en-us","title":"Taking photos in low light","body":"Use a tripod"},{"locale":"fr","title":"Comment prendre des photos en basse lumiere","body":"Utilisez un trepied"}],"user_segment_id":123,"permission_group_id":56},"notify_subscribers":false}With content tags attached{"article":{"title":"Taking photos in low light","body":"Use a tripod","content_tag_ids":["01GT23D51Y","01GT23FWWN"],"locale":"en-us","user_segment_id":123,"permission_group_id":56},"notify_subscribers":false}

curl snippet

              
curlhttps://{子域名}.zendesk.com/api/v2/help_center/sections/{section_id}/articles.json\-d @article.json\-H"Content-Type: application/json"-X POST\-v -u{email_address}:{password}
Go
              
import("fmt""io""net/http""strings")funcmain(){url:="https://support.zendesk.com/api/v2/help_center{/locale}/sections/360004785313/articles"method:="POST"payload:=strings.NewReader(`{"article": {"body": "Use a tripod","locale": "en-us","permission_group_id": 56,"title": "Taking photos in low light","user_segment_id": 123},"notify_subscribers": false}`)req,err:=http.NewRequest(method,url,payload)iferr!=nil{fmt.Println(err)return}req.Header.Add("Content-Type","application/json")req.Header.Add("Authorization","Basic ")// Base64 encoded "username:password"client:=&http.Client{}res,err:=client.Do(req)iferr!=nil{fmt.Println(err)return}deferres.Body.Close()body,err:=io.ReadAll(res.Body)iferr!=nil{fmt.Println(err)return}fmt.Println(string(body))}
Java
              
importcom.squareup.okhttp.*;OkHttpClientclient=newOkHttpClient();HttpUrl.BuilderurlBuilder=HttpUrl.parse("https://support.zendesk.com/api/v2/help_center{/locale}/sections/360004785313/articles").newBuilder();RequestBodybody=RequestBody.create(MediaType.parse("application/json"),"""{\"article\":{\"body\":\"Usea tripod\",\"locale\":\"en-us\",\"permission_group_id\":56,\"title\":\"Takingphotosinlow light\",\"user_segment_id\":123},\"notify_subscribers\":false}""");Requestrequest=newRequest.Builder().url(urlBuilder.build()).method("POST",body).addHeader("Content-Type","application/json").addHeader("Authorization",Credentials.basic("your-email","your-password")).build();Responseresponse=client.newCall(request).execute();
Nodejs
              
varaxios=require('axios');vardata=JSON.stringify({"article":{"body":"Use a tripod","locale":"en-us","permission_group_id":56,"title":"Taking photos in low light","user_segment_id":123},"notify_subscribers":false});varconfig={method:'POST',url:'https://support.zendesk.com/api/v2/help_center{/locale}/sections/360004785313/articles',headers:{'Content-Type':'application/json','Authorization':'Basic ',// Base64 encoded "username:password"},data:data,};axios(config).then(function(response){console.log(JSON.stringify(response.data));}).catch(function(error){console.log(error);});
Python
              
importrequestsimportjsonurl="https://support.zendesk.com/api/v2/help_center{/locale}/sections/360004785313/articles"payload=json.loads("""{"article": {"body": "Use a tripod","locale": "en-us","permission_group_id": 56,"title": "Taking photos in low light","user_segment_id": 123},"notify_subscribers": false}""")headers={"Content-Type":"application/json",}response=requests.request("POST",url,auth=('',''),headers=headers,json=payload)print(response.text)
Ruby
              
require"net/http"uri=URI("https://support.zendesk.com/api/v2/help_center{/locale}/sections/360004785313/articles")request=Net::HTTP::Post.new(uri,"Content-Type":"application/json")request.body=%q({"article":{"body":"Use a tripod","locale":"en-us","permission_group_id":56,"title":"Taking photos in low light","user_segment_id":123},"notify_subscribers":false})request.basic_auth"username","password"response=Net::HTTP.start uri.hostname,uri.port,use_ssl:truedo|http|http.request(request)end

Example response(s)

201 Created
              
// Status 201 Created{"article":{"author_id":3465,"comments_disabled":true,"content_tag_ids":["01GT23D51Y","01GT23FWWN"],"id":37486578,"locale":"en_us","permission_group_id":123,"position":42,“提升”:false,"title":"Article title","user_segment_id":12}}

Update Article

  • PUT /api/v2/help_center{/locale}/articles/{article_id}
  • PUT /api/v2/help_center/articles/{article_id}.json

These endpoints update article-level metadata such as its promotion status or sorting position. The endpoints do not update translation properties such as the article's title, body, locale, or draft. SeeTranslations.

Allowed for

  • Agents

Parameters

Name Type In Required Description
article_id integer Path true The unique ID of the article
locale string Path false locale the item is displayed in

Code Samples

curl

For clarity, the example places the JSON payload in a separate file and the cURL statement imports the file.

article.json

              
{"article":{“提升”:false,"position":42,"comments_disabled":true,"label_names":["photo","tripod"],"content_tag_ids":["01GT23D51Y","01GT23FWWN"]}}

curl snippet

              
curlhttps://{子域名}.zendesk.com/api/v2/help_center/articles/{article_id}.json\-d @article.json\-H"Content-Type: application/json"-X PUT\-v -u{email_address}:{password}
Go
              
import("fmt""io""net/http")funcmain(){url:="https://support.zendesk.com/api/v2/help_center{/locale}/articles/360026053753"method:="PUT"req,err:=http.NewRequest(method,url,nil)iferr!=nil{fmt.Println(err)return}req.Header.Add("Content-Type","application/json")req.Header.Add("Authorization","Basic ")// Base64 encoded "username:password"client:=&http.Client{}res,err:=client.Do(req)iferr!=nil{fmt.Println(err)return}deferres.Body.Close()body,err:=io.ReadAll(res.Body)iferr!=nil{fmt.Println(err)return}fmt.Println(string(body))}
Java
              
importcom.squareup.okhttp.*;OkHttpClientclient=newOkHttpClient();HttpUrl.BuilderurlBuilder=HttpUrl.parse("https://support.zendesk.com/api/v2/help_center{/locale}/articles/360026053753").newBuilder();RequestBodybody=RequestBody.create(MediaType.parse("application/json"),"""""");Requestrequest=newRequest.Builder().url(urlBuilder.build()).method("PUT",body).addHeader("Content-Type","application/json").addHeader("Authorization",Credentials.basic("your-email","your-password")).build();Responseresponse=client.newCall(request).execute();
Nodejs
              
varaxios=require('axios');varconfig={method:'PUT',url:'https://support.zendesk.com/api/v2/help_center{/locale}/articles/360026053753',headers:{'Content-Type':'application/json','Authorization':'Basic ',// Base64 encoded "username:password"},};axios(config).then(function(response){console.log(JSON.stringify(response.data));}).catch(function(error){console.log(error);});
Python
              
importrequestsurl="https://support.zendesk.com/api/v2/help_center{/locale}/articles/360026053753"headers={"Content-Type":"application/json",}response=requests.request("PUT",url,auth=('',''),headers=headers)print(response.text)
Ruby
              
require"net/http"uri=URI("https://support.zendesk.com/api/v2/help_center{/locale}/articles/360026053753")request=Net::HTTP::Put.new(uri,"Content-Type":"application/json")request.basic_auth"username","password"response=Net::HTTP.start uri.hostname,uri.port,use_ssl:truedo|http|http.request(request)end

Example response(s)

200 OK
              
// Status 200 OK{"article":{"author_id":3465,"comments_disabled":true,"content_tag_ids":["01GT23D51Y","01GT23FWWN"],"id":37486578,"locale":"en_us","permission_group_id":123,"position":42,“提升”:false,"title":"Article title","user_segment_id":12}}

Update Article Source Locale

  • PUT /api/v2/help_center{/locale}/articles/{article_id}/source_locale

Updates the article'ssource_localeproperty. The source locale is the main language of the article. When you delete the article in the source locale, you delete all the article's translations.

The endpoint sets one of the article's translation as the source locale of the article. The article in the previous source locale becomes a translation, which you can delete separately.

The new source locale must be enabled in Guide. SeeEnabling languages for your help center. You can use theList all enabled locales and default localeendpoint to check for the enabled locales.

Allowed for

  • Agents

Parameters

Name Type In Required Description
article_id integer Path true The unique ID of the article
locale string Path false locale the item is displayed in

Code Samples

curl
              
curlhttps://{子域名}.zendesk.com/api/v2/help_center/articles/{article_id}/source_locale.json\-d'{"article_locale": "fr"}'-v -u{email_address}:{password}-X PUT\-H"Content-Type: application/json"
Go
              
import("fmt""io""net/http")funcmain(){url:="https://support.zendesk.com/api/v2/help_center{/locale}/articles/360026053753/source_locale"method:="PUT"req,err:=http.NewRequest(method,url,nil)iferr!=nil{fmt.Println(err)return}req.Header.Add("Content-Type","application/json")req.Header.Add("Authorization","Basic ")// Base64 encoded "username:password"client:=&http.Client{}res,err:=client.Do(req)iferr!=nil{fmt.Println(err)return}deferres.Body.Close()body,err:=io.ReadAll(res.Body)iferr!=nil{fmt.Println(err)return}fmt.Println(string(body))}
Java
              
importcom.squareup.okhttp.*;OkHttpClientclient=newOkHttpClient();HttpUrl.BuilderurlBuilder=HttpUrl.parse("https://support.zendesk.com/api/v2/help_center{/locale}/articles/360026053753/source_locale").newBuilder();RequestBodybody=RequestBody.create(MediaType.parse("application/json"),"""""");Requestrequest=newRequest.Builder().url(urlBuilder.build()).method("PUT",body).addHeader("Content-Type","application/json").addHeader("Authorization",Credentials.basic("your-email","your-password")).build();Responseresponse=client.newCall(request).execute();
Nodejs
              
varaxios=require('axios');varconfig={method:'PUT',url:'https://support.zendesk.com/api/v2/help_center{/locale}/articles/360026053753/source_locale',headers:{'Content-Type':'application/json','Authorization':'Basic ',// Base64 encoded "username:password"},};axios(config).then(function(response){console.log(JSON.stringify(response.data));}).catch(function(error){console.log(error);});
Python
              
importrequestsurl="https://support.zendesk.com/api/v2/help_center{/locale}/articles/360026053753/source_locale"headers={"Content-Type":"application/json",}response=requests.request("PUT",url,auth=('',''),headers=headers)print(response.text)
Ruby
              
require"net/http"uri=URI("https://support.zendesk.com/api/v2/help_center{/locale}/articles/360026053753/source_locale")request=Net::HTTP::Put.new(uri,"Content-Type":"application/json")request.basic_auth"username","password"response=Net::HTTP.start uri.hostname,uri.port,use_ssl:truedo|http|http.request(request)end

Example response(s)

200 OK
              
// Status 200 OKnull

Associate Attachments in Bulk to Article

  • POST /api/v2/help_center{/locale}/articles/{article_id}/bulk_attachments

You can associate attachments in bulk to only one article at a time, with a maximum of 20 attachments per request.

To create the attachments, seeCreate Unassociated Attachment.

Allowed for

  • Agents

Parameters

Name Type In Required Description
article_id integer Path true The unique ID of the article
locale string Path false locale the item is displayed in

Code Samples

curl
              
curlhttps://{子域名}.zendesk.com/api/v2/help_center/articles/{article_id}/bulk_attachments.json\-d'{"attachment_ids": [10002, ...]}'\-v -u{email_address}:{password}-X POST -H"Content-Type: application/json"
Go
              
import("fmt""io""net/http")funcmain(){url:="https://support.zendesk.com/api/v2/help_center{/locale}/articles/360026053753/bulk_attachments"method:="POST"req,err:=http.NewRequest(method,url,nil)iferr!=nil{fmt.Println(err)return}req.Header.Add("Content-Type","application/json")req.Header.Add("Authorization","Basic ")// Base64 encoded "username:password"client:=&http.Client{}res,err:=client.Do(req)iferr!=nil{fmt.Println(err)return}deferres.Body.Close()body,err:=io.ReadAll(res.Body)iferr!=nil{fmt.Println(err)return}fmt.Println(string(body))}
Java
              
importcom.squareup.okhttp.*;OkHttpClientclient=newOkHttpClient();HttpUrl.BuilderurlBuilder=HttpUrl.parse("https://support.zendesk.com/api/v2/help_center{/locale}/articles/360026053753/bulk_attachments").newBuilder();RequestBodybody=RequestBody.create(MediaType.parse("application/json"),"""""");Requestrequest=newRequest.Builder().url(urlBuilder.build()).method("POST",body).addHeader("Content-Type","application/json").addHeader("Authorization",Credentials.basic("your-email","your-password")).build();Responseresponse=client.newCall(request).execute();
Nodejs
              
varaxios=require('axios');varconfig={method:'POST',url:'https://support.zendesk.com/api/v2/help_center{/locale}/articles/360026053753/bulk_attachments',headers:{'Content-Type':'application/json','Authorization':'Basic ',// Base64 encoded "username:password"},};axios(config).then(function(response){console.log(JSON.stringify(response.data));}).catch(function(error){console.log(error);});
Python
              
importrequestsurl="https://support.zendesk.com/api/v2/help_center{/locale}/articles/360026053753/bulk_attachments"headers={"Content-Type":"application/json",}response=requests.request("POST",url,auth=('',''),headers=headers)print(response.text)
Ruby
              
require"net/http"uri=URI("https://support.zendesk.com/api/v2/help_center{/locale}/articles/360026053753/bulk_attachments")request=Net::HTTP::Post.new(uri,"Content-Type":"application/json")request.basic_auth"username","password"response=Net::HTTP.start uri.hostname,uri.port,use_ssl:truedo|http|http.request(request)end

Example response(s)

200 OK
              
// Status 200 OKnull

Archive Article

  • DELETE /api/v2/help_center{/locale}/articles/{article_id}

Archives the article. You can restore the article using the Help Center user interface. SeeViewing and restoring archived articles.

Allowed for

  • Agents

Parameters

Name Type In Required Description
article_id integer Path true The unique ID of the article
locale string Path false locale the item is displayed in

Code Samples

Curl
              
curl--request DELETE https://support.zendesk.com/api/v2/help_center{/locale}/articles/360026053753\--header"Content-Type: application/json"\-u username:password
              
curlhttps://{子域名}.zendesk.com/api/v2/help_center/articles/{article_id}.json\-v -u{email_address}:{password}-X DELETE
Go
              
import("fmt""io""net/http")funcmain(){url:="https://support.zendesk.com/api/v2/help_center{/locale}/articles/360026053753"method:="DELETE"req,err:=http.NewRequest(method,url,nil)iferr!=nil{fmt.Println(err)return}req.Header.Add("Content-Type","application/json")req.Header.Add("Authorization","Basic ")// Base64 encoded "username:password"client:=&http.Client{}res,err:=client.Do(req)iferr!=nil{fmt.Println(err)return}deferres.Body.Close()body,err:=io.ReadAll(res.Body)iferr!=nil{fmt.Println(err)return}fmt.Println(string(body))}
Java
              
importcom.squareup.okhttp.*;OkHttpClientclient=newOkHttpClient();HttpUrl.BuilderurlBuilder=HttpUrl.parse("https://support.zendesk.com/api/v2/help_center{/locale}/articles/360026053753").newBuilder();Requestrequest=newRequest.Builder().url(urlBuilder.build()).method("DELETE",null).addHeader("Content-Type","application/json").addHeader("Authorization",Credentials.basic("your-email","your-password")).build();Responseresponse=client.newCall(request).execute();
Nodejs
              
varaxios=require('axios');varconfig={method:'DELETE',url:'https://support.zendesk.com/api/v2/help_center{/locale}/articles/360026053753',headers:{'Content-Type':'application/json','Authorization':'Basic ',// Base64 encoded "username:password"},};axios(config).then(function(response){console.log(JSON.stringify(response.data));}).catch(function(error){console.log(error);});
Python
              
importrequestsurl="https://support.zendesk.com/api/v2/help_center{/locale}/articles/360026053753"headers={"Content-Type":"application/json",}response=requests.request("DELETE",url,auth=('',''),headers=headers)print(response.text)
Ruby
              
require"net/http"uri=URI("https://support.zendesk.com/api/v2/help_center{/locale}/articles/360026053753")request=Net::HTTP::删除.new(uri,"Content-Type":"application/json")request.basic_auth"username","password"response=Net::HTTP.start uri.hostname,uri.port,use_ssl:truedo|http|http.request(request)end

Example response(s)

204 No Content
              
// Status 204 No Contentnull