Applies to Infiniti v8.0 or later
 
The REST action grants designers the ability to communicate with a REST service.

How to add a REST action to the finish node

The following input attributes are available for a REST action
 
  • Basic Auth Username:
  • Basic Auth Password: If basic authentication is required by the service, enter the appropriate username and password here.
  • Custom Headers: This is used for adding custom headers to the HTTP request method. ‘Name’ will be the name of the header and the value will be the content (Either the fixed value, answer or data question field).
  • HTTP Method: The REST method that will be used. Supported methods are GET, POST (Default), PUT and PATCH.
  • Send Access Token: This will add the currently authenticated users’ access token to the request header.
    e.g. Authorization: "Bearer Access-Token"
  • URL: This is the URL end point for the call. e.g. http://localhost/api/send
  • Send as Multipart (10.0.7 – default is false): If this option is set to true, the REST action will send all generated documents as a multipart form request. This option is required if you want to send a document other than JSON/XML or more than one document. Without this option, Infiniti will only send a single document of either XML or JSON. A multipart form request will look something like this:
 
Example of a REST post using an xml and docx file.
POST http://localhost:53908/api/send HTTP/1.1
Content-Type: multipart/form-data; boundary="c7db936f-9fe1-4ab8-8b3d-ace3fe51730f"
Host: localhost:53908
Content-Length: 10016
This is the metadata for the first document. You can see it's of type xml and is called 'Levels.xml'.
c7db936f-9fe1-4ab8-8b3d-ace3fe51730f
Content-Type: text/xml
Content-Disposition: form-data; name=Levels; filename=Levels.xml; filename*=utf-8''Levels.xml
This is the xml document
<!--?xml version="1.0" encoding="utf-8"?-->
<levels>
  <level1 name="ThisISLevel1"><level2 name=""><level3 name=""></level3></level2></level1>
</levels> 
c7db936f-9fe1-4ab8-8b3d-ace3fe51730f
This is the metadata of the second document. A word doc called 'RestDoc.docx'
Content-Type: application/vnd.openxmlformats-officedocument.wordprocessingml.document
Content-Disposition: form-data; name=RestDoc; filename=RestDoc.docx; filename*=utf-8''RestDoc.docx
Document binary
<binary data="" removed="">
</binary>
 
The following output attributes are available for a REST action
  • Response: This is the message sent back from the REST service.
 
Add a display message action with a reference to these outputs to help set up your REST action.
 

Related Articles

 

Keywords