Post to an API
Post to an API: (New – from version 2.0)
The new Post to an API allows you to integrate with external system using REST API calls. You can send the key with custom information to any external systems that has a proper REST API interface.
Go to DART >> Product Keys >> Configuration
Scroll down to Post to an API and select Yes to turn this feature on.
You will now see all options that can be used for integration with the 3rd party REST API. This is an advanced feature and obviously you just need to have bit of knowledge regarding your API the one which you are calling from here. Based on that, you have to populate the available fields to get it integrated with other REST API. Perhaps, it is very simple.
API Endpoint: The full URL of the end point which you are intended to call.
API Method: you can use POST, PUT or GET method.
API Authentication Method: Basic Authentication, Bearer Token and API Key are the methods allowed.
API Authentication Header: Pass your raw header such like below example. You can include all your additional headers but should be properly formatted.
Example: We use to send our Product Keys to our activation portal which is basically a product called License Web. The License Web has an REST API interface which requires API Key Pair. In this case I pass my header like this,
[
{
"name": "ApiKey",
"value": "7bdf85561567b8c9d672e3fbnedf"
},
{
"name": "ApiSecret",
"value": "s1a234b8c9d672e3f4a5bftg"
}
]
API Request Body: You can send any request body with proper format that your REST API end point requires.
Example, in my case our License Web portal requires below format.
{
"productName": "{{product_name}}",
"productCode": "{{sku}}",
"userName": "{{user_name}}",
"email": "{{user_email}}",
"licenseKey": "{{product_key}}",
"sendEmail": false
}
Short Codes:
The below short codes are something that can be used to acquire environment variables during an order and used dynamically.
{{product_name}} The full name of the Product.
{{sku}} sku of the product (License Web requires Product Code as an unique identifier where we use sku for that.)
{{user_name}} User’s full name as per the order.
{{user_email}} Email of the ordering user.
{{product_key}} The product key code that has been delivered in this order.