NAV
cUrl Python JavaScript C#

Introduction

Welcome to the SmartConnect API!

The API can be used to remotely interact with SmartConnect. Some of the core functions are:

Requirements

To use this version of the REST API you will need the following:

Getting Started

Connecting to the API will require the following information. The API Settings can be access in SmartConnect.com > System API Settings

Needed Variables

Variable Description
API Url Base Url for accessing the SmartConnect API.
Customer Id Unique identifier for your SmartConnect tenant.
Username The email address of a user with access to the SmartConnect tenant.
Password Password the user uses to access the SmartConnect.com application.

Image of API Settings

Authentication

SmartConnect requires the user email, password, and companyId to generate a token. The password will need to be encrypted using RSA encrytion using the PKCS #1 standard

Password Encryption

Password encryption will be required prior to sending the requests for "GetCompanyList" and "GetToken". Encryption will require the most recent public-key containing the RSA module and exponent.

If you want to quickly encrypt your password for testing, it can be done here

HTTP Request

POST
https://login.smartconnect.com/v1/public-key

To encrypt the password, use this code:

check other languages
def get_encrypted_password(password):
    import xml.etree.ElementTree as ElementTree
    from Crypto.PublicKey.RSA import construct
    from Crypto.Cipher import PKCS1_v1_5
    from base64 import b64decode
    import base64
    import requests
    password = password.encode('utf-8')

    #get public key 
    response = requests.post('https://login.smartconnect.com/v1/public-key')
    key = response.text.replace('"','')
    root = ElementTree.fromstring(key)

    # decode base64 string to be used as modulus(n) and exponent(e) components
    modulus = b64decode(root[0].text)
    exponent = b64decode(root[1].text)

    n = int.from_bytes(modulus, byteorder='big')
    e = int.from_bytes(exponent, byteorder='big')

    pubkey = construct((n, e))
    pubkey = PKCS1_v1_5.new(pubkey)
    encrypted = pubkey.encrypt(password)

    # base64 encode the bytes
    print(base64.b64encode(encrypted).decode())
function encryptPassword() {
  var password = 'my password';
  var n = 'vYofWQ63vYJZTB/EW4NT5LMlfiB5LftMMQSbJgFHvfE+Z8AXnCLNplBByGLWBLMolSwJZjJdUN5gLF0V/Q9aVwOK5GWAezt8IPwMYqAgwQ2btnlhrsKLkKoTtogGj9MYz9briYn/DHZlW56aOYvwSoz1LYhnoja59cG2UvIXxVE=';
  var e = 'AQAB';
  var rsa = forge.pki.rsa;
  var BigInteger = forge.jsbn.BigInteger;

  function parseBigInteger(b64) {
    return new BigInteger(forge.util.createBuffer(forge.util.decode64(b64)).toHex(), 16);
   }
  var pubKey = rsa.setPublicKey(parseBigInteger(n), parseBigInteger(e));
  var encryptedData = pubKey.encrypt(document.getElementById(password).value, 'RSAES-PKCS1-V1_5');
  // write output
  document.write('Encrypted Password: ' + btoa(encryptedData) +
  '<br>Unencrypted Password: ' + encodeURIComponent(btoa(encryptedData)));
}
string password = "my password";
string rsaXml, encryptedPwd;
System.Net.WebRequest request = System.Net.WebRequest.Create("https://login.smartconnect.com/v1/public-key");
request.Method = "POST";
request.ContentLength = 0;
System.Net.WebResponse response = request.GetResponse();

using (System.IO.StreamReader responseStream = new System.IO.StreamReader(response.GetResponseStream()))
    {
        string result = responseStream.ReadToEnd();
        rsaXml = result.Replace("\"","");
    }

using (RSACryptoServiceProvider RSA = new RSACryptoServiceProvider(1024))
    {
        RSA.FromXmlString(rsaXml);
        byte[] plainText = System.Text.Encoding.ASCII.GetBytes(password);
        byte[] cipherbytes = RSA.Encrypt(plainText, System.Security.Cryptography.RSAEncryptionPadding.Pkcs1);
        //Base64 encode bytes
        encryptedPwd = Convert.ToBase64String(cipherbytes);
        //URL encode encrypted password
        encryptedPwd = System.Net.WebUtility.UrlEncode(encryptedPwd);
        // Message Box with encrypted password
        MessageBox.Show(encryptedPwd);
    }

A request for the public key will return an xml payload:

<RSAKeyValue>
    <Modulus>vYofWQ63vYJZTB/EW4NT5LMlfiB5LftMMQSbJgFHvfE+Z8AXnCLNplBByGLWBLMolSwJZjJdUN5gLF0V/Q9aVwOK5GWAezt8IPwMYqAgwQ2btnlhrsKLkKoTtogGj9MYz9briYn/DHZlW56aOYvwSoz1LYhnoja59cG2UvIXxVE=</Modulus>
    <Exponent>AQAB</Exponent>
</RSAKeyValue>

An encrypted password will look like this:

"Bqr+OK0r4f8gURRCt3RCmxfem2PF2lE5lMIZ2ZsOEu9rDmEk93wuFrFIRFPLX4Wm8HDq7HgNn/mj7TT18uQj1UpqFVoizQLs6TWgLLUdqjxqeTFamvJaAVUh392tsQDTgkHkU4UwB8MABay2lr987GJIUDd4MaC2Aj11t8XjaXCU="

GetCompanyList

Optionally, you can retrieve a list of companies with the GetCompanyList endpoint. This will return the CustomerId the same as shown in the SmartConnect client.

HTTP Request

POST
https://{{api_url}}/GetCompanyList

To retrieve a list of companies, use this code:

curl POST "{{api_url}}/GetCompanyList?email={{Username}}&password={{EncryptedPassword}}"
  -H 'Accept: application/json' 
import requests
import json
url = "{{API Url}}/GetCompanyList?email={{Username}}&password={{EncryptedPassword}}&companyId={{Customer Id}}"

response = requests.request("POST", url)

print(response.text.encode('utf8'))
var xhr = new XMLHttpRequest();
xhr.open("POST", "{{api_url}}/GetCompanyList?email={{Username}}&password={{EncryptedPassword}}");
xhr.setRequestHeader("Content-Type", "application/json");

xhr.send();
System.Net.WebRequest request = System.Net.WebRequest.Create("https://{{api_url}}/GetCompanyList?email={{Username}}&password={{EncryptedPassword}}");
request.Method = "POST";
request.ContentLength = 0;
request.ContentType = "application/json";

System.Net.WebResponse response = request.GetResponse();

using(System.IO.StreamReader responseStream = new System.IO.StreamReader(response.GetResponseStream()))
{
 string result = responseStream.ReadToEnd(); 
}

return result;

The above command returns JSON structured like this:

[
    {
        "Id": "48caf272-d140-449c-aa3b-c5d0a03082dc",
        "Name": "Demo Company 1",
        "SubscriptionExpiry": null
    },
    {
        "Id": "2a1aec61-e7d0-4fb0-b597-d08cc2992efa",
        "Name": "Demo Company 2",
        "SubscriptionExpiry": null
    }
]

GetToken

The GetToken endpoint requires 3 parameters. To generate a token.

HTTP Request

POST
https://{{API_Url}}/GetToken

To generate a token, use this code:

curl POST "{{API Url}}/GetToken?email={{Username}}&password={{EncryptedPassword}}&companyId={{Customer Id}}"
import requests

url = "{{API Url}}/GetToken?email={{Username}}&password={{EncryptedPassword}}&companyId={{Customer Id}}"

response = requests.request("POST", url)

print(response.text.encode('utf8'))
var xhr = new XMLHttpRequest();
xhr.open("POST", "{{api_url}}/GetToken?email={{Username}}&password={{EncryptedPassword}}&companyId={{Customer Id}}");
xhr.setRequestHeader("Content-Type", "application/json");

xhr.send();
System.Net.WebRequest request = System.Net.WebRequest.Create("https://{{api_url}}/GetToken?email={{Username}}&password={{EncryptedPassword}}&&companyId={{Customer Id}");
request.Method = "POST";
request.ContentLength = 0;
request.ContentType = "application/json";

System.Net.WebResponse response = request.GetResponse();

using(System.IO.StreamReader responseStream = new System.IO.StreamReader(response.GetResponseStream()))
{
 string result = responseStream.ReadToEnd(); 
}

return result;

The above command returns a string:

"Um5UVHZsWU1XZ09xYzE1R3dOZXhNV0Jka25FcEg3L2ZtZjVMSkxIdEZsUT0jQjE2QkIzNTMtNTFFOC00MkNBLTgxRDEtNUVCQjA0QUIxMzQ5I0MzMzhDRUI1LTBEOTctNEU1Ny05MDU4LUNFN0NBRDNEODU2RCNFVEhBTi5TT1JFTlNPTkBFT05FU09MVVRJT05TLkNPTSMyMDIwLTEwLTAyVDA4OjA1OjE1Ljg2Ng=="

Query Parameters

Parameter Required Description
email true The email address of a user with access to the SmartConnect tenant.
password true Password the user uses to access the SmartConnect.com application.
companyId true Customer id from the API Settings Page.

Validate

The Validate endpoint will return a Boolean to inform the client whether the token is valid or not.

HTTP Request

POST
https://{{API_Url}}/validate

To validate stored token, use this code:

curl POST "{{API Url}}/validate?token={{Token}}"
import requests

url = "{{API Url}}/validate?token={{Token}}"

response = requests.request("POST", url)

print(response.text.encode('utf8'))
var xhr = new XMLHttpRequest();
xhr.open("POST", "{{api_url}}/validate?token={{Token}}");
xhr.setRequestHeader("Content-Type", "application/json");

xhr.send();
System.Net.WebRequest request = System.Net.WebRequest.Create("{{api_url}}/validate?token={{Token}}");
request.Method = "POST";
request.ContentLength = 0;
request.ContentType = "application/json";

System.Net.WebResponse response = request.GetResponse();

using(System.IO.StreamReader responseStream = new System.IO.StreamReader(response.GetResponseStream()))
{
 string result = responseStream.ReadToEnd(); 
}

return result;

The above command returns a boolean:

true

Query Parameters

Parameter Required Description
token true Stored token from the GetToken endpoint.

Map Information

The Map Information endpoints can be used to retrieve information about process setups.

GetConnections

This endpoint retrieves all configured connections.

HTTP Request

GET
https://{{API_Url}}/GetConnections

To retrieve a list of connections, use this code:

curl GET "{{API Url}}/GetConnections?token={{Token}}" \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' 
import requests

url = "{{API Url}}/GetConnections?token={{Token}}"
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request("GET", url, headers=headers)

print(response.text.encode('utf8'))
var xhr = new XMLHttpRequest();
xhr.open("GET", "{{API Url}}/GetConnections?token={{Token}}");
xhr.setRequestHeader("Content-Type", "application/json");

xhr.send();
System.Net.WebRequest request = System.Net.WebRequest.Create("{{API Url}}/GetConnections?token={{Token}}");
request.Method = "GET";
request.ContentType = "application/json";

System.Net.WebResponse response = request.GetResponse();
string result = string.Empty;
using(System.IO.StreamReader responseStream = new System.IO.StreamReader(response.GetResponseStream()))
{
 string result = responseStream.ReadToEnd(); 
}

return result;

The above command returns JSON structured like this:

[
  {
    "Id": "c365b728-60e0-4841-841c-ab73008dd41d",
    "Description": "Production SalesForce",
    "ConnectionType": "SalesForce"
  },
  {
    "Id": "1b763e98-37c4-4d32-8320-abb200d82e59",
    "Description": "Sandbox NAV",
    "ConnectionType": "Dynamics NAV Odata"
  }
]

Query Parameters

Parameter Required Description
token true Token generated by the GetToken endpoint

GetDataSources

This endpoint retrieves all configured Data Sources.

HTTP Request

GET
https://{{API_Url}}/GetDataSources

To retrieve a list of Data Sources, use this code:

curl GET "{{API Url}}/GetDataSources?token={{Token}}" \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' 
import requests

url = "{{API Url}}/GetDataSources?token={{Token}}"
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request("GET", url, headers=headers)

print(response.text.encode('utf8'))
var xhr = new XMLHttpRequest();
xhr.open("GET", "{{API Url}}/GetDataSources?token={{Token}}");
xhr.setRequestHeader("Content-Type", "application/json");

xhr.send();
System.Net.WebRequest request = System.Net.WebRequest.Create("{{API Url}}/GetDataSources?token={{Token}}");
request.Method = "GET";
request.ContentType = "application/json";

System.Net.WebResponse response = request.GetResponse();
string result = string.Empty;
using(System.IO.StreamReader responseStream = new System.IO.StreamReader(response.GetResponseStream()))
{
 string result = responseStream.ReadToEnd(); 
}

return result;

The above command returns JSON structured like this:

[
  {
    "Id": "bea56ad6-2b4e-4c4f-ae68-a9cf008cee3d",
    "Description": "Accounts",
    "ConnectionId": "8586a527-76d4-4dc4-9128-a92f00e3b85e",
    "Company": "eOne D365Demo",
    "Type": "Microsoft CRM Real-Time Data Source"
  },
  {
    "Id": "3727ed7d-f6bc-4a8d-8b00-a9d800f01fe9",
    "Description": "Bank File",
    "ConnectionId": "00000000-0000-0000-0000-000000000000",
    "Company": "",
    "Type": "Microsoft Excel"
  }
]

Query Parameters

Parameter Required Description
token true Token generated by the GetToken endpoint

GetMapList

This endpoint retrieves all processes that can be used by the SmartConnect API.

HTTP Request

POST
https://{{API_Url}}/GetMapList

To retrieve a list of processes, use this code:

curl POST "{{API Url}}/GetMapList?token={{Token}}" \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' 
import requests

url = "{{API Url}}/GetMapList?token={{Token}}"
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request("POST", url, headers=headers)

print(response.text.encode('utf8'))
var xhr = new XMLHttpRequest();
xhr.open("POST", "{{API Url}}/GetMapList?token={{Token}}");
xhr.setRequestHeader("Content-Type", "application/json");

xhr.send();
System.Net.WebRequest request = System.Net.WebRequest.Create("{{API Url}}/GetMapList?token={{Token}}");
request.Method = "POST";
request.ContentType = "application/json";

System.Net.WebResponse response = request.GetResponse();
string result = string.Empty;
using(System.IO.StreamReader responseStream = new System.IO.StreamReader(response.GetResponseStream()))
{
 string result = responseStream.ReadToEnd(); 
}

return result;

The above command returns JSON structured like this:

[
  {
    "MapKey": "c365b728-60e0-4841-841c-ab73008dd41d",
    "MapId": "Import Customers",
    "MapDescription": "Customers to BC"
  },
  {
    "MapKey": "1b763e98-37c4-4d32-8320-abb200d82e59",
    "MapId": "Import Sales Orders",
    "MapDescription": "Sales Orders to BC"
  }
]

Query Parameters

Parameter Required Description
token true Token generated by the GetToken endpoint

GetProcessesByConnection

This endpoint retrieves all integration processes configured using the specified Connection as the target.

HTTP Request

GET
https://{{API_Url}}/GetProcessesByConnection

To retrieve a list of Integration Processes by Connnection, use this code:

curl GET "{{API Url}}/GetProcessesByConnection?token={{Token}}&connectionId={{connectionId}}" \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' 
import requests

url = "{{API Url}}/GetProcessesByConnection?token={{Token}}&connectionId={{connectionId}}"
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request("GET", url, headers=headers)

print(response.text.encode('utf8'))
var xhr = new XMLHttpRequest();
xhr.open("GET", "{{API Url}}/GetProcessesByConnection?token={{Token}}&connectionId={{connectionId}}");
xhr.setRequestHeader("Content-Type", "application/json");

xhr.send();
System.Net.WebRequest request = System.Net.WebRequest.Create("{{API Url}}/GetProcessesByConnection?token={{Token}}&connectionId={{connectionId}}");
request.Method = "GET";
request.ContentType = "application/json";

System.Net.WebResponse response = request.GetResponse();
string result = string.Empty;
using(System.IO.StreamReader responseStream = new System.IO.StreamReader(response.GetResponseStream()))
{
 string result = responseStream.ReadToEnd(); 
}

return result;

The above command returns JSON structured like this:

{
    "Items": [
        {
            "mapKey": "00000000-0000-0000-0000-000000000000",
            "mapId": "BULK BC ITEM Import",
            "mapDescription": "Bulk update of inventory levels from BC to Magento",
            "connectionId": "49514fca-f62b-445a-ae93-ac1500dcba76",
            "connectionType": "eOne.SmartConnect.Connectors.GenericRest.GenericRestDestination",
            "destinationType": "eOne.SmartConnect.Connectors.GenericRest.GenericRestDestination",
            "storesErrors": true,
            "isOutputProcess": false,
            "lines": [
                {
                    "lineId": "c2f66328-46b6-429c-bbed-ac2200c71305",
                    "description": "Update Product Inventory",
                    "technicalName": "_a2e1d210-70ed-4361-8b9c-ac2200c1845d",
                    "technicalValue": ""
                }
            ],
            "tenants": [
                {
                    "tenantId": "98f6d277-5934-4eed-a0ee-ac2200c87093",
                    "name": "GenericRest",
                    "serverName": "Magento 2",
                    "technicalName": "Magento"
                }
            ]
        }
    ]
}

Query Parameters

Parameter Required Description
token true Token generated by the GetToken endpoint
connectionId true Unique id for the connection

GetProcessesForDatasource

This endpoint retrieves all integration processes configured using the specified Data Source.

HTTP Request

GET
https://{{API_Url}}/GetProcessesForDatasource

To retrieve a list of Integration Processes by Data Source, use this code:

curl GET "{{API Url}}/GetProcessesForDatasource?token={{Token}}&dataSourceId={{dataSourceId}}" \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' 
import requests

url = "{{API Url}}/GetProcessesForDatasource?token={{Token}}&dataSourceId={{dataSourceId}}"
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request("GET", url, headers=headers)

print(response.text.encode('utf8'))
var xhr = new XMLHttpRequest();
xhr.open("GET", "{{API Url}}/GetProcessesForDatasource?token={{Token}}&dataSourceId={{dataSourceId}}");
xhr.setRequestHeader("Content-Type", "application/json");

xhr.send();
System.Net.WebRequest request = System.Net.WebRequest.Create("{{API Url}}/GetProcessesForDatasource?token={{Token}}&dataSourceId={{dataSourceId}}");
request.Method = "GET";
request.ContentType = "application/json";

System.Net.WebResponse response = request.GetResponse();
string result = string.Empty;
using(System.IO.StreamReader responseStream = new System.IO.StreamReader(response.GetResponseStream()))
{
 string result = responseStream.ReadToEnd(); 
}

return result;

The above command returns JSON structured like this:

[
    {
        "Id": "cfff743a-ae7b-4262-bd6f-aa3800d8c374",
        "MapId": "PURCHASE DOCUMENTS",
        "Description": "Importing Purchase Documents",
        "SourceType": "eOne.SmartConnect.Connectors.NAV.Odata.MsNavOdataDatasourceAssociation",
        "TargetType": "eOne.SmartConnect.Connectors.Crm2011.MsCrm2011Destination"
    }
]

Query Parameters

Parameter Required Description
token true Token generated by the GetToken endpoint
dataSourceId true Unique id for the Data Source

GetMapColumns

This endpoint retrieves all columns defined in the data source of the process.

HTTP Request

POST
https://{{API_Url}}/GetMapColumns

To retrieve a list of columns defined in a process, use this code:

curl POST "{{API Url}}/GetMapColumns?token={{Token}}&mapKey={{mapKey}}" \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' 
import requests

url = "{{API Url}}/GetMapColumns?token={{Token}}&mapKey={{mapKey}}"
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request("POST", url, headers=headers)

print(response.text.encode('utf8'))
var xhr = new XMLHttpRequest();
xhr.open("POST", "{{API Url}}/GetMapColumns?token={{Token}}&mapKey={{mapKey}}");
xhr.setRequestHeader("Content-Type", "application/json");

xhr.send();
System.Net.WebRequest request = System.Net.WebRequest.Create("{{API Url}}/GetMapColumns?token={{Token}}&mapKey={{mapKey}}");
request.Method = "POST";
request.ContentType = "application/json";

System.Net.WebResponse response = request.GetResponse();
string result = string.Empty;
using(System.IO.StreamReader responseStream = new System.IO.StreamReader(response.GetResponseStream()))
{
 string result = responseStream.ReadToEnd(); 
}

return result;

The above command returns JSON structured like this:

[
    {
        "ColumnName": "AccountNumber",
        "IsRequired": true
    },
    {
        "ColumnName": "AccountName",
        "IsRequired": false
    },
    {
        "ColumnName": "Phone",
        "IsRequired": false
    }
]

Query Parameters

Parameter Required Description
token true Token generated by the GetToken endpoint
mapKey true Unique identifier for the process to retrieve

GetMappedMapColumns

This endpoint retrieves all source columns mapped to the target of the process.

HTTP Request

POST
https://{{API_Url}}/GetMappedMapColumns

To retrieve a list of columns mapped in the destination, use this code:

curl POST "{{API Url}}/GetMappedMapColumns?token={{Token}}&mapKey={{mapKey}}" \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' 
import requests

url = "{{API Url}}/GetMappedMapColumns?token={{Token}}&mapKey={{mapKey}}"
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request("POST", url, headers=headers)

print(response.text.encode('utf8'))
var xhr = new XMLHttpRequest();
xhr.open("POST", "{{API Url}}/GetMappedMapColumns?token={{Token}}&mapKey={{mapKey}}");
xhr.setRequestHeader("Content-Type", "application/json");

xhr.send();
System.Net.WebRequest request = System.Net.WebRequest.Create("{{API Url}}/GetMappedMapColumns?token={{Token}}&mapKey={{mapKey}}");
request.Method = "POST";
request.ContentType = "application/json";

System.Net.WebResponse response = request.GetResponse();
string result = string.Empty;
using(System.IO.StreamReader responseStream = new System.IO.StreamReader(response.GetResponseStream()))
{
 string result = responseStream.ReadToEnd(); 
}

return result;

The above command returns JSON structured like this:

[
    {
        "ColumnName": "AccountNumber",
        "IsRequired": true
    },
    {
        "ColumnName": "AccountName",
        "IsRequired": false
    },
    {
        "ColumnName": "Phone",
        "IsRequired": false
    }
]

Query Parameters

Parameter Required Description
token true Token generated by the GetToken endpoint
mapKey true Unique identifier for the process to retrieve

Map Data

The Map Data endpoints can be used to retrieve data from the data source defined in SmartConnect. If the data source is a query, a call will be made by SmartConnect to the source application for live data.

GetAllData

This endpoint retrieves the current defined source for the specified process.

HTTP Request

POST
https://{{API_Url}}/GetAllData

To retrieve currently defined source data, use this code:

curl POST "{{API Url}}/GetAllData?token={{Token}}&mapKey={{mapKey}}" \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/xml' 
import requests

url = "{{API Url}}/GetAllData?token={{Token}}&mapKey={{mapKey}}"
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/xml'
}

response = requests.request("POST", url, headers=headers)

print(response.text.encode('utf8'))
var xhr = new XMLHttpRequest();
xhr.open("POST", "{{API Url}}/GetAllData?token={{Token}}&mapKey={{mapKey}}");
xhr.setRequestHeader("Content-Type", "application/json");

xhr.send();
System.Net.WebRequest request = System.Net.WebRequest.Create("{{API Url}}/GetAllData?token={{Token}}&mapKey={{mapKey}}");
request.Method = "POST";
request.ContentType = "application/json";

System.Net.WebResponse response = request.GetResponse();
string result = string.Empty;
using(System.IO.StreamReader responseStream = new System.IO.StreamReader(response.GetResponseStream()))
{
 string result = responseStream.ReadToEnd(); 
}

return result;

The above command returns XML structured like this:

<string xmlns="http://schemas.microsoft.com/2003/10/Serialization/">&lt;MyDataSet&gt;&#xD;
  &lt;Table01&gt;&#xD;
    &lt;AccountNumber&gt;&lt;![CDATA[CUST001]]&gt;&lt;/AccountNumber&gt;&#xD;
    &lt;AccountName&gt;&lt;![CDATA[Purus Limited]]&gt;&lt;/AccountName&gt;&#xD;
    &lt;AddressCode&gt;&lt;![CDATA[Other]]&gt;&lt;/AddressCode&gt;&#xD;
    &lt;Address1&gt;&lt;![CDATA[373-1399 Ultrices St.]]&gt;&lt;/Address1&gt;&#xD;
    &lt;City&gt;&lt;![CDATA[Denver]]&gt;&lt;/City&gt;&#xD;
    &lt;State&gt;&lt;![CDATA[CO]]&gt;&lt;/State&gt;&#xD;
    &lt;ZIP&gt;&lt;![CDATA[92336]]&gt;&lt;/ZIP&gt;&#xD;
    &lt;Phone&gt;&lt;![CDATA[(303) 654-2228]]&gt;&lt;/Phone&gt;&#xD;
    &lt;Currency&gt;&lt;![CDATA[CAD$]]&gt;&lt;/Currency&gt;&#xD;
  &lt;/Table01&gt;&#xD;
&lt;/MyDataSet&gt;</string>

Query Parameters

Parameter Required Description
token true Token generated by the GetToken endpoint
mapKey true Unique identifier for the process to retrieve

GetAllDataWithVariables

This endpoint retrieves the current defined source for the specified process. If the data source is using Global Variables in the query, the values passed in the body will be applied as filters prior to retrieving the data.

For additional information about Global Variables reference this article

HTTP Request

POST
https://{{API_Url}}/GetAllDataWithVariables

To retrieve currently defined source with Global Variable filters, use this code:

curl POST "{{API Url}}/GetAllDataWithVariables?token={{Token}}&mapKey={{mapKey}}" \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/xml' \
  -d '{ 
      "Variables": "[ { Key: \"GBL_COUNTY\", Value: \"GA\" } ]", 
      "Xml": "" 
    }'
import requests

url = "{{API Url}}/GetAllDataWithVariables?token={{Token}}&mapKey={{mapKey}}"
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/xml'
}
payload = 
{ 
  "Variables": "[ { Key: \"GBL_COUNTY\", Value: \"GA\" } ]", 
  "Xml": "" 
}

response = requests.request("POST", url, headers=headers, data = payload)

print(response.text.encode('utf8'))
var data = "{ \r\n  \"Variables\": \"[ { Key: \\\"GBL_COUNTY\\\", Value: \\\"GA\\\" } ]\", \r\n  \"Xml\": \"\" \r\n}";
var xhr = new XMLHttpRequest();
xhr.open("POST", "{{API Url}}/GetAllDataWithVariables?token={{Token}}&mapKey={{mapKey}}");
xhr.setRequestHeader("Content-Type", "application/json");
xhr.setRequestHeader("Accept", "application/xml");

xhr.send(data);
string data = "{ \r\n  \"Variables\": \"[ { Key: \\\"GBL_COUNTY\\\", Value: \\\"GA\\\" } ]\", \r\n  \"Xml\": \"\" \r\n}";
System.Net.WebRequest request = System.Net.WebRequest.Create("{{API Url}}/GetAllDataWithVariables?token={{Token}}&mapKey={{mapKey}}");
request.Method = "POST";
request.ContentType = "application/json";
request.ContentLength = data.Length;

using(Stream reqStream = request.GetRequestStream())
{
 reqStream.Write(Encoding.ASCII.GetBytes(xml),0,xml.Length);
}

System.Net.WebResponse response = request.GetResponse();
string result = string.Empty;
using(System.IO.StreamReader responseStream = new System.IO.StreamReader(response.GetResponseStream()))
{
 string result = responseStream.ReadToEnd(); 
}

return result;

The above command returns XML structured like this:

<string xmlns="http://schemas.microsoft.com/2003/10/Serialization/">&lt;MyDataSet&gt;&#xD;
  &lt;Table01&gt;&#xD;
    &lt;AccountNumber&gt;&lt;![CDATA[CUST001]]&gt;&lt;/AccountNumber&gt;&#xD;
    &lt;AccountName&gt;&lt;![CDATA[Purus Limited]]&gt;&lt;/AccountName&gt;&#xD;
    &lt;AddressCode&gt;&lt;![CDATA[Other]]&gt;&lt;/AddressCode&gt;&#xD;
    &lt;Address1&gt;&lt;![CDATA[373-1399 Ultrices St.]]&gt;&lt;/Address1&gt;&#xD;
    &lt;City&gt;&lt;![CDATA[Denver]]&gt;&lt;/City&gt;&#xD;
    &lt;State&gt;&lt;![CDATA[CO]]&gt;&lt;/State&gt;&#xD;
    &lt;ZIP&gt;&lt;![CDATA[92336]]&gt;&lt;/ZIP&gt;&#xD;
    &lt;Phone&gt;&lt;![CDATA[(303) 654-2228]]&gt;&lt;/Phone&gt;&#xD;
    &lt;Currency&gt;&lt;![CDATA[CAD$]]&gt;&lt;/Currency&gt;&#xD;
  &lt;/Table01&gt;&#xD;
&lt;/MyDataSet&gt;</string>

Query Parameters

Parameter Required Description
token true Token generated by the GetToken endpoint
mapKey true Unique identifier for the process to retrieve

Map Runs

The Map Run endpoints can be used to run maps in SmartConnect. Upon completion of the map run in SmartConnect, the web service will respond with a status message.

Run Map Properties

Attribute Type Description
ErrorCount integer Number of failed records
Errors data-table XMl data table, populated when a record fails
MapDescription string Map Description field for the process
MapKey guid Unique identifier for the process
MapId string Map Id field for the process
RecordCount integer Number of records processed in run
RunNumber integer Run number
Status boolean 0 = success, 1 = failure
ErrorMessage string Last Error Message from the run

RunMap

This endpoint runs the specified Integration Process.

HTTP Request

POST
https://{{API_Url}}/runmap

To run a specified process, use this code:

curl POST "{{API Url}}/runmap?token={{Token}}&mapKey={{mapKey}}" \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' 
import requests

url = "{{API Url}}/runmap?token={{Token}}&mapKey={{mapKey}}"
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request("POST", url, headers=headers)

print(response.text.encode('utf8'))
var xhr = new XMLHttpRequest();
xhr.open("POST", "{{API Url}}/runmap?token={{Token}}&mapKey={{mapKey}}");
xhr.setRequestHeader("Content-Type", "application/json");
xhr.setRequestHeader("Accept", "application/json");

xhr.send();
System.Net.WebRequest request = System.Net.WebRequest.Create("{{API Url}}/runmap?token={{Token}}&mapKey={{mapKey}}");
request.Method = "POST";
request.ContentLength = 0;
request.ContentType = "application/json";

System.Net.WebResponse response = request.GetResponse();

using(System.IO.StreamReader responseStream = new System.IO.StreamReader(response.GetResponseStream()))
{
 string result = responseStream.ReadToEnd(); 
}

return result;

The above command returns JSON structured like this:

{
    "ErrorCount": 1,
    "Errors": "",
    "MapDescription": "Import of Purchase Journal",
    "MapKey": "364fde19-0748-4d10-886f-a95300a506c5",
    "MapId": "EXCEL TO BUSINESS CENTRAL PURCHASE JOURNAL",
    "RecordCount": 1,
    "RunNumber": 80,
    "Status": 1,
    "ErrorMessage": "Document was not sent due to document errors."

The errors field will contain an XML Data Table:

<NewDataSet>\r\n  
    <xs:schema id=\"NewDataSet\"
        xmlns=\"\"
        xmlns:xs=\"http://www.w3.org/2001/XMLSchema\"
        xmlns:msdata=\"urn:schemas-microsoft-com:xml-msdata\">\r\n    
        <xs:element name=\"NewDataSet\" msdata:IsDataSet=\"true\" msdata:MainDataTable=\"ErrorTable\" msdata:UseCurrentLocale=\"true\">\r\n      
            <xs:complexType>\r\n        
                <xs:choice minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n          
                    <xs:element name=\"ErrorTable\">\r\n            
                        <xs:complexType>\r\n              
                            <xs:sequence>\r\n                
                                <xs:element name=\"accountnumber\" type=\"xs:string\" minOccurs=\"0\" />\r\n                
                                <xs:element name=\"CustomerID\" type=\"xs:string\" minOccurs=\"0\" />\r\n                
                                <xs:element name=\"name\" type=\"xs:string\" minOccurs=\"0\" />\r\n                
                                <xs:element name=\"EONERUNERRORS\" type=\"xs:string\" minOccurs=\"0\" />\r\n              
                            </xs:sequence>\r\n            
                        </xs:complexType>\r\n          
                    </xs:element>\r\n        
                </xs:choice>\r\n      
            </xs:complexType>\r\n    
        </xs:element>\r\n  
    </xs:schema>\r\n  
    <ErrorTable>\r\n    
        <accountnumber>C0008</accountnumber>\r\n    
        <CustomerID>IDs</CustomerID>\r\n    
        <name>Test Account 008</name>\r\n    
        <EONERUNERRORS>Document was not sent due to document errors.</EONERUNERRORS>\r\n  
    </ErrorTable>\r\n
    <ErrorTable>\r\n    
        <accountnumber>C0007</accountnumber>\r\n    
        <CustomerID>IDs</CustomerID>\r\n    
        <name>Test Account 007</name>\r\n    
        <EONERUNERRORS>Document was not sent due to document errors.</EONERUNERRORS>\r\n  
    </ErrorTable>\r\n
</NewDataSet>

Query Parameters

Parameter Required Description
token true Token generated by the GetToken endpoint
mapKey true Unique identifier for the process to retrieve

RunMapWithVariables

This endpoint runs the specified process. If the process is using Global Variables, then the default value for those variables can be provided in the body of the request.

For additional information about Global Variables reference this article

HTTP Request

POST
https://{{API_Url}}/RunMapWithVariables

To run a specified process and provide Global Variables, use this code:

curl POST "{{API Url}}/RunMapWithVariables?token={{Token}}&mapKey={{mapKey}}" \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' 
  -d '[
       {
         "Key": "GBL_TEST",
         "Value": "107210"
        },
      {
         "Key": "GBL_TEST2",
         "Value": "Sample"
       }
     ]'
import requests

url = "{{API Url}}/RunMapWithVariables?token={{Token}}&mapKey={{mapKey}}"
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}
payload = 
[
    {
        "Key": "GBL_TEST",
        "Value": "107210"
    },
    {
        "Key": "GBL_TEST2",
        "Value": "Sample"
    }
]

response = requests.request("POST", url, headers=headers, data = payload)

print(response.text.encode('utf8'))
var data = JSON.stringify({"Variables":"[ { Key: \"GBL_COUNTY\", Value: \"GA\" } ]","Xml":""});
var xhr = new XMLHttpRequest();
xhr.open("POST", "{{API Url}}/RunMapWithVariables?token={{Token}}&mapKey={{mapKey}}");
xhr.setRequestHeader("Content-Type", "application/json");
xhr.setRequestHeader("Accept", "application/json");

xhr.send(data);
string data = "{ \r\n  \"Variables\": \"[ { Key: \\\"GBL_COUNTY\\\", Value: \\\"GA\\\" } ]\", \r\n  \"Xml\": \"\" \r\n}";
System.Net.WebRequest request = System.Net.WebRequest.Create("{{API Url}}/RunMapWithVariables?token={{Token}}&mapKey={{mapKey}}");
request.Method = "POST";
request.ContentType = "application/json";
request.ContentLength = data.Length;

using(Stream reqStream = request.GetRequestStream())
{
 reqStream.Write(Encoding.ASCII.GetBytes(xml),0,xml.Length);
}

System.Net.WebResponse response = request.GetResponse();
string result = string.Empty;
using(System.IO.StreamReader responseStream = new System.IO.StreamReader(response.GetResponseStream()))
{
 string result = responseStream.ReadToEnd(); 
}

return result;

The above command returns JSON structured like this:

{
    "ErrorCount": 1,
    "Errors": "",
    "MapDescription": "Import of Purchase Journal",
    "MapKey": "364fde19-0748-4d10-886f-a95300a506c5",
    "MapId": "EXCEL TO BUSINESS CENTRAL PURCHASE JOURNAL",
    "RecordCount": 1,
    "RunNumber": 80,
    "Status": 1,
    "ErrorMessage": "Document was not sent due to document errors."

The errors field will contain an XML Data Table:

<NewDataSet>\r\n  
    <xs:schema id=\"NewDataSet\"
        xmlns=\"\"
        xmlns:xs=\"http://www.w3.org/2001/XMLSchema\"
        xmlns:msdata=\"urn:schemas-microsoft-com:xml-msdata\">\r\n    
        <xs:element name=\"NewDataSet\" msdata:IsDataSet=\"true\" msdata:MainDataTable=\"ErrorTable\" msdata:UseCurrentLocale=\"true\">\r\n      
            <xs:complexType>\r\n        
                <xs:choice minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n          
                    <xs:element name=\"ErrorTable\">\r\n            
                        <xs:complexType>\r\n              
                            <xs:sequence>\r\n                
                                <xs:element name=\"accountnumber\" type=\"xs:string\" minOccurs=\"0\" />\r\n                
                                <xs:element name=\"CustomerID\" type=\"xs:string\" minOccurs=\"0\" />\r\n                
                                <xs:element name=\"name\" type=\"xs:string\" minOccurs=\"0\" />\r\n                
                                <xs:element name=\"EONERUNERRORS\" type=\"xs:string\" minOccurs=\"0\" />\r\n              
                            </xs:sequence>\r\n            
                        </xs:complexType>\r\n          
                    </xs:element>\r\n        
                </xs:choice>\r\n      
            </xs:complexType>\r\n    
        </xs:element>\r\n  
    </xs:schema>\r\n  
    <ErrorTable>\r\n    
        <accountnumber>C0008</accountnumber>\r\n    
        <CustomerID>IDs</CustomerID>\r\n    
        <name>Test Account 008</name>\r\n    
        <EONERUNERRORS>Document was not sent due to document errors.</EONERUNERRORS>\r\n  
    </ErrorTable>\r\n
    <ErrorTable>\r\n    
        <accountnumber>C0007</accountnumber>\r\n    
        <CustomerID>IDs</CustomerID>\r\n    
        <name>Test Account 007</name>\r\n    
        <EONERUNERRORS>Document was not sent due to document errors.</EONERUNERRORS>\r\n  
    </ErrorTable>\r\n
</NewDataSet>

Query Parameters

Parameter Required Description
token true Token generated by the GetToken endpoint
mapKey true Unique identifier for the process to retrieve

RunMapDataTable

This endpoint runs the specified process with the provided XML data table.

HTTP Request

POST
https://{{API_Url}}/RunMapDataTable

Sample XML Payload:

<RequestData>
    <Variables>
        <ArrayOfVariableOfstringstring>
            <VariableOfstringstring>
                <Key>GBL_COUNTY</Key>
                <Value>ND</Value>
            </VariableOfstringstring>
        </ArrayOfVariableOfstringstring>
    </Variables>
    <Xml>
        <Table>
            <Name>C00070</Name>
            <No>C00070</No>
            <County>ID</County>
        </Table>
    </Xml>
</RequestData>

To run a specified process with provided source data, use this code:

curl POST "{{API Url}}/RunMapDataTable?token={{Token}}&mapKey={{mapKey}}" \
  -H 'Content-Type: text/xml' \
  -H 'Accept: application/json' 
  -d '<RequestData>
        <Variables>
            <ArrayOfVariableOfstringstring>
                <VariableOfstringstring>
                    <Key>GBL_COUNTY</Key>
                    <Value>ND</Value>
                </VariableOfstringstring>
            </ArrayOfVariableOfstringstring>
        </Variables>
        <Xml>
            <Table>
                <Name>C00070</Name>
                <No>C00070</No>
                <County>ID</County>
            </Table>
        </Xml>
    </RequestData>
import requests

url = "{{API Url}}/RunMapDataTable?token={{Token}}&mapKey={{mapKey}}"
headers = {
  'Content-Type': 'text/xml',
  'Accept': 'application/json'
}
payload = 
"<RequestData>
    <Variables>
        <ArrayOfVariableOfstringstring>
            <VariableOfstringstring>
                <Key>GBL_COUNTY</Key>
                <Value>ND</Value>
            </VariableOfstringstring>
        </ArrayOfVariableOfstringstring>
    </Variables>
    <Xml>
        <Table>
            <Name>C00070</Name>
            <No>C00070</No>
            <County>ID</County>
        </Table>
    </Xml>
</RequestData>"

response = requests.request("POST", url, headers=headers, data = payload)

print(response.text.encode('utf8'))
var data =  "<RequestData>"
+ "<Variables>"
+ "<ArrayOfVariableOfstringstring>"
+ "<VariableOfstringstring>"
+ "<Key>GBL_COUNTY</Key>"
+ "<Value>ND</Value>"
+ "</VariableOfstringstring>"
+ "</ArrayOfVariableOfstringstring>"
+ "</Variables>"
+ "<Xml>"
+ "<Table>"
+ "<Name>C00070</Name>"
+ "<No>C00070</No>"
+ "<County>ID</County>"
+ "</Table>"
+ "</Xml>"
+ "</RequestData>";
var xhr = new XMLHttpRequest();
xhr.open("POST", "{{API Url}}/RunMapDataTable?token={{Token}}&mapKey={{mapKey}}");
xhr.setRequestHeader("Content-Type", "application/xml");
xhr.setRequestHeader("Accept", "application/json");

xhr.send(data);
string data =  "<RequestData>"
+ "<Variables>"
+ "<ArrayOfVariableOfstringstring>"
+ "<VariableOfstringstring>"
+ "<Key>GBL_COUNTY</Key>"
+ "<Value>ND</Value>"
+ "</VariableOfstringstring>"
+ "</ArrayOfVariableOfstringstring>"
+ "</Variables>"
+ "<Xml>"
+ "<Table>"
+ "<Name>C00070</Name>"
+ "<No>C00070</No>"
+ "<County>ID</County>"
+ "</Table>"
+ "</Xml>"
+ "</RequestData>";
System.Net.WebRequest request = System.Net.WebRequest.Create("{{API Url}}/RunMapDataTable?token={{Token}}&mapKey={{mapKey}}");
request.Method = "POST";
request.ContentType = "application/xml";
request.ContentLength = data.Length;

using(Stream reqStream = request.GetRequestStream())
{
 reqStream.Write(Encoding.ASCII.GetBytes(xml),0,xml.Length);
}

System.Net.WebResponse response = request.GetResponse();
string result = string.Empty;
using(System.IO.StreamReader responseStream = new System.IO.StreamReader(response.GetResponseStream()))
{
 string result = responseStream.ReadToEnd(); 
}

return result;

The above command returns JSON structured like this:

{
    "ErrorCount": 1,
    "Errors": "",
    "MapDescription": "Import of Purchase Journal",
    "MapKey": "364fde19-0748-4d10-886f-a95300a506c5",
    "MapId": "EXCEL TO BUSINESS CENTRAL PURCHASE JOURNAL",
    "RecordCount": 1,
    "RunNumber": 80,
    "Status": 1,
    "ErrorMessage": "Document was not sent due to document errors."

Query Parameters

Parameter Required Description
token true Token generated by the GetToken endpoint
mapKey true Unique identifier for the process to retrieve

RunMapDataTableWithErrors

This endpoint runs the specified process with the provided XML data table, and returns error messages.

HTTP Request

POST
https://{{API_Url}}/RunMapDataTableWithErrors

Sample XML Payload:

<RequestData>
    <Variables>
        <ArrayOfVariableOfstringstring>
            <VariableOfstringstring>
                <Key>GBL_COUNTY</Key>
                <Value>ND</Value>
            </VariableOfstringstring>
        </ArrayOfVariableOfstringstring>
    </Variables>
    <Xml>
        <Table>
            <Name>C00070</Name>
            <No>C00070</No>
            <County>ID</County>
        </Table>
    </Xml>
</RequestData>

To run a specified process with provided source data, use this code:

curl POST "{{API Url}}/RunMapDataTableWithErrors?token={{Token}}&mapKey={{mapKey}}" \
  -H 'Content-Type: text/xml' \
  -H 'Accept: application/json' 
  -d '<RequestData>
        <Variables>
            <ArrayOfVariableOfstringstring>
                <VariableOfstringstring>
                    <Key>GBL_COUNTY</Key>
                    <Value>ND</Value>
                </VariableOfstringstring>
            </ArrayOfVariableOfstringstring>
        </Variables>
        <Xml>
            <Table>
                <Name>C00070</Name>
                <No>C00070</No>
                <County>ID</County>
            </Table>
        </Xml>
    </RequestData>
import requests

url = "{{API Url}}/RunMapDataTableWithErrors?token={{Token}}&mapKey={{mapKey}}"
headers = {
  'Content-Type': 'text/xml',
  'Accept': 'application/json'
}
payload = 
"<RequestData>
    <Variables>
        <ArrayOfVariableOfstringstring>
            <VariableOfstringstring>
                <Key>GBL_COUNTY</Key>
                <Value>ND</Value>
            </VariableOfstringstring>
        </ArrayOfVariableOfstringstring>
    </Variables>
    <Xml>
        <Table>
            <Name>C00070</Name>
            <No>C00070</No>
            <County>ID</County>
        </Table>
    </Xml>
</RequestData>"

response = requests.request("POST", url, headers=headers, data = payload)

print(response.text.encode('utf8'))
var data =  "<RequestData>"
+ "<Variables>"
+ "<ArrayOfVariableOfstringstring>"
+ "<VariableOfstringstring>"
+ "<Key>GBL_COUNTY</Key>"
+ "<Value>ND</Value>"
+ "</VariableOfstringstring>"
+ "</ArrayOfVariableOfstringstring>"
+ "</Variables>"
+ "<Xml>"
+ "<Table>"
+ "<Name>C00070</Name>"
+ "<No>C00070</No>"
+ "<County>ID</County>"
+ "</Table>"
+ "</Xml>"
+ "</RequestData>";
var xhr = new XMLHttpRequest();
xhr.open("POST", "{{API Url}}/RunMapDataTableWithErrors?token={{Token}}&mapKey={{mapKey}}");
xhr.setRequestHeader("Content-Type", "application/xml");
xhr.setRequestHeader("Accept", "application/json");

xhr.send(data);
string data =  "<RequestData>"
+ "<Variables>"
+ "<ArrayOfVariableOfstringstring>"
+ "<VariableOfstringstring>"
+ "<Key>GBL_COUNTY</Key>"
+ "<Value>ND</Value>"
+ "</VariableOfstringstring>"
+ "</ArrayOfVariableOfstringstring>"
+ "</Variables>"
+ "<Xml>"
+ "<Table>"
+ "<Name>C00070</Name>"
+ "<No>C00070</No>"
+ "<County>ID</County>"
+ "</Table>"
+ "</Xml>"
+ "</RequestData>";
System.Net.WebRequest request = System.Net.WebRequest.Create("{{API Url}}/RunMapDataTableWithErrors?token={{Token}}&mapKey={{mapKey}}");
request.Method = "POST";
request.ContentType = "application/xml";
request.ContentLength = data.Length;

using(Stream reqStream = request.GetRequestStream())
{
 reqStream.Write(Encoding.ASCII.GetBytes(xml),0,xml.Length);
}

System.Net.WebResponse response = request.GetResponse();
string result = string.Empty;
using(System.IO.StreamReader responseStream = new System.IO.StreamReader(response.GetResponseStream()))
{
 string result = responseStream.ReadToEnd(); 
}

return result;

The above command returns JSON structured like this:

{
    "ErrorCount": 1,
    "Errors": "",
    "MapDescription": "Import of Purchase Journal",
    "MapKey": "364fde19-0748-4d10-886f-a95300a506c5",
    "MapId": "EXCEL TO BUSINESS CENTRAL PURCHASE JOURNAL",
    "RecordCount": 1,
    "RunNumber": 80,
    "Status": 1,
    "ErrorMessage": "Document was not sent due to document errors."

The errors field will contain an XML Data Table:

<NewDataSet>\r\n  
    <xs:schema id=\"NewDataSet\"
        xmlns=\"\"
        xmlns:xs=\"http://www.w3.org/2001/XMLSchema\"
        xmlns:msdata=\"urn:schemas-microsoft-com:xml-msdata\">\r\n    
        <xs:element name=\"NewDataSet\" msdata:IsDataSet=\"true\" msdata:MainDataTable=\"ErrorTable\" msdata:UseCurrentLocale=\"true\">\r\n      
            <xs:complexType>\r\n        
                <xs:choice minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n          
                    <xs:element name=\"ErrorTable\">\r\n            
                        <xs:complexType>\r\n              
                            <xs:sequence>\r\n                
                                <xs:element name=\"accountnumber\" type=\"xs:string\" minOccurs=\"0\" />\r\n                
                                <xs:element name=\"CustomerID\" type=\"xs:string\" minOccurs=\"0\" />\r\n                
                                <xs:element name=\"name\" type=\"xs:string\" minOccurs=\"0\" />\r\n                
                                <xs:element name=\"EONERUNERRORS\" type=\"xs:string\" minOccurs=\"0\" />\r\n              
                            </xs:sequence>\r\n            
                        </xs:complexType>\r\n          
                    </xs:element>\r\n        
                </xs:choice>\r\n      
            </xs:complexType>\r\n    
        </xs:element>\r\n  
    </xs:schema>\r\n  
    <ErrorTable>\r\n    
        <accountnumber>C0008</accountnumber>\r\n    
        <CustomerID>IDs</CustomerID>\r\n    
        <name>Test Account 008</name>\r\n    
        <EONERUNERRORS>Document was not sent due to document errors.</EONERUNERRORS>\r\n  
    </ErrorTable>\r\n
    <ErrorTable>\r\n    
        <accountnumber>C0007</accountnumber>\r\n    
        <CustomerID>IDs</CustomerID>\r\n    
        <name>Test Account 007</name>\r\n    
        <EONERUNERRORS>Document was not sent due to document errors.</EONERUNERRORS>\r\n  
    </ErrorTable>\r\n
</NewDataSet>

Query Parameters

Parameter Required Description
token true Token generated by the GetToken endpoint
mapKey true Unique identifier for the process to retrieve

RunMapXml

This endpoint runs the specified process with the provided XML encoded data table, and returns error messages.

HTTP Request

POST
https://{{API_Url}}/RunMapXml

To run a specified process and provide Global Variables, use this code:

curl POST "{{API Url}}/RunMapXml?token={{Token}}&mapKey={{mapKey}}" \
  -H 'Content-Type: text/xml' \
  -H 'Accept: application/json' 
  -d '<RequestData xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
          <Variables/>
          <Xml>&lt;DataSet&gt;&#xD;
              &lt;Table&gt;&#xD;
                &lt;accountnumber&gt;C00070&lt;/accountnumber&gt;&#xD;
              &lt;name&gt;Test Account 001&lt;/name&gt;&#xD;
              &lt;/Table&gt;&#xD;
            &lt;/DataSet&gt;
          </Xml>
      </RequestData>'
import requests

url = "{{API Url}}/RunMapXml?token={{Token}}&mapKey={{mapKey}}"
headers = {
  'Content-Type': 'text/xml',
  'Accept': 'application/json'
}
payload = 
" <RequestData xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
      <Variables/>
      <Xml>&lt;DataSet&gt;&#xD;
          &lt;Table&gt;&#xD;
            &lt;accountnumber&gt;C00070&lt;/accountnumber&gt;&#xD;
          &lt;name&gt;Test Account 001&lt;/name&gt;&#xD;
          &lt;/Table&gt;&#xD;
        &lt;/DataSet&gt;
      </Xml>
  </RequestData>
"
response = requests.request("POST", url, headers=headers, data = payload)

print(response.text.encode('utf8'))
var data =  "<RequestData xmlns:i=\"http://www.w3.org/2001/XMLSchema-instance\">"  
+ "</Variables>"
+ "<Xml>&lt;DataSet&gt;&#xD;"
+ "&lt;Table&gt;&#xD;"
+ "&lt;County&gt;ND&lt;/County&gt;&#xD;"
+ "&lt;Name&gt;Test&lt;/Name&gt;&#xD;"
+ "&lt;No&gt;Test&lt;/No&gt;&#xD;"
+ "&lt;/Table&gt;&#xD;"
+ "&lt;/DataSet&gt;</Xml>"
+ "</RequestData>";
var xhr = new XMLHttpRequest();
xhr.open("POST", "{{API Url}}/RunMapXml?token={{Token}}&mapKey={{mapKey}}");
xhr.setRequestHeader("Content-Type", "application/xml");
xhr.setRequestHeader("Accept", "application/json");

xhr.send(data);
string data = "<RequestData xmlns:i=\"http://www.w3.org/2001/XMLSchema-instance\">"  
+ "</Variables>"
+ "<Xml>&lt;DataSet&gt;&#xD;"
+ "&lt;Table&gt;&#xD;"
+ "&lt;County&gt;ND&lt;/County&gt;&#xD;"
+ "&lt;Name&gt;Test&lt;/Name&gt;&#xD;"
+ "&lt;No&gt;Test&lt;/No&gt;&#xD;"
+ "&lt;/Table&gt;&#xD;"
+ "&lt;/DataSet&gt;</Xml>"
+ "</RequestData>";
System.Net.WebRequest request = System.Net.WebRequest.Create("{{API Url}}/RunMapXml?token={{Token}}&mapKey={{mapKey}}");
request.Method = "POST";
request.ContentType = "application/xml";
request.ContentLength = data.Length;

using(Stream reqStream = request.GetRequestStream())
{
 reqStream.Write(Encoding.ASCII.GetBytes(xml),0,xml.Length);
}

System.Net.WebResponse response = request.GetResponse();
string result = string.Empty;
using(System.IO.StreamReader responseStream = new System.IO.StreamReader(response.GetResponseStream()))
{
 string result = responseStream.ReadToEnd(); 
}

return result;

The above command returns JSON structured like this:

{
    "ErrorCount": 1,
    "Errors": "",
    "MapDescription": "Import of Purchase Journal",
    "MapKey": "364fde19-0748-4d10-886f-a95300a506c5",
    "MapId": "EXCEL TO BUSINESS CENTRAL PURCHASE JOURNAL",
    "RecordCount": 1,
    "RunNumber": 80,
    "Status": 1,
    "ErrorMessage": "Document was not sent due to document errors."

The errors field will contain an XML Data Table:

<NewDataSet>\r\n  
    <xs:schema id=\"NewDataSet\"
        xmlns=\"\"
        xmlns:xs=\"http://www.w3.org/2001/XMLSchema\"
        xmlns:msdata=\"urn:schemas-microsoft-com:xml-msdata\">\r\n    
        <xs:element name=\"NewDataSet\" msdata:IsDataSet=\"true\" msdata:MainDataTable=\"ErrorTable\" msdata:UseCurrentLocale=\"true\">\r\n      
            <xs:complexType>\r\n        
                <xs:choice minOccurs=\"0\" maxOccurs=\"unbounded\">\r\n          
                    <xs:element name=\"ErrorTable\">\r\n            
                        <xs:complexType>\r\n              
                            <xs:sequence>\r\n                
                                <xs:element name=\"accountnumber\" type=\"xs:string\" minOccurs=\"0\" />\r\n                
                                <xs:element name=\"CustomerID\" type=\"xs:string\" minOccurs=\"0\" />\r\n                
                                <xs:element name=\"name\" type=\"xs:string\" minOccurs=\"0\" />\r\n                
                                <xs:element name=\"EONERUNERRORS\" type=\"xs:string\" minOccurs=\"0\" />\r\n              
                            </xs:sequence>\r\n            
                        </xs:complexType>\r\n          
                    </xs:element>\r\n        
                </xs:choice>\r\n      
            </xs:complexType>\r\n    
        </xs:element>\r\n  
    </xs:schema>\r\n  
    <ErrorTable>\r\n    
        <accountnumber>C0008</accountnumber>\r\n    
        <CustomerID>IDs</CustomerID>\r\n    
        <name>Test Account 008</name>\r\n    
        <EONERUNERRORS>Document was not sent due to document errors.</EONERUNERRORS>\r\n  
    </ErrorTable>\r\n
    <ErrorTable>\r\n    
        <accountnumber>C0007</accountnumber>\r\n    
        <CustomerID>IDs</CustomerID>\r\n    
        <name>Test Account 007</name>\r\n    
        <EONERUNERRORS>Document was not sent due to document errors.</EONERUNERRORS>\r\n  
    </ErrorTable>\r\n
</NewDataSet>

Query Parameters

Parameter Required Description
token true Token generated by the GetToken endpoint
mapKey true Unique identifier for the process to retrieve

Error Processing

The Error Processing endpoints can be used to retrieve errors and process outputs.

GetHistoryForProcess

This endpoint retrieves the last 10 runs of the specified process.

HTTP Request

GET
https://{{API_Url}}/GetHistoryForProcess

To retrieve a list of process runs, use this code:

curl GET "{{API Url}}/GetHistoryForProcess?token={{Token}}&processId={{processId}}" \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' 
import requests

url = "{{API Url}}/GetHistoryForProcess?token={{Token}}&processId={{processId}}"
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request("GET", url, headers=headers)

print(response.text.encode('utf8'))
var xhr = new XMLHttpRequest();
xhr.open("GET", "{{API Url}}/GetHistoryForProcess?token={{Token}}&processId={{processId}}");
xhr.setRequestHeader("Content-Type", "application/json");

xhr.send();
System.Net.WebRequest request = System.Net.WebRequest.Create("{{API Url}}/GetHistoryForProcess?token={{Token}}&processId={{processId}}");
request.Method = "GET";
request.ContentType = "application/json";

System.Net.WebResponse response = request.GetResponse();
string result = string.Empty;
using(System.IO.StreamReader responseStream = new System.IO.StreamReader(response.GetResponseStream()))
{
 string result = responseStream.ReadToEnd(); 
}

return result;

The above command returns JSON structured like this:

[
    {
        "Id": "0f8b020d-000c-4e5e-a326-ac3000f57a11",
        "MapId": "BULK SHOPIFY COLLECTIONS TO BC",
        "RunNumber": 2,
        "RunDate": "2020-09-08T14:53:44",
        "RecordCount": 1,
        "ErrorCount": 0,
        "ErrorsSaved": false
    },
    {
        "Id": "7e6ca65a-db72-44e4-883d-ac3000f51ca5",
        "MapId": "BULK SHOPIFY COLLECTIONS TO BC",
        "RunNumber": 1,
        "RunDate": "2020-09-08T14:52:25",
        "RecordCount": 1,
        "ErrorCount": 1,
        "ErrorsSaved": true
    }
]

Query Parameters

Parameter Required Description
token true Token generated by the GetToken endpoint
processId true Unique id for Process

GetErrorsForProcessRun

This endpoint retrieves the error messages from a specified process run.

HTTP Request

GET
https://{{API_Url}}/GetErrorsForProcessRun

To retrieve a list of process errors for a prpcess run, use this code:

curl GET "{{API Url}}/GetErrorsForProcessRun?token={{Token}}&processId={{processId}}&runNumber={{runNumber}}" \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' 
import requests

url = "{{API Url}}/GetErrorsForProcessRun?token={{Token}}&processId={{processId}}&runNumber={{runNumber}}"
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request("GET", url, headers=headers)

print(response.text.encode('utf8'))
var xhr = new XMLHttpRequest();
xhr.open("GET", "{{API Url}}/GetErrorsForProcessRun?token={{Token}}&processId={{processId}}&runNumber={{runNumber}}");
xhr.setRequestHeader("Content-Type", "application/json");

xhr.send();
System.Net.WebRequest request = System.Net.WebRequest.Create("{{API Url}}/GetErrorsForProcessRun?token={{Token}}&processId={{processId}}&runNumber={{runNumber}}");
request.Method = "GET";
request.ContentType = "application/json";

System.Net.WebResponse response = request.GetResponse();
string result = string.Empty;
using(System.IO.StreamReader responseStream = new System.IO.StreamReader(response.GetResponseStream()))
{
 string result = responseStream.ReadToEnd(); 
}

return result;

The above command returns JSON structured like this:

{
    "mapKey": "f6e80c0c-d250-47cb-a8db-aac700a55347",
    "mapId": "DEMO CRM TEST",
    "mapDescription": "Demo CRM Test",
    "runNumber": 147,
    "runTenants": [
        {
            "errorId": "6f0795b7-97a8-48cf-9ec0-ab98016fc798",
            "tenantServer": "crm4.dynamics.com",
            "tenantTechnical": "eoned365demo",
            "errorCount": 2,
            "errorData": {
                "currentPage": 1,
                "pageSize": 1000,
                "recordCount": 2,
                "columnList": [],
                "dataRows": [
                    {
                        "Name": "Demo1",
                        "email": "Demo1@eone.com",
                        "Title": "Developer",
                        "Phone": "701-456-7283",
                        "EONERUNIDENT": "8b796357-a224-4627-b782-7846b0178f60",
                        "EONERUNERRORS": "1 duplicates found. \r\nFor entity 'contact' where 'emailaddress1 = Demo1@eone.com,' in organization 'eoned365demo'\r\n\r\n"
                    },
                    {
                        "Name": "Demo10",
                        "email": "Demo10@eone.com",
                        "Title": "Developer",
                        "Phone": "701-456-7292",
                        "EONERUNIDENT": "d1d62875-bec9-46c6-805e-8dbbbf1e5729",
                        "EONERUNERRORS": "1 duplicates found. \r\nFor entity 'contact' where 'emailaddress1 = Demo10@eone.com,' in organization 'eoned365demo'\r\n\r\n"
                    }
                ]
            }
        }
    ]
}

Query Parameters

Parameter Required Description
token true Token generated by the GetToken endpoint
processId true Unique id for Process
runNumber true Run number to retrieve

GetOutputsForProcess

This endpoint generates a link to download a process output.

HTTP Request

GET
https://{{API_Url}}/GetOutputsForProcess

To retrieve a list of process outputs, use this code:

curl GET "{{API Url}}/GetOutputsForProcess?token={{Token}}&processId={{processId}}" \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' 
import requests

url = "{{API Url}}/GetOutputsForProcess?token={{Token}}&processId={{processId}}"
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json'
}

response = requests.request("GET", url, headers=headers)

print(response.text.encode('utf8'))
var xhr = new XMLHttpRequest();
xhr.open("GET", "{{API Url}}/GetOutputsForProcess?token={{Token}}&processId={{processId}}");
xhr.setRequestHeader("Content-Type", "application/json");

xhr.send();
System.Net.WebRequest request = System.Net.WebRequest.Create("{{API Url}}/GetOutputsForProcess?token={{Token}}&processId={{processId}}");
request.Method = "GET";
request.ContentType = "application/json";

System.Net.WebResponse response = request.GetResponse();
string result = string.Empty;
using(System.IO.StreamReader responseStream = new System.IO.StreamReader(response.GetResponseStream()))
{
 string result = responseStream.ReadToEnd(); 
}

return result;

The above command returns JSON structured like this:

[
    {
        "outputId": "7aef7d77-4427-4b13-86a2-ac1e00c44688",
        "processId": "728b5348-66f4-40fb-b56f-ac1e00c22ed9",
        "runNumber": 3,
        "created": "2020-08-21T11:54:37",
        "description": "BULK BC REFUNDS TO MAGENTO output, run number 3",
        "fileName": "BULK BC REFUNDS TO MAGENTO___3.zip",
        "outputUri": "http://smartconnectschedule.azurewebsites.net/api/getfile?token={{Token}}&key={{key}}"
    }
]

Query Parameters

Parameter Required Description
token true Token generated by the GetToken endpoint
processId true Unique id for Process
runNumber false Run number to retrieve