Endpoint
The interface framework uses a singular endpoint for all incoming messages into the system. This API is located at
https://YOUR_ENVIRONMENT.dynamics.com/api/services/SMRIFServiceGroup/SMRIFService/process
Messages are to be delivered in a json-format as specified in the inbound json format
Authentication
Authentication towards dynamics is done using a bearer token. This requires an app registration in Entra ID to be created. The ID of this app registration has to be whitelisted in dynamics.
For an overview of the authentication mechanism, and a guide on how to create this app registration, pleaser refer to Microsoft Docs.
Postman example
The following Postman workspace will allow you to send messages to your Dynamcis environment. To use this request, do the following:
- Import this workspace in to postman
- Fill all the variables (TenantId, ClientId, Client secret, D365Environment, TokenName)
- Fill in your JSON payload in the request
- Ensure your clientId is whitelisted in D365 and linked to a valid user with appropriate permissions
- Run the postman request
- Refresh the interface monitor in D365
{
"info": {
"_postman_id": "b0a4e91f-9cbf-480a-8498-c85c42ca6b3c",
"name": "Interface Framework D365FO",
"description": "Demo postman interface framework package",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
"_exporter_id": "27697420"
},
"item": [
{
"name": "TUTInIntegration",
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": "YOUR JSON PAYLOAD GOES HERE",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "https://{{D365Environment}}/api/services/SMRIFServiceGroup/SMRIFService/process",
"protocol": "https",
"host": [
"{{D365Environment}}"
],
"path": [
"api",
"services",
"SMRIFServiceGroup",
"SMRIFService",
"process"
]
}
},
"response": []
}
],
"auth": {
"type": "oauth2",
"oauth2": [
{
"key": "headerPrefix",
"value": "Bearer ",
"type": "string"
},
{
"key": "tokenName",
"value": "{{TokenName}}",
"type": "string"
},
{
"key": "scope",
"value": "",
"type": "string"
},
{
"key": "tokenRequestParams",
"value": [
{
"key": "resource",
"value": "https://{{D365Environment}}",
"enabled": true,
"send_as": "request_body"
}
],
"type": "any"
},
{
"key": "tokenType",
"value": "",
"type": "string"
},
{
"key": "accessToken",
"value": "",
"type": "string"
},
{
"key": "accessTokenUrl",
"value": "https://login.microsoftonline.com/{{TenantId}}/oauth2/token",
"type": "string"
},
{
"key": "clientSecret",
"value": "{{ClientSecret}}",
"type": "string"
},
{
"key": "clientId",
"value": "{{ClientId}}",
"type": "string"
},
{
"key": "challengeAlgorithm",
"value": "S256",
"type": "string"
},
{
"key": "username",
"value": "yourdynamicsuser@yourtenant.com",
"type": "string"
},
{
"key": "password",
"value": "ThePasswordForYourDynamicsUserAtTenantDotCom",
"type": "string"
},
{
"key": "grant_type",
"value": "client_credentials",
"type": "string"
},
{
"key": "addTokenTo",
"value": "header",
"type": "string"
},
{
"key": "client_authentication",
"value": "header",
"type": "string"
}
]
},
"event": [
{
"listen": "prerequest",
"script": {
"type": "text/javascript",
"exec": [
""
]
}
},
{
"listen": "test",
"script": {
"type": "text/javascript",
"exec": [
""
]
}
}
]
}