XML/JSON APIから新しいREST APIへの移行

XML/JSON APIから新しいREST APIへの移行

新しいREST APIにより、開発者はより簡単で便利に、Zoho Deskの機能にアクセスして利用できるようになりました。このドキュメントでは、新しいAPIにシームレスに移行できるようにするため、古いXML/JSON APIに相当するREST APIの一覧を紹介しています。 

重要な変更
移行に関連する最も重要な変更は、次のとおりです。 

インプット/レスポンスの形式
古いAPIでは、XML形式とJSON形式の両方でレスポンスを返しました。新しいAPIでは、複雑さを軽減して使いやすさを保証するために、JSON形式でのみレスポンス応答を返すように設計しました。 

HTTPメソッド
新しいAPIでは、APIリクエストでGET、POST、PATCH、DELETEなどの基本的なHTTPメソッドを使用します。

認証
古いAPIでは、認証にauthTokenを使用していました。新しいREST APIでは、より安全なOAuthトークンを使用します。

orgId
古いAPIでは、Zoho Deskで組織を識別するために、リクエストにポータル名を使用していました。一方、新しいAPIでは、orgIdパラメーターを使用します。Get all organizations APIを使用して、組織のorgIdを取得できます。 
orgIdトークンとOauthトークンの両方を、すべてのAPIリクエストのヘッダーに含めてください。 

使用頻繁の高いXML/JSON APIと、それに対応するREST APIの一覧は、次の表のとおりです。


古いXML/JSON API
対応するREST API

/api/(xml|json)/(Requests|Cases|requests|cases)/updaterecords  


/api/(xml|json)/(Contacts|contacts)/updaterecords


/api/(xml|json)/(Accounts|accounts)/updaterecords


/api/(xml|json)/(Tasks|tasks)/updaterecords


/api/(xml|json)/(timeentry|TimeEntry)/updaterecords


/api/(xml|json)/(Contracts|contracts|Contract)/updaterecords


/api/(xml|json)/(Requests|Cases|requests|cases)/addrecords


/api/(xml|json)/(Contacts|contacts)/addrecords


/api/(xml|json)/(Accounts|accounts)/addrecords


/api/(xml|json)/(Tasks|tasks)/addrecords


/api/(xml|json)/(timeentry|TimeEntry)/addrecords


/api/(xml|json)/(Requests|Cases|requests|cases)/getrecords



/api/(xml|json)/(Accounts|accounts)/getrecords


/api/(xml|json)/(Products|products)/getrecords


/api/(xml|json)/(Contracts|contracts|Contract)/getrecords


/api/(xml|json)/(Timeentry|timeentry|TimeEntry)/getrecords


/api/(xml|json)/(Tasks|tasks)/getrecords


/api/(xml|json)/(Solutions|solutions)/getrecords


/api/(xml|json)/(Requests|Cases|requests|cases)/getrecordsbyid


/api/(xml|json)/(Contacts|contacts)/getrecordsbyid


/api/(xml|json)/(Tasks|tasks)/getrecordsbyid


/api/(xml|json)/(Accounts|accounts)/getrecordsbyid

/api/(xml|json)/(Solutions|solutions)/getrecordsbyid


/api/(xml|json)/(Requests|Cases|requests|cases)/getrecordsbycustomview 


https://desk.zoho.com/support/APIDocument.do#Tickets#Tickets_Listalltickets - このAPIリクエストでviewIdパラメーターを使用します。

https://desk.zoho.com/support/APIDocument.do#Views#Views_Listallviews - このAPIを使用して、viewIdsの一覧を取得します。

/api/(xml|json)/(Requests|Cases|requests|cases)/getrecordsbysearch


/api/(xml|json)/(Contacts|contacts)/getrecordsbysearch


/api/(xml|json)/(Accounts|accounts)/getrecordsbysearch

/api/(xml|json)/(Requests|Cases|requests|cases)/getrecordsbyowner
https://desk.zoho.com/support/APIDocument.do#Tickets#Tickets_Listalltickets - このAPIリクエストでassigneeパラメーターを使用します。

https://desk.zoho.com/support/APIDocument.do#Agents#Agents_Listallagents - このAPIを使用して、担当者の一覧を取得します。

/api/(xml|json)/(Requests|Cases|requests|cases)/deleterecords


/api/(xml|json)/(Requests|Cases|requests|cases)/getrequestthreads


/api/(xml|json)/(Requests|Cases|requests|cases)/getattachments


/api/(xml|json)/(Requests|Cases|requests|cases)/getattachmentslist


/api/(xml|json)/(Requests|Cases|requests|cases)/addattachments


/api/(xml|json)/(Requests|Cases|requests|cases)/reply


/api/(xml|json)/(departments|department)/getalldepartments


/api/(xml|json)/(portals|portal)/getportallist


/api/(xml|json)/emails/getfromaddress