オペレーション

それはから構成されます 可能な操作 特定の Url エンドポイント リソースで。

可能な場所

  • 熱 意/ヘルプ/ zest -仕様ファイル/url/紹介/">URL

子要素

  • 熱 意/ヘルプ/ zest -仕様ファイル/非推奨/">非推奨 - 熱意 /ヘルプ/ - zest 仕様ファイル/url/操作/スロットリング/">スロットリング 繰り返し - 熱 意/ヘルプ/ zest -仕様ファイル/説明/">説明 - 熱 意/ヘルプ/ zest -仕様ファイル/url/操作/外部ドキュメント/">外部ドキュメント - 熱意 /ヘルプ/ - zest 仕様ファイル/url/操作/タグ/">タグ 繰り返し - 熱 意/ヘルプ/ zest -仕様ファイル/コンテンツ/エラー/">エラー - 熱意 /ヘルプ/ -仕 zest 様ファイル/引数/">引 数 繰り返し - 熱意 /ヘルプ/ -仕 zest 様ファイル/url/操作/リクエスト本文/">リクエスト本文 繰り返し - 熱意 /ヘルプ/ -仕 zest 様ファイル/url/操作/応答/">応答 必須 繰り返し - 熱意 /ヘルプ/ -指 zest 定ファイル/url/操作/認証/">認証 繰り返し

情報:
  • ザ 熱 意/ヘルプ/ zest -仕様ファイル/コンテンツ/エラー/"> で指定します。 熱 意/ヘルプ/ zest -仕様ファイル/コンテンツ/紹介/"> レベルは常に優先されます。なぜなら、さまざまな条件を設定できるからです。 熱 意/ヘルプ/ zest -仕様ファイル/url/操作/応答/"> . 一方、操作レベルで定義されたエラーは、その特定の応答内のすべての応答に対して一般的です。 熱 意/ヘルプ/ zest -仕様ファイル/url/操作/導入/"> と保持します。 最も低い優先度.- ザ 熱 意/ヘルプ/ zest -仕様ファイル/url/操作/認証/"> 操作レベルで定義された場合は、 より高い優先度 これは、異なる操作のための異なる認証メカニズムの設定を可能にするためです。 逆に、認証は 熱 意/ヘルプ/ zest -仕様ファイル/リソース/"> レベルは、バリエーションに関係なく、すべての操作に普遍的に適用されます。 熱 意/ヘルプ/ zest -仕様ファイル/url/紹介/"> 、および最も低い優先度が与えられます。

属性


お名前 タイプ 説明
メソッド

必須

文字列 (列数) 特定の操作に適用される Http メソッド。 可能な値は、 取得、投稿、置く、パッチング、削除.
お名前


必須

文字列 操作の名前と、 ユニーク リソースのために。
カテゴリー


必須

文字列 (列数) 操作のカテゴリを定義します。 可能な値は、 読み取り、作成、更新、削除、アクション.
遅延 ロング(ミリ秒) 現在のオペレータに必要なタイムギャップ。
検証遅延 ロング(ミリ秒) 待機時間について コールバックリクエスト Api自動化


たとえば、レコードを作成し、新しく作成されたレコードの詳細を取得することを検討してください。 検証遅延が 10 秒として宣言されているとします。 レコード作成の応答を受信すると、レコードの取得コールは 10 秒後にのみ実行されます。

可視性 文字列 (列数) 要素を表示して使用できるユーザーを決定します。 可能な値は、 内部, プライベート, パブリック. デフォルト値はパブリックです。

Apiオートメーション

追加 自動車 これらの属性のプレフィックスとして指定します。

お名前 タイプ 説明
同期 ブール Api 呼び出しを順番に実行するかどうかを示します。

    * 真: Api 呼び出しは 1 つずつ実行されます。
    • 偽 (デフォルト): Api 呼び出しが同時に実行されます。
コールバック取得 ブール コールバック検証に操作を使用するかどうかを宣言します。
    * 真: コールバック検証に使用されます。
    • 偽 (デフォルト): コールバック検証には使用されません。
テスト依存性 ブール 操作を依存関係として実行するかどうかを指定します。
    * 真: 依存関係として使用されます。
    • 偽 (デフォルト): 依存関係として使用されません。

情報:

時には、Http メソッドが操作に関する十分な情報を提供しない場合があります。 たとえば、アクション api は投稿メソッドを使用することがよくあり、自動化用のレコードを作成しようとするときに混乱を引き起こします。 これに対処するために、 カテゴリー 属性は、リソースの作成 Url を識別するのに役立ちます。

サンプル

取得する

トリップリソースでは、次の詳細を含む取得操作があると仮定します。

copy

Authentication type: oAuth2
 Scope: ZohoCRM.settings.trips. READ 
* The resource will have an optional parameter called "destination". 
 Error condition: The status key in response should carry "error".
copy

Error response
 {
 "code": "INVALID_TOKEN",
 "message": "invalid oauth token",
 "status": "error"
 }

を書くための最初のステップ 熱 意/ヘルプ/ zest -仕様ファイル/リソース構成/導入/#attributes">プライマリ構造 で 熱 意/ヘルプ/ zest -仕様ファイル/コンポーネント/"> .

copy

<operation method="get" name="GET trips" category="read" visibility="internal">
 <description> Here, we have given a sample error condition, authentication, parameter, success response and error response for the trips resource.</description>
 <error condition="$.status == 'error'" />
 <argument name="destination" location="param" required="true">
 <content>
 <encode type="text/plain" />
 <structure name="wrapper">
 <property type="string" path="destinations:$.destination_name"/>
 </structure>
 </content>
 </argument>
 <response name="get_success" status="200">
 <content>
 <encode type="application/json" />
 <structure-ref name="data"/>
 </content>
 </response>
 <response name="invalid_token" status="401">
 <content>
 <encode type="application/json" />
 <structure name="error_body">
 <property name="code" type="string" values="INVALID_TOKEN"/>
 <property name="message" type="string" values="You have used an invalid oauth token."/>
 <property name="status" type="string" values="error"/>
 </structure>
 </content>
 </response>
 <authentication type="oauth2" name="get" location="header" scopes="TravelAgency.settings.trips. READ" />
 </operation>

投稿

上記で説明したのと同じ旅行リソースに対して、 操作を作成する. この操作の前提条件は次のとおりです。

copy

  • Path of external document: /Users/myfiles/Documents

copy

Success response
 {
 "code": "SUCCESS",
 "message": "Trip Created",
 "status": "success"
 }

最初のステップは、 熱 意/ヘルプ/ zest -仕様ファイル/リソース構成/導入/#attributes">プライマリ構造 で 熱 意/ヘルプ/ zest -仕様ファイル/コンポーネント/">コンポーネント に合うために 熱 意/ヘルプ/ zest -指定ファイル/url/操作/要求ボディ/"> として 旅行Id その中に提供されません。

copy

 <components>
 <structure ref-name="trips" name="trips_data">
 <property name="trip_name" type="string"/>
 <property name="trip_id" type="long_string" include-for="Request[],Response[read]"/> <!-- this property is excluded in the request body-->
 <property name="destination" type="string"/>
 <property name="start_time" type="datetime"/>
 <property name="end_time" type="datetime"/>
 <property name="no_of_days" type="string"/>
 </structure>
 <structure ref-name="data" name="wrapper">
 <property name="trips" type="collections">
 <structure-ref name="trips" />
 </property>
 </structure>
 </components>

次に、次のように投稿の操作を書きます。

copy

<operation method="post" name="POST trips" category="create">
 <external-document url="/Users/myfiles/Documents"/>
 <request-body>
 <content>
 <encode type="application/json" />
 <structure ref-name="data">
 </content>
 </request-body>
 <response name="post_success" status="201">
 <content>
 <encode type="application/json" />
 <structure>
 <property name="code" type="string" values="SUCCESS"/>
 <property name="message" type="string" values="Trip Created"/>
 <property name="status" type="string" values="success"/>
 </structure>
 </content>
 </response>
 </operation>

更新

同じ旅行リソースに対して、更新操作をサポートする必要があることを考慮してください。 最初のステップは、 熱 意/ヘルプ/ zest -仕様ファイル/リソース構成/導入/#attributess">プライマリ構造 で 熱 意/ヘルプ/ zest -仕様ファイル/コンポーネント/"> に合うために 熱 意/ヘルプ/ zest -指定ファイル/url/操作/要求ボディ/"> として 旅行Id その中に提供されます。

copy

<components>
 <structure ref-name="trips" name="trips_data">
 <property name="trip_name" type="string"/>
 <property name="trip_id" type="long_string" include-for="Request[update],Response[read]"/> <!-- this property is included in the update request body-->
 <property name="destination" type="string"/>
 <property name="start_time" type="datetime"/>
 <property name="end_time" type="datetime"/>
 <property name="no_of_days" type="string"/>
 </structure>
 <structure ref-name="data" name="wrapper">
 <property name="trips" type="collections">
 <structure-ref name="trips" />
 </property>
 </structure>
 </components>

以下は、操作で処理しなければならない追加情報です。

copy

User can make 100 calls: in 1 minute Calls beyond the limit: Operation will be locked for 2 minutes. 
* You also want to add this resource to an existing group in the help documentation called "Travel Itinerary". 

トリップリソースのプット操作を次のように書き込み、

copy

<operation method="put" name="PUT trips" category="update">
 <throttling threshold="100" duration="60000" lock-period="120000" />
 <tag name="Travel Itinerary" />
 <request-body>
 <content>
 <encode type="application/json" />
 <structure ref-name="data">
 </content>
 </request-body>
 <response name="put_success" status="200">
 <content>
 <encode type="application/json" />
 <structure>
 <property name="code" type="string" values="SUCCESS"/>
 <property name="message" type="string" values="Trip Updated"/>
 <property name="status" type="string" values="success"/>
 </structure>
 </content>
 </response>
 </operation>

削除

想像してみてください、旅行リソースの削除操作もサポートする必要があります。 以下は、いくつかの操作固有の要件です。


この操作はバージョン 4 から非推奨になり、すぐに上位のバージョンでは削除されません。


また、旅行から削除する必要がある旅行のIdを受け取ることにしました。 熱 意/ヘルプ/ zest -仕様ファイル/引数/"> . 次に、次の詳細で削除操作を次のように記述する必要があります。

copy

<operation method="put" name="PUT trips" category="update">
 <argument name="ids" location="param" required="true">
 <content>
 <encode="text/plain" />
 <structure>
 <property type="string" path="trips:$.trip_id" />
 </structure>
 </content>
 </argument>
 <response name="delete_success" status="200">
 <content>
 <encode type="application/json" />
 <structure>
 <property name="code" type="string" values="SUCCESS"/>
 <property name="message" type="string" values="Trip Deleted"/>
 <property name="status" type="string" values="success"/>
 </structure>
 </content>
 </response>
 </operation>

Last Updated 2026-02-06 15:55:45 +0530 IST