ERP API

Integrate any ERP with the mobile applications by sending and receiving sync packets

Push Sync Packet

GET https://api.portal.dynamicsmobile.com/erp/push/:appArea/:mobileUser

The API is used by the ERP systems to send synchronization packet for specific mobile user. The packet is processed and converted to native mobile data storage format. The mobile user receives push notification that new data is pending, so the user may start the synchronization process from the mobile app.

Path Parameters

Query Parameters

Headers

//the response must have a field success set to true and uploadPath.
{
  "success": true
  "syncLogId": "xyz-abc-def-001-002-003...", 
  "uploadPath": "https://s3.xyz.abv.abv.q24....................com"
}

//the developer must execute another PUT request with the packet content to upload the packet.

See also : Synchronization Packet Format

var request = require('request');
var options = {
  'method': 'GET',
  'url': 'https://api.portal.dynamicsmobile.com/mobile/erp/push/DMDEV01/user1?packetUniqueId=xyz-abc-01&size=32123&packetType=xml',
  'headers': {
    'x-api-key': '12321313'
  }
};
request(options, function (error, response) {
  if (error) throw new Error(error);
 const xmlResponse = response.body;
 //parse reponse and obtain the value if the uploadPath field.
 //use it to upload the packet content via PUT request
});

Pull Sync Packet

GET https://api.portal.dynamicsmobile.com/erp/pull/:appArea

The API is used by the ERP system to receive a list of inbound pending sync packets received from mobile users. The ERP must download each if the packets and then set the packets status to done.

Path Parameters

Query Parameters

Headers

var request = require('request');
var options = {
  'method': 'GET',
  'url': 'https://api.portal.dynamicsmobile.com/mobile/erp/pull/DMDEV01?packetType=packet&format=xml',
  'headers': {
    'x-api-key': '12321313'
  }
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  const xml = response.body;
  //parse the xml and iterate over the returned list of packets
  
});

GET https://api.portal.dynamicsmobile.com/erp/pull/:appArea/link

The API is used by the ERP system to obtain a temporary sync packet download link. The download must begin in the next 15 minutes ( before the temporary link expires.). This timeout is might change in the future to lower value.

Path Parameters

Query Parameters

Headers

https://s3.xyz.abv.anx.123.com..........................

const appArea = "MyAppArea";
const apiKey = "123456789"; 
var request = require('request');
var options = {
  'method': 'GET',
  'url': 'https://api.portal.dynamicsmobile.com/mobile/erp/pull/'+appArea+'/link?path=push_done/MYAPPAREA/2020010101/user1/xyz-abv-d011.xml',
  'headers': {
    'x-api-key': apiKey
  }
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  const downloadUrl = response.body;
  //execute another get request to the url returned in downloadUrl...
  //the downloaded content is a Synchronization Packet Format
});

See also : Synchronization Packet Format

Packet Status Done

POST https://api.portal.dynamicsmobile.com/erp/pull/:appArea/done

The API is used by the ERP to mark one or more packets obtained via the Pull api method as completed (done). This will make sure that the packet will not be returned again on the next call to Pull api method

Path Parameters

Query Parameters

Headers

Request Body

{
 "success":true
}

const contentFormat = "xml";
const apiKey = "123456";
const packetsToMarkAsCompleted = 
 `<messages>
   <message><id>asdasdasd1</id><receiptHandle>abvabc1</receiptHandle>,
   <message><id>asdasdasd2</id><receiptHandle>abvabc2</receiptHandle>
   <message><id>asdasdasd3</id><receiptHandle>abvabc3</receiptHandle>
  <messages>
 `
   
   ,var request = require('request');
var options = {
  'method': 'POST',
  'url': 'https://api.portal.dynamicsmobile.com/mobile/erp/pull/'+appArea+'/done?format='+contentFormat,
  'headers': {
    'x-api-key': apiKey
  }
  'Content-Type': 'application/'+contentFormat
  body: packetsToMarkAsCompleted 
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});

Last updated

Dynamics Mobile provided by Mobile Affairs Ltd. | 1712 Sofia, Bulgaria, Alexander Malinov 51 | sales@dynamicsmobile.com