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.
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) thrownewError(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});
var appArea ="MyAppArea";var apiKey ="myApiKey";var userName ="user1"var packetSize=12345;var packetFormat ="xml";var packetId =DateTime.Now().format(mobileUser+'yyMMddhhmmss'); var client = new RestClient("https://api.portal.dynamicsmobile.com/mobile/erp/push/"+appArea +"/"+userName+"?packetUniqueId="+packetId+"&size="+packetSize+"&packetType="+packetFormat);
client.Timeout=-1;var request =newRestRequest(Method.GET);request.AddHeader("x-api-key", apiKey);IRestResponse response =client.Execute(request);XmlDocument doc =newXmlDocument();doc.LoadXml(response.Content);//parse reponse and obtain the value if the uploadPath field.//use it to upload the packet content via PUT request
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) thrownewError(error);constxml=response.body;//parse the xml and iterate over the returned list of packets});
var contentFormat ="xml";var appArea ="MyAppArea";var apiKey ="12345678";var client =newRestClient("https://api.portal.dynamicsmobile.com/mobile/erp/pull/"+appArea+"?format="+contentFormat);client.Timeout=-1;var request =newRestRequest(Method.GET);request.AddHeader("x-api-key", apiKey);IRestResponse response =client.Execute(request);XmlDocument doc =newXmlDocument()doc.LoadXml(response.Content)//process the list
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.
constappArea="MyAppArea";constapiKey="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) thrownewError(error);constdownloadUrl=response.body;//execute another get request to the url returned in downloadUrl...//the downloaded content is a Synchronization Packet Format});
var appArea ="MyAppArea";var apiKey ="123456789"; //packetInternalUrl is actually conained in the url field for each packetin the pending packet list//recevied via call to the Pull Sync Packet API//here it is provided as variable to simplify the examplevar packetInternalUrl ="push_done/MYAPPAREA/2020010101/user1/xyz-abv-d011.xml";var client = new RestClient("https://api.portal.dynamicsmobile.com/mobile/erp/pull/"+appArea+"/link?path="+packetInternalUrl );
client.Timeout=-1;var request =newRestRequest(Method.GET);request.AddHeader("x-api-key", apiKey);IRestResponse response =client.Execute(request);var temporaryDownloadLink -response.Content;//execute another get request to the url returned in downloadUrl....
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
Dynamics Mobile provided by Mobile Affairs Ltd. | 1712 Sofia, Bulgaria, Alexander Malinov 51 | sales@dynamicsmobile.com
Name
Type
Description
Name
Type
Description
Name
Type
Description
Name
Type
Description
Name
Type
Description
Name
Type
Description
Name
Type
Description
Name
Type
Description
Name
Type
Description
Name
Type
Description
Name
Type
Description
Name
Type
Description
Name
Type
Description
appArea
string
The application area code
mobileUser
string
The name of the mobile user, who sends the data packet
packetUniqueId
string
Unique identifier of the packet. Stored in the cloud and can be used for tracing/issue resolution
size
number
The size of the sync packet in bytes
packetType
string
the format of sync packet content: xml or json
Content-Type
string
Must have "application/json" value
x-api-key
string
The api key for the application area
appArea
string
The application area code
packetType
string
defines the type of the packets to be pulled.
- packet ( default ) - returns only packets
- file - returns only files
format
string
the format (xml or json) in which the response will be returned
Content-Type
string
Must have value of 'application/json'
x-api-key
string
The API key for the application area.
appArea
string
The application area code
path
string
the internal cloud storage path of the packet. Can be obtained from the [url] field returned by the Pull Sync Packet API
Content-Type
string
Must have "application/json" value
x-api-key
string
The api key for the application area
appArea
string
The application area code
format
string
format of the body - xml or json
Content-Type
string
application/json or application/xml
x-api-key
string
The api key for the application area
syncpacket list
array
list of objects where each object represent a successfully processed sync packet with the following fields:
id: string
receiptHandle: string
Both of these fields are returned for each packet by call to Pull Sync Packet