HTTP trigger type allows trigger the action/s execution by sending HTTP request outside Solution Studio to the automatically generated URL.
How to make a request with JSON data using Postman:
- Method: POST
- URL: generated automatically during Triggered Action creation. URL contains unique code parameter (API key) that can be re-generated, this code can be used in headers. Header name: x-trigger-key
-
Required headers:
Content-Type: application/json
-
Optional headers:
x-trigger-key: API key from Trigger tab
-
Body: application/JSON: Body in JSON format
{ *"RequesterName": "john@contoso.com" "name": "John Doe", "message": "Test from Postman" }
*NOTE: The RequesterName property is recommended to use in Body request. The email address is used for notifications for the case of request fails.
Limitation: Size of the body limited to 1MB
-
Response: If successful, this method returns a
200 OKresponse code "HTTP Request successfully queued for processing".
Example of using response headers and body of HTTP request in the actions:
How to make a request with JSON data using Send HTTP request action:
-
Add Triggered action: In the solution studio add Triggered Action with HTTP trigger type.
-
Add configuration list: create configuration list with columns URL and API key. Insert generated URL and API key values from created Triggered Action.
-
Create Send HTTP action: In solution studio create an action 'Send HTTP request' - add it on the display form of the list or in the list action, depends on your business logic or configuration:
URL: [[@Functions.GetFirstValueForQuery('Lists/Configurationlist', '<View Scope="Recursive"><Query><Where><Eq><FieldRef Name="Title" /><Value Type="Text" ProviderType="Expression">HTTP trigger configuration data</Value></Eq></Where></Query></View>', 'URL')]] Request type: POST Headers: Content Type - application/json x-trigger-key - [[@Functions.GetFirstValueForQuery('Lists/Configurationlist', '<View Scope="Recursive"><Query><Where><Eq><FieldRef Name="Title" /><Value Type="Text" ProviderType="Expression">HTTP trigger configuration data</Value></Eq></Where></Query></View>', 'APIkey')]] Data: =JSON.stringify({ "RequesterName": "john@contoso.com", "username": "johndoe", "password": "SecurePass123!" }) - Deploy to the target site: Create package and publish to the target site.
-
Get URL and API key for target site: After deployment in the solution studio navigate to the Publish tab -> Deployments, open the deployment. On the panel navigation to Maintenance, Click on 'Show HTTP request details'.
-
Copy the URL and API key and insert to the configuration list on the target site: This dialog provides the URL and API key required to trigger the deployed Triggered Action
To send HTTP request with JSON data and files upload using Postman:
- Method: POST
- URL: generated automatically during Triggered Action creation. URL contains unique code parameter (API key) that can be re-generated. This code can be used in headers. Header name: x-trigger-key
-
Required headers:
Content-Type: multipart/form-data
-
Optional headers:
x-trigger-key: API key from Trigger tab
-
Body:
Body → form-data
Key: file (type File)
In the form-data body it is possible also send JSON data:Key: payload (type Text)
Limitations:
- Maximum 10 files allowed per HTTP request
- File - maximum 20 MB per file -> 200 MB total
- Maximum body size - 1 MB
- Allowed/Supported file extension: .JPG, .JPEG, ,PNG, .GIF, .BMP, .WEBP, .PDF, .DOCX, .XLSX, .PPTX, .TXT, .DOC, .XLS, .PPT, .CVS, .JSON
-
Response: If successful, this method returns a
200 OKresponse code "HTTP Request successfully queued for processing".
Examples of using files from the response of HTTP trigger request:
-
You can use files as output parameter and used it in subsequent actions, for example in Send Email action:
- You can store files in the specified library using Store file action: