From Bright Pattern Documentation
Jump to: navigation, search
(Created page with "<translate>= Zendesk API Request = The Zendesk API Request scenario block allows you to make a free-form Zendesk API request to Zendesk using JSON, making it possible to take...")
 
Line 1: Line 1:
<translate>= Zendesk API Request =
+
<translate>
 +
= Zendesk API Request =
 +
[[File:Zendesk-API-Request-Scenario-Block-5312.PNG|225px|Zendesk API Request scenario block]]
 +
 
 +
 
 
The Zendesk API Request scenario block allows you to make a free-form Zendesk API request to Zendesk using JSON, making it possible to take a variety of actions with your integrated account. The block uses your preconfigured [[Contact-center-administrator-guide/CallCenterConfiguration/IntegrationAccounts/Zendesk|Zendesk integration account]] for authorization and so forth. Note that the HTTP method is configurable and the returned results are processed the same way as they are with the [[Scenario-builder-reference-guide/ScenarioBlocks/FetchURL|Fetch URL]] scenario block.
 
The Zendesk API Request scenario block allows you to make a free-form Zendesk API request to Zendesk using JSON, making it possible to take a variety of actions with your integrated account. The block uses your preconfigured [[Contact-center-administrator-guide/CallCenterConfiguration/IntegrationAccounts/Zendesk|Zendesk integration account]] for authorization and so forth. Note that the HTTP method is configurable and the returned results are processed the same way as they are with the [[Scenario-builder-reference-guide/ScenarioBlocks/FetchURL|Fetch URL]] scenario block.
  
  
[[File:Zendesk-API-Request-Scenario-Block-5312.PNG|225px|Zendesk API Request scenario block]]
+
[[File:Zendesk-Request-API-Properties-5399.PNG|650px|thumb|center|Zendesk API Request scenario block settings; this example block creates an entity in Zendesk]]
  
  
 
== Conditional Exits ==
 
== Conditional Exits ==
 
 
=== Failed ===
 
=== Failed ===
 
The ''Failed'' conditional exit is taken if an error occurred during the API method execution.  
 
The ''Failed'' conditional exit is taken if an error occurred during the API method execution.  
Line 15: Line 18:
  
 
== Settings ==
 
== Settings ==
 
 
=== Title text ===
 
=== Title text ===
''Title text'' is the name of the instance of the block. Enter a name in the text field and click the '''Save''' button at the bottom of the Edit pane. The new name of the block appears in the flowchart.
+
The name of the instance of the block.
  
 
=== Request type ===
 
=== Request type ===
''Request type'' is the type of method to be used to retrieve content from the specified Zendesk URL. Request types are defined in the drop-down menu.
+
The type of method to be used to retrieve content from the specified Zendesk URL.
  
 
Select from the following request types, or write in another method manually:
 
Select from the following request types, or write in another method manually:
Line 30: Line 32:
  
 
=== URL ===
 
=== URL ===
''URL'' is the URL of the Zendesk API you are requesting. Query string parameters are specified separately. Note that this overrides the '''URL setting''' in your Zendesk integration account.
+
In this field, set '''requests.json''' in order to create an entity in Zendesk.
 +
 
 +
When this scenario block executes, it constructs a request to the Zendesk API. The block takes the integration account configuration URL '''https://<yourcompany>.zendesk.com''' and appends '''/api/v2/''' and '''requests.json''' to it.
  
 
=== Set fields ===
 
=== Set fields ===
Line 36: Line 40:
  
 
=== Raw JSON ===
 
=== Raw JSON ===
''Raw JSON'' is where object properties are specified in JSON format.
+
Where object properties are specified in JSON format.
  
 
'''Note''': The code and the body of the received HTTP response will be stored in local variables ''$(integrationResultCode)'' and ''$(integrationResultBody)'', respectively. For troubleshooting purposes, use the [[scenario-builder-reference-guide/EMail|EMail]] or [[scenario-builder-reference-guide/InternalMessage|Internal Message]] block to obtain the content of responses indicating a failed attempt to create an object. For more information, see the description of the variable [[scenario-builder-reference-guide/Variables|''$(integrationResultBody)'']].
 
'''Note''': The code and the body of the received HTTP response will be stored in local variables ''$(integrationResultCode)'' and ''$(integrationResultBody)'', respectively. For troubleshooting purposes, use the [[scenario-builder-reference-guide/EMail|EMail]] or [[scenario-builder-reference-guide/InternalMessage|Internal Message]] block to obtain the content of responses indicating a failed attempt to create an object. For more information, see the description of the variable [[scenario-builder-reference-guide/Variables|''$(integrationResultBody)'']].
Line 48: Line 52:
 
=== Use GetNext block to loop through data ===
 
=== Use GetNext block to loop through data ===
 
This box is selected if the JSON response data (at the initial path) is an array. The scenario variable will be set to the first element of the array and GetNext block could be used to iterate over the array elements, setting scenario variable to the next element.
 
This box is selected if the JSON response data (at the initial path) is an array. The scenario variable will be set to the first element of the array and GetNext block could be used to iterate over the array elements, setting scenario variable to the next element.
 
 
[[File:Zendesk-API-Request-Scenario-Block-Settings-5312.PNG|650px|thumb|center|Zendesk API Request scenario block settings]]
 
  
  

Revision as of 18:01, 26 August 2020

• 5.19 • 5.3 • 5.8

Zendesk API Request

Zendesk API Request scenario block


The Zendesk API Request scenario block allows you to make a free-form Zendesk API request to Zendesk using JSON, making it possible to take a variety of actions with your integrated account. The block uses your preconfigured Zendesk integration account for authorization and so forth. Note that the HTTP method is configurable and the returned results are processed the same way as they are with the Fetch URL scenario block.


Zendesk API Request scenario block settings; this example block creates an entity in Zendesk


Conditional Exits

Failed

The Failed conditional exit is taken if an error occurred during the API method execution.

No Data

The No Data conditional exit is executed if no data is returned in the body of the HTTP response.

Settings

Title text

The name of the instance of the block.

Request type

The type of method to be used to retrieve content from the specified Zendesk URL.

Select from the following request types, or write in another method manually:

  • GET (default)
  • POST
  • PUT
  • PATCH
  • DELETE

URL

In this field, set requests.json in order to create an entity in Zendesk.

When this scenario block executes, it constructs a request to the Zendesk API. The block takes the integration account configuration URL https://<yourcompany>.zendesk.com and appends /api/v2/ and requests.json to it.

Set fields

This setting is reserved.

Raw JSON

Where object properties are specified in JSON format.

Note: The code and the body of the received HTTP response will be stored in local variables $(integrationResultCode) and $(integrationResultBody), respectively. For troubleshooting purposes, use the EMail or Internal Message block to obtain the content of responses indicating a failed attempt to create an object. For more information, see the description of the variable $(integrationResultBody).

Initial path in the result JSON

If the response body contains JSON, this setting can be used to save into scenario variables a specific part of the data. Example: myobject.node.list[4]. The default is "none"; the path starts from the root of the returned JSON.

Scenario variable prefix for JSON data

This string will be used as the name of the variable to receive parsed JSON data. Note that if the initial path above points to an array, depending on the value of the following GetNext option, this variable would either contain the array or its first (and subsequent) elements.

Use GetNext block to loop through data

This box is selected if the JSON response data (at the initial path) is an array. The scenario variable will be set to the first element of the array and GetNext block could be used to iterate over the array elements, setting scenario variable to the next element.


< Previous | Next >