Loading...
NAV Navbar
Shell HTTP JavaScript Node.JS Python Ruby Java

AppInsights API Reference

Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.

Use the following URL format to send API calls:

https://{marketplaceURL}/api/integration/v1/visualization/{endpoint}

For example:

https://myMarketplace.com/api/integration/v1/visualization/app/{appId}/templates/collections

Generated on 2018-12-12 12:52:12 EST

Collections

List collection templates.

Example request


curl -X get https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/templates/collections \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json'

GET https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/templates/collections HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json



var headers = {
  'Accept':'application/json',
  'Content-Type':'application/json'

};

$.ajax({
  url: 'https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/templates/collections',
  method: 'get',
  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})
const request = require('node-fetch');
const headers = {
  'Accept':'application/json',
  'Content-Type':'application/json'

};

fetch('https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/templates/collections',
{
  method: 'GET',headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'Content-Type' => 'application/json'
}

result = RestClient.get 'https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/templates/collections',

params: {
},
headers: headers

p JSON.parse(result)
import requests
headers = {
  'Accept': 'application/json',
  'Content-Type': 'application/json'
}

r = requests.get('https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/templates/collections',

params={
},
headers = headers)

print r.json()
URL obj = new URL("https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/templates/collections");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");

int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

Example response

{
  "page": {
    "number": 1,
    "size": 5,
    "totalElements": 15,
    "totalPages": 3
  }
}

Example response

{
  "errorCode": "apiError",
  "errorDetail": "The orderId parameter must be a number.",
  "tag": "1495051362575:sgw-2240268717-53tbz:21:j2s24o4n:18441"
}

GET /app/{appId}/templates/collections

Gets a list of collection templates.

Parameters

Parameter Type Data Type Default Description
*appId path string A parameter indicating what integration ID to operate with.
size query integer 10 Used for pagination. Determines the number of items per page.
page query integer 0 Used for pagination. Determines the page to start results from. 0 based index.

Responses

Status Meaning Description Definition
200 OK Indicates a successful listing call. CollectionTemplateResults
500 Internal Server Error Indicates a internal error occurred. ServiceErrorWithTag

Get collection template.

Example request


curl -X get https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/templates/collections/{uuid} \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json'

GET https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/templates/collections/{uuid} HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json



var headers = {
  'Accept':'application/json',
  'Content-Type':'application/json'

};

$.ajax({
  url: 'https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/templates/collections/{uuid}',
  method: 'get',
  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})
const request = require('node-fetch');
const headers = {
  'Accept':'application/json',
  'Content-Type':'application/json'

};

fetch('https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/templates/collections/{uuid}',
{
  method: 'GET',headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'Content-Type' => 'application/json'
}

result = RestClient.get 'https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/templates/collections/{uuid}',

params: {
},
headers: headers

p JSON.parse(result)
import requests
headers = {
  'Accept': 'application/json',
  'Content-Type': 'application/json'
}

r = requests.get('https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/templates/collections/{uuid}',

params={
},
headers = headers)

print r.json()
URL obj = new URL("https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/templates/collections/{uuid}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");

int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

Example response

{
  "dashboardTemplates": [
    "7f140fe8-8277-41f6-b0fc-ffcd93a37df7"
  ],
  "title": "Example Folder",
  "uuid": "8bf43993-473e-4483-b8ca-518969c0b59e"
}

Example response

{
  "errorCode": "notFound",
  "errorDetail": "The requested resource was not found.",
  "tag": "1494969891655:sgw-2240268717-53tbz:21:j2s24o4n:10104"
}

Example response

{
  "errorCode": "apiError",
  "errorDetail": "The orderId parameter must be a number.",
  "tag": "1495051362575:sgw-2240268717-53tbz:21:j2s24o4n:18441"
}

GET /app/{appId}/templates/collections/{uuid}

Get a collection template by id.

Parameters

Parameter Type Data Type Default Description
*appId path string A parameter indicating what integration ID to operate with.

Responses

Status Meaning Description Definition
200 OK Indicates a successful fetch. CollectionTemplate
404 Not Found Indicates the requested collection template was not found. ServiceErrorWithTag
500 Internal Server Error Indicates a internal error occurred. ServiceErrorWithTag

Create a new collection template.

Example request


curl -X post \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  --data-binary @- https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/templates/collections <<EOF
{
  "dashboardTemplates": [
    "7f140fe8-8277-41f6-b0fc-ffcd93a37df7"
  ],
  "title": "Example Folder"
}
EOF

POST https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/templates/collections HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json

{
  "dashboardTemplates": [
    "7f140fe8-8277-41f6-b0fc-ffcd93a37df7"
  ],
  "title": "Example Folder"
}


var headers = {
  'Accept':'application/json',
  'Content-Type':'application/json'

};

$.ajax({
  url: 'https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/templates/collections',
  method: 'post',
  dataType: 'json',
  data: {
  "dashboardTemplates": [
    "7f140fe8-8277-41f6-b0fc-ffcd93a37df7"
  ],
  "title": "Example Folder"
},

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})
const request = require('node-fetch');
const inputBody = '{
  "dashboardTemplates": [
    "7f140fe8-8277-41f6-b0fc-ffcd93a37df7"
  ],
  "title": "Example Folder"
}';
const headers = {
  'Accept':'application/json',
  'Content-Type':'application/json'

};

fetch('https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/templates/collections',
{
  method: 'POST',body: inputBody,headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'Content-Type' => 'application/json'
}

result = RestClient.post 'https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/templates/collections',
payload={
  "dashboardTemplates": [
    "7f140fe8-8277-41f6-b0fc-ffcd93a37df7"
  ],
  "title": "Example Folder"
}
params: {
},
headers: headers

p JSON.parse(result)
import requests
headers = {
  'Accept': 'application/json',
  'Content-Type': 'application/json'
}

r = requests.post('https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/templates/collections',
json={
  "dashboardTemplates": [
    "7f140fe8-8277-41f6-b0fc-ffcd93a37df7"
  ],
  "title": "Example Folder"
}
params={
},
headers = headers)

print r.json()
URL obj = new URL("https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/templates/collections");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
String inputBody = "{" +
  "\"dashboardTemplates\": [" +
    "\"7f140fe8-8277-41f6-b0fc-ffcd93a37df7\"" +
  "]," +
  "\"title\": \"Example Folder\"" +
"}";

OutputStream os = conn.getOutputStream();
os.write(inputBody.getBytes("UTF-8"));
os.close();

int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

Example response

{
  "dashboardTemplates": [
    "7f140fe8-8277-41f6-b0fc-ffcd93a37df7"
  ],
  "title": "Example Folder",
  "uuid": "8bf43993-473e-4483-b8ca-518969c0b59e"
}

Example response

{
  "errorCode": "apiError",
  "errorDetail": "The orderId parameter must be a number.",
  "tag": "1495051362575:sgw-2240268717-53tbz:21:j2s24o4n:18441"
}

Example response

{
  "errorCode": "apiError",
  "errorDetail": "The orderId parameter must be a number.",
  "tag": "1495051362575:sgw-2240268717-53tbz:21:j2s24o4n:18441"
}

POST /app/{appId}/templates/collections

Create a new collection template.

Parameters

Parameter Type Data Type Default Description
*appId path string A parameter indicating what integration ID to operate with.

Body Parameters

CollectionTemplate object:

Property Type Description
dashboardTemplates array of string A list of UUID strings.
title string Represents the title that will be used for an instnace of this collection template. This is exposed in the AppInsights user interface.
uuid string The UUID version 4 used to identify a object.

Responses

Status Meaning Description Definition
201 Created Indicates the collection template was created. CollectionTemplate
400 Bad Request When the provided details do not meet the collection template specifications, a 400 response is sent. ServiceErrorWithTag
500 Internal Server Error Indicates a internal error occurred. ServiceErrorWithTag

Delete collection template.

Example request


curl -X delete https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/templates/collections/{uuid} \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json'

DELETE https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/templates/collections/{uuid} HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json



var headers = {
  'Accept':'application/json',
  'Content-Type':'application/json'

};

$.ajax({
  url: 'https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/templates/collections/{uuid}',
  method: 'delete',
  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})
const request = require('node-fetch');
const headers = {
  'Accept':'application/json',
  'Content-Type':'application/json'

};

fetch('https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/templates/collections/{uuid}',
{
  method: 'DELETE',headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'Content-Type' => 'application/json'
}

result = RestClient.delete 'https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/templates/collections/{uuid}',

params: {
},
headers: headers

p JSON.parse(result)
import requests
headers = {
  'Accept': 'application/json',
  'Content-Type': 'application/json'
}

r = requests.delete('https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/templates/collections/{uuid}',

params={
},
headers = headers)

print r.json()
URL obj = new URL("https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/templates/collections/{uuid}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("DELETE");

int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

Example response

{
  "errorCode": "apiError",
  "errorDetail": "The orderId parameter must be a number.",
  "tag": "1495051362575:sgw-2240268717-53tbz:21:j2s24o4n:18441"
}

DELETE /app/{appId}/templates/collections/{uuid}

Delete a collection template by id.

Parameters

Parameter Type Data Type Default Description
*appId path string A parameter indicating what integration ID to operate with.

Responses

Status Meaning Description Definition
204 No Content Indicates a successful delete. Note: this API does not return a 404. A non existent object is considered a successful delete.
500 Internal Server Error Indicates a internal error occurred. ServiceErrorWithTag

Dashboards

List of dashboard templates.

Example request


curl -X get https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/templates/dashboards \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json'

GET https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/templates/dashboards HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json



var headers = {
  'Accept':'application/json',
  'Content-Type':'application/json'

};

$.ajax({
  url: 'https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/templates/dashboards',
  method: 'get',
  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})
const request = require('node-fetch');
const headers = {
  'Accept':'application/json',
  'Content-Type':'application/json'

};

fetch('https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/templates/dashboards',
{
  method: 'GET',headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'Content-Type' => 'application/json'
}

result = RestClient.get 'https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/templates/dashboards',

params: {
},
headers: headers

p JSON.parse(result)
import requests
headers = {
  'Accept': 'application/json',
  'Content-Type': 'application/json'
}

r = requests.get('https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/templates/dashboards',

params={
},
headers = headers)

print r.json()
URL obj = new URL("https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/templates/dashboards");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");

int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

Example response

{
  "description": "Visits",
  "fields": {
    "description": "Visits",
    "imageURL": "template02.png",
    "name": "Site Visitors"
  },
  "imageURL": "template02.png",
  "model": "base.template",
  "name": "Site Visitors",
  "serviceTypeId": 1,
  "title": "Example Dashboard",
  "uuid": "7f140fe8-8277-41f6-b0fc-ffcd93a37df7",
  "widgetTemplates": []
}

Example response

{
  "errorCode": "apiError",
  "errorDetail": "The orderId parameter must be a number.",
  "tag": "1495051362575:sgw-2240268717-53tbz:21:j2s24o4n:18441"
}

GET /app/{appId}/templates/dashboards

Get a list of dashboard templates.

Parameters

Parameter Type Data Type Default Description
*appId path string A parameter indicating what integration ID to operate with.
size query integer 10 Used for pagination. Determines the number of items per page.
page query integer 0 Used for pagination. Determines the page to start results from. 0 based index.

Responses

Status Meaning Description Definition
200 OK Indicates a successful listing call. DashboardTemplate
500 Internal Server Error Indicates a internal error occurred. ServiceErrorWithTag

Get dashboard template.

Example request


curl -X get https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/templates/dashboards/{uuid} \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json'

GET https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/templates/dashboards/{uuid} HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json



var headers = {
  'Accept':'application/json',
  'Content-Type':'application/json'

};

$.ajax({
  url: 'https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/templates/dashboards/{uuid}',
  method: 'get',
  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})
const request = require('node-fetch');
const headers = {
  'Accept':'application/json',
  'Content-Type':'application/json'

};

fetch('https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/templates/dashboards/{uuid}',
{
  method: 'GET',headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'Content-Type' => 'application/json'
}

result = RestClient.get 'https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/templates/dashboards/{uuid}',

params: {
},
headers: headers

p JSON.parse(result)
import requests
headers = {
  'Accept': 'application/json',
  'Content-Type': 'application/json'
}

r = requests.get('https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/templates/dashboards/{uuid}',

params={
},
headers = headers)

print r.json()
URL obj = new URL("https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/templates/dashboards/{uuid}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");

int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

Example response

{
  "description": "Visits",
  "fields": {
    "description": "Visits",
    "imageURL": "template02.png",
    "name": "Site Visitors"
  },
  "imageURL": "template02.png",
  "model": "base.template",
  "name": "Site Visitors",
  "serviceTypeId": 1,
  "title": "Example Dashboard",
  "uuid": "7f140fe8-8277-41f6-b0fc-ffcd93a37df7",
  "widgetTemplates": []
}

Example response

{
  "errorCode": "notFound",
  "errorDetail": "The requested resource was not found.",
  "tag": "1494969891655:sgw-2240268717-53tbz:21:j2s24o4n:10104"
}

Example response

{
  "errorCode": "apiError",
  "errorDetail": "The orderId parameter must be a number.",
  "tag": "1495051362575:sgw-2240268717-53tbz:21:j2s24o4n:18441"
}

GET /app/{appId}/templates/dashboards/{uuid}

Get a dashboard template by id.

Parameters

Parameter Type Data Type Default Description
*uuid path string The ID of the dashboard template to operate on.
*appId path string A parameter indicating what integration ID to operate with.

Responses

Status Meaning Description Definition
200 OK Indicates a successful fetch. DashboardTemplate
404 Not Found Indicates the requested dashboard template was not found. ServiceErrorWithTag
500 Internal Server Error Indicates a internal error occurred. ServiceErrorWithTag

Create dashboard template.

Example request


curl -X post \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  --data-binary @- https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/templates/dashboards <<EOF
{
  "description": "Visits",
  "fields": {
    "description": "Visits",
    "imageURL": "template02.png",
    "name": "Site Visitors"
  },
  "imageURL": "template02.png",
  "model": "base.template",
  "name": "Site Visitors",
  "serviceTypeId": 1,
  "streamParams": [],
  "title": "Example Dashboard",
  "uuid": "7f140fe8-8277-41f6-b0fc-ffcd93a37df7",
  "widgetTemplates": [
    "6753bf9d-22e9-43cf-a6f9-3f4254b862e5"
  ]
}
EOF

POST https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/templates/dashboards HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json

{
  "description": "Visits",
  "fields": {
    "description": "Visits",
    "imageURL": "template02.png",
    "name": "Site Visitors"
  },
  "imageURL": "template02.png",
  "model": "base.template",
  "name": "Site Visitors",
  "serviceTypeId": 1,
  "streamParams": [],
  "title": "Example Dashboard",
  "uuid": "7f140fe8-8277-41f6-b0fc-ffcd93a37df7",
  "widgetTemplates": [
    "6753bf9d-22e9-43cf-a6f9-3f4254b862e5"
  ]
}


var headers = {
  'Accept':'application/json',
  'Content-Type':'application/json'

};

$.ajax({
  url: 'https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/templates/dashboards',
  method: 'post',
  dataType: 'json',
  data: {
  "description": "Visits",
  "fields": {
    "description": "Visits",
    "imageURL": "template02.png",
    "name": "Site Visitors"
  },
  "imageURL": "template02.png",
  "model": "base.template",
  "name": "Site Visitors",
  "serviceTypeId": 1,
  "streamParams": [],
  "title": "Example Dashboard",
  "uuid": "7f140fe8-8277-41f6-b0fc-ffcd93a37df7",
  "widgetTemplates": [
    "6753bf9d-22e9-43cf-a6f9-3f4254b862e5"
  ]
},

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})
const request = require('node-fetch');
const inputBody = '{
  "description": "Visits",
  "fields": {
    "description": "Visits",
    "imageURL": "template02.png",
    "name": "Site Visitors"
  },
  "imageURL": "template02.png",
  "model": "base.template",
  "name": "Site Visitors",
  "serviceTypeId": 1,
  "streamParams": [],
  "title": "Example Dashboard",
  "uuid": "7f140fe8-8277-41f6-b0fc-ffcd93a37df7",
  "widgetTemplates": [
    "6753bf9d-22e9-43cf-a6f9-3f4254b862e5"
  ]
}';
const headers = {
  'Accept':'application/json',
  'Content-Type':'application/json'

};

fetch('https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/templates/dashboards',
{
  method: 'POST',body: inputBody,headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'Content-Type' => 'application/json'
}

result = RestClient.post 'https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/templates/dashboards',
payload={
  "description": "Visits",
  "fields": {
    "description": "Visits",
    "imageURL": "template02.png",
    "name": "Site Visitors"
  },
  "imageURL": "template02.png",
  "model": "base.template",
  "name": "Site Visitors",
  "serviceTypeId": 1,
  "streamParams": [],
  "title": "Example Dashboard",
  "uuid": "7f140fe8-8277-41f6-b0fc-ffcd93a37df7",
  "widgetTemplates": [
    "6753bf9d-22e9-43cf-a6f9-3f4254b862e5"
  ]
}
params: {
},
headers: headers

p JSON.parse(result)
import requests
headers = {
  'Accept': 'application/json',
  'Content-Type': 'application/json'
}

r = requests.post('https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/templates/dashboards',
json={
  "description": "Visits",
  "fields": {
    "description": "Visits",
    "imageURL": "template02.png",
    "name": "Site Visitors"
  },
  "imageURL": "template02.png",
  "model": "base.template",
  "name": "Site Visitors",
  "serviceTypeId": 1,
  "streamParams": [],
  "title": "Example Dashboard",
  "uuid": "7f140fe8-8277-41f6-b0fc-ffcd93a37df7",
  "widgetTemplates": [
    "6753bf9d-22e9-43cf-a6f9-3f4254b862e5"
  ]
}
params={
},
headers = headers)

print r.json()
URL obj = new URL("https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/templates/dashboards");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
String inputBody = "{" +
  "\"description\": \"Visits\"," +
  "\"fields\": {" +
    "\"description\": \"Visits\"," +
    "\"imageURL\": \"template02.png\"," +
    "\"name\": \"Site Visitors\"" +
  "}," +
  "\"imageURL\": \"template02.png\"," +
  "\"model\": \"base.template\"," +
  "\"name\": \"Site Visitors\"," +
  "\"serviceTypeId\": 1," +
  "\"streamParams\": []," +
  "\"title\": \"Example Dashboard\"," +
  "\"uuid\": \"7f140fe8-8277-41f6-b0fc-ffcd93a37df7\"," +
  "\"widgetTemplates\": [" +
    "\"6753bf9d-22e9-43cf-a6f9-3f4254b862e5\"" +
  "]" +
"}";

OutputStream os = conn.getOutputStream();
os.write(inputBody.getBytes("UTF-8"));
os.close();

int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

Example response

{
  "description": "Visits",
  "fields": {
    "description": "Visits",
    "imageURL": "template02.png",
    "name": "Site Visitors"
  },
  "imageURL": "template02.png",
  "model": "base.template",
  "name": "Site Visitors",
  "serviceTypeId": 1,
  "title": "Example Dashboard",
  "uuid": "7f140fe8-8277-41f6-b0fc-ffcd93a37df7",
  "widgetTemplates": []
}

Example response

{
  "errorCode": "apiError",
  "errorDetail": "The orderId parameter must be a number.",
  "tag": "1495051362575:sgw-2240268717-53tbz:21:j2s24o4n:18441"
}

Example response

{
  "errorCode": "apiError",
  "errorDetail": "The orderId parameter must be a number.",
  "tag": "1495051362575:sgw-2240268717-53tbz:21:j2s24o4n:18441"
}

POST /app/{appId}/templates/dashboards

Create a new dashboard template.

Parameters

Parameter Type Data Type Default Description
*appId path string A parameter indicating what integration ID to operate with.

Body Parameters

DashboardTemplate object:

Property Type Description
description string Not in v1. This may be used in the future.
imageURL string Used as a image url for a preview image that shows what this template will look like.
model string Used as a internal identifier. The only valid value is currently base.template.
name string Used as an internal machine readable name for this template.
serviceTypeId integer For internal use. The only valid value as of v1 is 1.
title string Represents the title that will be used for instances of this dashboard template. This is exposed in the AppInsights user interface.
uuid string The UUID version 4 used to identify a object.
widgetTemplates array of string A list of UUID strings.

Responses

Status Meaning Description Definition
201 Created Indicates the dashboard template was created. DashboardTemplate
400 Bad Request When the provided details do not meet the dashboard template specifications, a 400 response is sent. ServiceErrorWithTag
500 Internal Server Error Indicates a internal error occurred. ServiceErrorWithTag

Delete dashboard template.

Example request


curl -X delete https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/templates/dashboards/{uuid} \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json'

DELETE https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/templates/dashboards/{uuid} HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json



var headers = {
  'Accept':'application/json',
  'Content-Type':'application/json'

};

$.ajax({
  url: 'https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/templates/dashboards/{uuid}',
  method: 'delete',
  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})
const request = require('node-fetch');
const headers = {
  'Accept':'application/json',
  'Content-Type':'application/json'

};

fetch('https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/templates/dashboards/{uuid}',
{
  method: 'DELETE',headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'Content-Type' => 'application/json'
}

result = RestClient.delete 'https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/templates/dashboards/{uuid}',

params: {
},
headers: headers

p JSON.parse(result)
import requests
headers = {
  'Accept': 'application/json',
  'Content-Type': 'application/json'
}

r = requests.delete('https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/templates/dashboards/{uuid}',

params={
},
headers = headers)

print r.json()
URL obj = new URL("https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/templates/dashboards/{uuid}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("DELETE");

int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

Example response

{
  "errorCode": "apiError",
  "errorDetail": "The orderId parameter must be a number.",
  "tag": "1495051362575:sgw-2240268717-53tbz:21:j2s24o4n:18441"
}

DELETE /app/{appId}/templates/dashboards/{uuid}

Delete a dashboard template by id.

Parameters

Parameter Type Data Type Default Description
*uuid path string The ID of the dashboard template to operate on.
*appId path string A parameter indicating what integration ID to operate with.

Responses

Status Meaning Description Definition
204 No Content Indicates a successful delete. Note: this API does not return a 404. A non existent object is considered a successful delete.
500 Internal Server Error Indicates a internal error occurred. ServiceErrorWithTag

Datasets

List all datasets for a given source.

Example request


curl -X get https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/datasets \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json'

GET https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/datasets HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json



var headers = {
  'Accept':'application/json',
  'Content-Type':'application/json'

};

$.ajax({
  url: 'https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/datasets',
  method: 'get',
  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})
const request = require('node-fetch');
const headers = {
  'Accept':'application/json',
  'Content-Type':'application/json'

};

fetch('https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/datasets',
{
  method: 'GET',headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'Content-Type' => 'application/json'
}

result = RestClient.get 'https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/datasets',

params: {
},
headers: headers

p JSON.parse(result)
import requests
headers = {
  'Accept': 'application/json',
  'Content-Type': 'application/json'
}

r = requests.get('https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/datasets',

params={
},
headers = headers)

print r.json()
URL obj = new URL("https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/datasets");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");

int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

Example response

{
  "datasets": [
    {
      "columns": [
        "col1"
      ],
      "dataset_id": "1239f5f4-c2f2-4bdb-9546-f3bfc44a67a9",
      "name": "noRows",
      "row_count": 0,
      "source_id": "8B0AB2D7-B04B-449B-BE64-BD2F178A7552",
      "target_id": "aa89a3e6-153c-45a1-bd38-4bea06ff58d4"
    },
    {
      "columns": [
        "name",
        "age",
        "is_pet_owner",
        "pet_name"
      ],
      "dataset_id": "1239f5f4-c2f2-4bdb-9546-f3bfc44a67a8",
      "name": "hasRows",
      "row_count": 2,
      "source_id": "8B0AB2D7-B04B-449B-BE64-BD2F178A7552",
      "target_id": "aa89a3e6-153c-45a1-bd38-4bea06ff58d4"
    }
  ]
}

Example response

{
  "error": "sourceId must be a valid uuid sourceId={sourceId}",
  "errorCode": "InvalidArgument"
}

Example response

{
  "error": "sourceId must be a valid uuid sourceId={sourceId}",
  "errorCode": "InvalidArgument"
}

GET /app/{appId}/datasets

List all datasets for a given source.

Parameters

Parameter Type Data Type Default Description
*appId path string A parameter indicating what integration ID to operate with.

Responses

Status Meaning Description Definition
200 OK Indicates a successful list call. DatasetSvcListDatasetsReply
400 Bad Request When the provided details do not meet the datasetSvcDataset specifications, a 400 response is sent. ServiceError
500 Internal Server Error Indicates an internal error occurred. ServiceError

List a dataset's rows.

Example request


curl -X get https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/datasets/{userId}/{name}/rows \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json'

GET https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/datasets/{userId}/{name}/rows HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json



var headers = {
  'Accept':'application/json',
  'Content-Type':'application/json'

};

$.ajax({
  url: 'https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/datasets/{userId}/{name}/rows',
  method: 'get',
  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})
const request = require('node-fetch');
const headers = {
  'Accept':'application/json',
  'Content-Type':'application/json'

};

fetch('https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/datasets/{userId}/{name}/rows',
{
  method: 'GET',headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'Content-Type' => 'application/json'
}

result = RestClient.get 'https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/datasets/{userId}/{name}/rows',

params: {
},
headers: headers

p JSON.parse(result)
import requests
headers = {
  'Accept': 'application/json',
  'Content-Type': 'application/json'
}

r = requests.get('https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/datasets/{userId}/{name}/rows',

params={
},
headers = headers)

print r.json()
URL obj = new URL("https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/datasets/{userId}/{name}/rows");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");

int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

Example response

{
  "rows": [
    [
      "fizzy-drink",
      1.99,
      false,
      null
    ],
    [
      "flat-drink",
      0.99,
      true,
      "glass"
    ]
  ]
}

Example response

{
  "error": "sourceId must be a valid uuid sourceId={sourceId}",
  "errorCode": "InvalidArgument"
}

Example response

{
  "error": "Internal server error",
  "errorCode": "Unknown"
}

GET /app/{appId}/datasets/{userId}/{name}/rows

Lists all rows for a specific dataset.

Parameters

Parameter Type Data Type Default Description
*name path string The dataset name.
*appId path string A parameter indicating what integration ID to operate with.
*userId path string A parameter indicating what user ID to operate with.

Responses

Status Meaning Description Definition
200 OK Indicates success, the rows are returned. DatasetSvcListRowsReply
400 Bad Request When the provided details do not meet the datasetSvcDataset specifications, a 400 response is sent. ServiceError
500 Internal Server Error Indicates an internal error occurred. ServiceError

Creates a new dataset with it's rows.

Example request


curl -X post \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  --data-binary @- https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/datasets/{userId} <<EOF
{
  "columns": [
    "stringColumn",
    "numberColumn",
    "floatColumn",
    "boolColumn"
  ],
  "name": "TestDataset",
  "rows": [
    [
      "a",
      123,
      99.99,
      false
    ],
    [
      "b",
      234,
      null,
      true
    ],
    [
      "a",
      345,
      null,
      true
    ]
  ]
}
EOF

POST https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/datasets/{userId} HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json

{
  "columns": [
    "stringColumn",
    "numberColumn",
    "floatColumn",
    "boolColumn"
  ],
  "name": "TestDataset",
  "rows": [
    [
      "a",
      123,
      99.99,
      false
    ],
    [
      "b",
      234,
      null,
      true
    ],
    [
      "a",
      345,
      null,
      true
    ]
  ]
}


var headers = {
  'Accept':'application/json',
  'Content-Type':'application/json'

};

$.ajax({
  url: 'https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/datasets/{userId}',
  method: 'post',
  dataType: 'json',
  data: {
  "columns": [
    "stringColumn",
    "numberColumn",
    "floatColumn",
    "boolColumn"
  ],
  "name": "TestDataset",
  "rows": [
    [
      "a",
      123,
      99.99,
      false
    ],
    [
      "b",
      234,
      null,
      true
    ],
    [
      "a",
      345,
      null,
      true
    ]
  ]
},

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})
const request = require('node-fetch');
const inputBody = '{
  "columns": [
    "stringColumn",
    "numberColumn",
    "floatColumn",
    "boolColumn"
  ],
  "name": "TestDataset",
  "rows": [
    [
      "a",
      123,
      99.99,
      false
    ],
    [
      "b",
      234,
      null,
      true
    ],
    [
      "a",
      345,
      null,
      true
    ]
  ]
}';
const headers = {
  'Accept':'application/json',
  'Content-Type':'application/json'

};

fetch('https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/datasets/{userId}',
{
  method: 'POST',body: inputBody,headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'Content-Type' => 'application/json'
}

result = RestClient.post 'https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/datasets/{userId}',
payload={
  "columns": [
    "stringColumn",
    "numberColumn",
    "floatColumn",
    "boolColumn"
  ],
  "name": "TestDataset",
  "rows": [
    [
      "a",
      123,
      99.99,
      false
    ],
    [
      "b",
      234,
      null,
      true
    ],
    [
      "a",
      345,
      null,
      true
    ]
  ]
}
params: {
},
headers: headers

p JSON.parse(result)
import requests
headers = {
  'Accept': 'application/json',
  'Content-Type': 'application/json'
}

r = requests.post('https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/datasets/{userId}',
json={
  "columns": [
    "stringColumn",
    "numberColumn",
    "floatColumn",
    "boolColumn"
  ],
  "name": "TestDataset",
  "rows": [
    [
      "a",
      123,
      99.99,
      false
    ],
    [
      "b",
      234,
      null,
      true
    ],
    [
      "a",
      345,
      null,
      true
    ]
  ]
}
params={
},
headers = headers)

print r.json()
URL obj = new URL("https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/datasets/{userId}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
String inputBody = "{" +
  "\"columns\": [" +
    "\"stringColumn\"," +
    "\"numberColumn\"," +
    "\"floatColumn\"," +
    "\"boolColumn\"" +
  "]," +
  "\"name\": \"TestDataset\"," +
  "\"rows\": [" +
    "[" +
      "\"a\"," +
      "123," +
      "99.99," +
      "false" +
    "]," +
    "[" +
      "\"b\"," +
      "234," +
      "null," +
      "true" +
    "]," +
    "[" +
      "\"a\"," +
      "345," +
      "null," +
      "true" +
    "]" +
  "]" +
"}";

OutputStream os = conn.getOutputStream();
os.write(inputBody.getBytes("UTF-8"));
os.close();

int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

Example response

{
  "rows_added": 2,
  "rows_updated": 1
}

Example response

{
  "error": "sourceId must be a valid uuid sourceId={sourceId}",
  "errorCode": "InvalidArgument"
}

Example response

{
  "error": "sourceId must be a valid uuid sourceId={sourceId}",
  "errorCode": "InvalidArgument"
}

POST /app/{appId}/datasets/{userId}

Creates a new dataset with it's rows. If a dataset already exists, rows can be appended or replaced to that dataset by utilizing the clear flag. Rows can also be updated by posting a row with the same ID of an existing row. The ID of a row is identified to be the first item on all rows.

Parameters

Parameter Type Data Type Default Description
*appId path string A parameter indicating what integration ID to operate with.
*userId path string A parameter indicating what user ID to operate with.
clear query boolean false Used for clearing all existing rows for a dataset when true or appends to an existing list of rows for a dataset when false.

Body Parameters

DatasetSvcDataset object:

Property Type Description
columns array of string A list of column names. The length of the column list must match the length of each row.
name string The name of the dataset.
rows array of array A list of row data that can be any format except an array or object. Each row must match the length of the columns list. The first item of each row is identified as the unique ID of that row.

Responses

Status Meaning Description Definition
200 OK Indicates the dataset and rows for the dataset were created or updated. DatasetSvcAddRowsReply
400 Bad Request When the provided details do not meet the datasetSvcDataset specifications, a 400 response is sent. ServiceError
500 Internal Server Error Indicates an internal error occurred. ServiceError

Updates rows for an existing dataset.

Example request


curl -X put \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  --data-binary @- https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/datasets/{userId}/{name}/rows <<EOF
{
  "columns": [
    "stringColumn",
    "numberColumn",
    "floatColumn",
    "boolColumn"
  ],
  "name": "TestDataset",
  "rows": [
    [
      "a",
      123,
      99.99,
      false
    ],
    [
      "b",
      234,
      null,
      true
    ],
    [
      "a",
      345,
      null,
      true
    ],
    [
      "c",
      456,
      99.99,
      true
    ]
  ]
}
EOF

PUT https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/datasets/{userId}/{name}/rows HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json

{
  "columns": [
    "stringColumn",
    "numberColumn",
    "floatColumn",
    "boolColumn"
  ],
  "name": "TestDataset",
  "rows": [
    [
      "a",
      123,
      99.99,
      false
    ],
    [
      "b",
      234,
      null,
      true
    ],
    [
      "a",
      345,
      null,
      true
    ],
    [
      "c",
      456,
      99.99,
      true
    ]
  ]
}


var headers = {
  'Accept':'application/json',
  'Content-Type':'application/json'

};

$.ajax({
  url: 'https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/datasets/{userId}/{name}/rows',
  method: 'put',
  dataType: 'json',
  data: {
  "columns": [
    "stringColumn",
    "numberColumn",
    "floatColumn",
    "boolColumn"
  ],
  "name": "TestDataset",
  "rows": [
    [
      "a",
      123,
      99.99,
      false
    ],
    [
      "b",
      234,
      null,
      true
    ],
    [
      "a",
      345,
      null,
      true
    ],
    [
      "c",
      456,
      99.99,
      true
    ]
  ]
},

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})
const request = require('node-fetch');
const inputBody = '{
  "columns": [
    "stringColumn",
    "numberColumn",
    "floatColumn",
    "boolColumn"
  ],
  "name": "TestDataset",
  "rows": [
    [
      "a",
      123,
      99.99,
      false
    ],
    [
      "b",
      234,
      null,
      true
    ],
    [
      "a",
      345,
      null,
      true
    ],
    [
      "c",
      456,
      99.99,
      true
    ]
  ]
}';
const headers = {
  'Accept':'application/json',
  'Content-Type':'application/json'

};

fetch('https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/datasets/{userId}/{name}/rows',
{
  method: 'PUT',body: inputBody,headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'Content-Type' => 'application/json'
}

result = RestClient.put 'https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/datasets/{userId}/{name}/rows',
payload={
  "columns": [
    "stringColumn",
    "numberColumn",
    "floatColumn",
    "boolColumn"
  ],
  "name": "TestDataset",
  "rows": [
    [
      "a",
      123,
      99.99,
      false
    ],
    [
      "b",
      234,
      null,
      true
    ],
    [
      "a",
      345,
      null,
      true
    ],
    [
      "c",
      456,
      99.99,
      true
    ]
  ]
}
params: {
},
headers: headers

p JSON.parse(result)
import requests
headers = {
  'Accept': 'application/json',
  'Content-Type': 'application/json'
}

r = requests.put('https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/datasets/{userId}/{name}/rows',
json={
  "columns": [
    "stringColumn",
    "numberColumn",
    "floatColumn",
    "boolColumn"
  ],
  "name": "TestDataset",
  "rows": [
    [
      "a",
      123,
      99.99,
      false
    ],
    [
      "b",
      234,
      null,
      true
    ],
    [
      "a",
      345,
      null,
      true
    ],
    [
      "c",
      456,
      99.99,
      true
    ]
  ]
}
params={
},
headers = headers)

print r.json()
URL obj = new URL("https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/datasets/{userId}/{name}/rows");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PUT");
String inputBody = "{" +
  "\"columns\": [" +
    "\"stringColumn\"," +
    "\"numberColumn\"," +
    "\"floatColumn\"," +
    "\"boolColumn\"" +
  "]," +
  "\"name\": \"TestDataset\"," +
  "\"rows\": [" +
    "[" +
      "\"a\"," +
      "123," +
      "99.99," +
      "false" +
    "]," +
    "[" +
      "\"b\"," +
      "234," +
      "null," +
      "true" +
    "]," +
    "[" +
      "\"a\"," +
      "345," +
      "null," +
      "true" +
    "]," +
    "[" +
      "\"c\"," +
      "456," +
      "99.99," +
      "true" +
    "]" +
  "]" +
"}";

OutputStream os = conn.getOutputStream();
os.write(inputBody.getBytes("UTF-8"));
os.close();

int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

Example response

{
  "rows_added": 1,
  "rows_updated": 3
}

Example response

{
  "error": "sourceId must be a valid uuid sourceId={sourceId}",
  "errorCode": "InvalidArgument"
}

Example response

{
  "error": "sourceId must be a valid uuid sourceId={sourceId}",
  "errorCode": "InvalidArgument"
}

PUT /app/{appId}/datasets/{userId}/{name}/rows

Updates rows for an existing dataset. Rows are updated when the first item of the row matches another. This is identified to be the unique ID of a row and can be a string or id. If a row does not exist, it will be added.

Parameters

Parameter Type Data Type Default Description
*name path string The name of the dataset.
*appId path string A parameter indicating what integration ID to operate with.
*userId path string A parameter indicating what user ID to operate with.

Body Parameters

DatasetSvcUpdateRows object:

Property Type Description
rows array of array A list of row data that can be any format except an array or object. Each row must match the length of the columns list. The first item of each row is identified as the unique ID of that row.

Responses

Status Meaning Description Definition
200 OK Indicates all rows have been successfully updated. DatasetSvcUpdateRowsReply
400 Bad Request When the provided details do not meet the datasetSvcUpdateRows specifications, a 400 response is sent. ServiceError
500 Internal Server Error Indicates an internal error occurred. ServiceError

Delete an existing dataset with it's rows.

Example request


curl -X delete https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/datasets/{userId}/{name} \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json'

DELETE https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/datasets/{userId}/{name} HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json



var headers = {
  'Accept':'application/json',
  'Content-Type':'application/json'

};

$.ajax({
  url: 'https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/datasets/{userId}/{name}',
  method: 'delete',
  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})
const request = require('node-fetch');
const headers = {
  'Accept':'application/json',
  'Content-Type':'application/json'

};

fetch('https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/datasets/{userId}/{name}',
{
  method: 'DELETE',headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'Content-Type' => 'application/json'
}

result = RestClient.delete 'https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/datasets/{userId}/{name}',

params: {
},
headers: headers

p JSON.parse(result)
import requests
headers = {
  'Accept': 'application/json',
  'Content-Type': 'application/json'
}

r = requests.delete('https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/datasets/{userId}/{name}',

params={
},
headers = headers)

print r.json()
URL obj = new URL("https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/datasets/{userId}/{name}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("DELETE");

int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

Example response

{
  "success": true
}

Example response

{
  "error": "sourceId must be a valid uuid sourceId={sourceId}",
  "errorCode": "InvalidArgument"
}

Example response

{
  "error": "Internal server error",
  "errorCode": "Unknown"
}

DELETE /app/{appId}/datasets/{userId}/{name}

Delete an existing dataset with it's rows.

Parameters

Parameter Type Data Type Default Description
*name path string The name of the dataset.
*appId path string A parameter indicating what integration ID to operate with.
*userId path string A parameter indicating what user ID to operate with.

Responses

Status Meaning Description Definition
200 OK Indicates the dataset and rows for the dataset were deleted. DatasetSvcDeleteReply
400 Bad Request When the provided details do not meet the parameter specifications, a 400 response is sent. ServiceError
500 Internal Server Error Indicates an internal error occurred. ServiceError

Init

Create new dashboard from template.

Example request


curl -X post \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  --data-binary @- https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/init/app/{appId}/dashboard <<EOF
{
  "collectionId": 1,
  "dashboardId": 2,
  "dashboardTemplateId": "3062ebff-9281-470e-a4a7-c38381b15e3b"
}
EOF

POST https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/init/app/{appId}/dashboard HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json

{
  "collectionId": 1,
  "dashboardId": 2,
  "dashboardTemplateId": "3062ebff-9281-470e-a4a7-c38381b15e3b"
}


var headers = {
  'Accept':'application/json',
  'Content-Type':'application/json'

};

$.ajax({
  url: 'https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/init/app/{appId}/dashboard',
  method: 'post',
  dataType: 'json',
  data: {
  "collectionId": 1,
  "dashboardId": 2,
  "dashboardTemplateId": "3062ebff-9281-470e-a4a7-c38381b15e3b"
},

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})
const request = require('node-fetch');
const inputBody = '{
  "collectionId": 1,
  "dashboardId": 2,
  "dashboardTemplateId": "3062ebff-9281-470e-a4a7-c38381b15e3b"
}';
const headers = {
  'Accept':'application/json',
  'Content-Type':'application/json'

};

fetch('https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/init/app/{appId}/dashboard',
{
  method: 'POST',body: inputBody,headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'Content-Type' => 'application/json'
}

result = RestClient.post 'https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/init/app/{appId}/dashboard',
payload={
  "collectionId": 1,
  "dashboardId": 2,
  "dashboardTemplateId": "3062ebff-9281-470e-a4a7-c38381b15e3b"
}
params: {
},
headers: headers

p JSON.parse(result)
import requests
headers = {
  'Accept': 'application/json',
  'Content-Type': 'application/json'
}

r = requests.post('https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/init/app/{appId}/dashboard',
json={
  "collectionId": 1,
  "dashboardId": 2,
  "dashboardTemplateId": "3062ebff-9281-470e-a4a7-c38381b15e3b"
}
params={
},
headers = headers)

print r.json()
URL obj = new URL("https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/init/app/{appId}/dashboard");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
String inputBody = "{" +
  "\"collectionId\": 1," +
  "\"dashboardId\": 2," +
  "\"dashboardTemplateId\": \"3062ebff-9281-470e-a4a7-c38381b15e3b\"" +
"}";

OutputStream os = conn.getOutputStream();
os.write(inputBody.getBytes("UTF-8"));
os.close();

int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

Example response

{
  "errorCode": "apiError",
  "errorDetail": "The orderId parameter must be a number.",
  "tag": "1495051362575:sgw-2240268717-53tbz:21:j2s24o4n:18441"
}

Example response

{
  "errorCode": "apiError",
  "errorDetail": "The orderId parameter must be a number.",
  "tag": "1495051362575:sgw-2240268717-53tbz:21:j2s24o4n:18441"
}

POST /app/{appId}/init/app/{appId}/dashboard

Attempts to enforce the set of widgets on a dashboard based on the input dashboard template, and it's associated widget templates.

Parameters

Parameter Type Data Type Default Description
*appId path string A parameter indicating what integration ID to operate with.

Body Parameters

CreateDashboardRequest object:

Property Type Description
collectionId integer The collection (folder) to put this dashboard into. Note: when excluded a folder will automatically be created named with the current date.
dashboardId integer The dashboard to enforce the widgets for. Note: this assumes that the UI has either created a fresh dashboard, or has already cleared the target dashboard of widgets.
dashboardTemplateId string The dashboard template to use as a template.

Responses

Status Meaning Description Definition
200 OK Indicates creation was successful. Note: no body is provided in this response, even though the code is 200.
400 Bad Request When the provided details do not meet the request specifications, a 400 response is sent. ServiceErrorWithTag
500 Internal Server Error Indicates a internal error occurred. ServiceErrorWithTag

Create new widget from template.

Example request


curl -X post \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  --data-binary @- https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/init/app/{appId}/widget <<EOF
{
  "dashboardId": "1",
  "metric": {
    "dataset": "transactions",
    "uuid": "81c8954e-95c5-44bc-87e5-dc7c38db1bb4"
  },
  "widget": {}
}
EOF

POST https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/init/app/{appId}/widget HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json

{
  "dashboardId": "1",
  "metric": {
    "dataset": "transactions",
    "uuid": "81c8954e-95c5-44bc-87e5-dc7c38db1bb4"
  },
  "widget": {}
}


var headers = {
  'Accept':'application/json',
  'Content-Type':'application/json'

};

$.ajax({
  url: 'https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/init/app/{appId}/widget',
  method: 'post',
  dataType: 'json',
  data: {
  "dashboardId": "1",
  "metric": {
    "dataset": "transactions",
    "uuid": "81c8954e-95c5-44bc-87e5-dc7c38db1bb4"
  },
  "widget": {}
},

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})
const request = require('node-fetch');
const inputBody = '{
  "dashboardId": "1",
  "metric": {
    "dataset": "transactions",
    "uuid": "81c8954e-95c5-44bc-87e5-dc7c38db1bb4"
  },
  "widget": {}
}';
const headers = {
  'Accept':'application/json',
  'Content-Type':'application/json'

};

fetch('https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/init/app/{appId}/widget',
{
  method: 'POST',body: inputBody,headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'Content-Type' => 'application/json'
}

result = RestClient.post 'https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/init/app/{appId}/widget',
payload={
  "dashboardId": "1",
  "metric": {
    "dataset": "transactions",
    "uuid": "81c8954e-95c5-44bc-87e5-dc7c38db1bb4"
  },
  "widget": {}
}
params: {
},
headers: headers

p JSON.parse(result)
import requests
headers = {
  'Accept': 'application/json',
  'Content-Type': 'application/json'
}

r = requests.post('https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/init/app/{appId}/widget',
json={
  "dashboardId": "1",
  "metric": {
    "dataset": "transactions",
    "uuid": "81c8954e-95c5-44bc-87e5-dc7c38db1bb4"
  },
  "widget": {}
}
params={
},
headers = headers)

print r.json()
URL obj = new URL("https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/init/app/{appId}/widget");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
String inputBody = "{" +
  "\"dashboardId\": \"1\"," +
  "\"metric\": {" +
    "\"dataset\": \"transactions\"," +
    "\"uuid\": \"81c8954e-95c5-44bc-87e5-dc7c38db1bb4\"" +
  "}," +
  "\"widget\": {}" +
"}";

OutputStream os = conn.getOutputStream();
os.write(inputBody.getBytes("UTF-8"));
os.close();

int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

Example response

{
  "errorCode": "apiError",
  "errorDetail": "The orderId parameter must be a number.",
  "tag": "1495051362575:sgw-2240268717-53tbz:21:j2s24o4n:18441"
}

Example response

{
  "errorCode": "internalError",
  "errorDetail": "Database connection is broken.",
  "tag": "1495051362575:sgw-2240268717-53tbz:21:j2s24o4n:18441"
}

POST /app/{appId}/init/app/{appId}/widget

Attempts to create a new widget from a widget template, on the targeted dashboard.

Parameters

Parameter Type Data Type Default Description
*appId path string A parameter indicating what integration ID to operate with.

Body Parameters

CreateWidgetRequest object:

Property Type Description
dashboardId string The dashboard to target for creating the widget.
metric A metric object as returned from the metric listing api, using a context=ui query parameter.
widget object The details of the widget. This is the same details as the call being made to normally create a widget.

Responses

Status Meaning Description Definition
200 OK Indicates creation was successful. Note: the schema for the returned body is identical to the legacy widget creation output.
400 Bad Request When the provided details do not meet the request specifications, a 400 response is sent. ServiceErrorWithTag
500 Internal Server Error Indicates a internal error occurred. ServiceErrorWithTag

Metrics

List of metrics.

Example request


curl -X get https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/templates/metrics \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json'

GET https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/templates/metrics HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json



var headers = {
  'Accept':'application/json',
  'Content-Type':'application/json'

};

$.ajax({
  url: 'https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/templates/metrics',
  method: 'get',
  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})
const request = require('node-fetch');
const headers = {
  'Accept':'application/json',
  'Content-Type':'application/json'

};

fetch('https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/templates/metrics',
{
  method: 'GET',headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'Content-Type' => 'application/json'
}

result = RestClient.get 'https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/templates/metrics',

params: {
},
headers: headers

p JSON.parse(result)
import requests
headers = {
  'Accept': 'application/json',
  'Content-Type': 'application/json'
}

r = requests.get('https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/templates/metrics',

params={
},
headers = headers)

print r.json()
URL obj = new URL("https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/templates/metrics");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");

int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

Example response

{
  "content": [
    {
      "dataset": "pagelines",
      "outputFormat": {
        "format": "LABEL",
        "label_args": {
          "col": "C"
        }
      },
      "transformTemplate": [
        {
          "operator": "RENAME_COLUMNS",
          "rename_args": {
            "rename": {
              "A": "B"
            }
          }
        },
        {
          "operator": "RENAME_COLUMNS",
          "rename_args": {
            "rename": {
              "B": "C"
            }
          }
        }
      ],
      "uuid": "1059fa46-eb5a-430f-aded-46bc2c257dce"
    }
  ],
  "page": {
    "number": 0,
    "size": 10,
    "totalElements": 1,
    "totalPages": 1
  }
}

Example response

{
  "errorCode": "apiError",
  "errorDetail": "The orderId parameter must be a number.",
  "tag": "1495051362575:sgw-2240268717-53tbz:21:j2s24o4n:18441"
}

GET /app/{appId}/templates/metrics

Get a list of metrics for your integration.

Parameters

Parameter Type Data Type Default Description
*appId path string A parameter indicating what integration ID to operate with.
size query integer 10 Used for pagination. Determines the number of items per page.
page query integer 0 Used for pagination. Determines the page to start results from. 0 based index.

Responses

Status Meaning Description Definition
200 OK Indicates a successful listing call. MetricResults
500 Internal Server Error Indicates a internal error occurred. ServiceErrorWithTag

Get metric.

Example request


curl -X get https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/templates/metrics/{uuid} \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json'

GET https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/templates/metrics/{uuid} HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json



var headers = {
  'Accept':'application/json',
  'Content-Type':'application/json'

};

$.ajax({
  url: 'https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/templates/metrics/{uuid}',
  method: 'get',
  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})
const request = require('node-fetch');
const headers = {
  'Accept':'application/json',
  'Content-Type':'application/json'

};

fetch('https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/templates/metrics/{uuid}',
{
  method: 'GET',headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'Content-Type' => 'application/json'
}

result = RestClient.get 'https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/templates/metrics/{uuid}',

params: {
},
headers: headers

p JSON.parse(result)
import requests
headers = {
  'Accept': 'application/json',
  'Content-Type': 'application/json'
}

r = requests.get('https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/templates/metrics/{uuid}',

params={
},
headers = headers)

print r.json()
URL obj = new URL("https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/templates/metrics/{uuid}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");

int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

Example response

{
  "dataset": "pagelines",
  "outputFormat": {
    "format": "LABEL",
    "label_args": {
      "col": "C"
    }
  },
  "transformTemplate": [
    {
      "operator": "RENAME_COLUMNS",
      "rename_args": {
        "rename": {
          "A": "B"
        }
      }
    },
    {
      "operator": "RENAME_COLUMNS",
      "rename_args": {
        "rename": {
          "B": "C"
        }
      }
    }
  ],
  "uuid": "1059fa46-eb5a-430f-aded-46bc2c257dce"
}

Example response

{
  "errorCode": "notFound",
  "errorDetail": "The requested resource was not found.",
  "tag": "1494969891655:sgw-2240268717-53tbz:21:j2s24o4n:10104"
}

Example response

{
  "errorCode": "internalError",
  "errorDetail": "Database connection is broken.",
  "tag": "1495051362575:sgw-2240268717-53tbz:21:j2s24o4n:18441"
}

GET /app/{appId}/templates/metrics/{uuid}

Get a metric by id for your integration.

Parameters

Parameter Type Data Type Default Description
*uuid path string The ID of the metric to operate on.
*appId path string A parameter indicating what integration ID to operate with.

Responses

Status Meaning Description Definition
200 OK Indicates a successful fetch. Metric
404 Not Found Indicates the requested metric was not found. ServiceErrorWithTag
500 Internal Server Error Indicates a internal error occurred. ServiceErrorWithTag

Create metrics.

Example request


curl -X post \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  --data-binary @- https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/templates/metrics <<EOF
{
  "dataset": "pagelines",
  "outputFormat": {
    "format": "LABEL",
    "label_args": {
      "col": "C"
    }
  },
  "transformTemplate": [
    {
      "operator": "RENAME_COLUMNS",
      "rename_args": {
        "rename": {
          "A": "B"
        }
      }
    },
    {
      "operator": "RENAME_COLUMNS",
      "rename_args": {
        "rename": {
          "B": "C"
        }
      }
    }
  ],
  "uuid": "1059fa46-eb5a-430f-aded-46bc2c257dce"
}
EOF

POST https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/templates/metrics HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json

{
  "dataset": "pagelines",
  "outputFormat": {
    "format": "LABEL",
    "label_args": {
      "col": "C"
    }
  },
  "transformTemplate": [
    {
      "operator": "RENAME_COLUMNS",
      "rename_args": {
        "rename": {
          "A": "B"
        }
      }
    },
    {
      "operator": "RENAME_COLUMNS",
      "rename_args": {
        "rename": {
          "B": "C"
        }
      }
    }
  ],
  "uuid": "1059fa46-eb5a-430f-aded-46bc2c257dce"
}


var headers = {
  'Accept':'application/json',
  'Content-Type':'application/json'

};

$.ajax({
  url: 'https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/templates/metrics',
  method: 'post',
  dataType: 'json',
  data: {
  "dataset": "pagelines",
  "outputFormat": {
    "format": "LABEL",
    "label_args": {
      "col": "C"
    }
  },
  "transformTemplate": [
    {
      "operator": "RENAME_COLUMNS",
      "rename_args": {
        "rename": {
          "A": "B"
        }
      }
    },
    {
      "operator": "RENAME_COLUMNS",
      "rename_args": {
        "rename": {
          "B": "C"
        }
      }
    }
  ],
  "uuid": "1059fa46-eb5a-430f-aded-46bc2c257dce"
},

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})
const request = require('node-fetch');
const inputBody = '{
  "dataset": "pagelines",
  "outputFormat": {
    "format": "LABEL",
    "label_args": {
      "col": "C"
    }
  },
  "transformTemplate": [
    {
      "operator": "RENAME_COLUMNS",
      "rename_args": {
        "rename": {
          "A": "B"
        }
      }
    },
    {
      "operator": "RENAME_COLUMNS",
      "rename_args": {
        "rename": {
          "B": "C"
        }
      }
    }
  ],
  "uuid": "1059fa46-eb5a-430f-aded-46bc2c257dce"
}';
const headers = {
  'Accept':'application/json',
  'Content-Type':'application/json'

};

fetch('https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/templates/metrics',
{
  method: 'POST',body: inputBody,headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'Content-Type' => 'application/json'
}

result = RestClient.post 'https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/templates/metrics',
payload={
  "dataset": "pagelines",
  "outputFormat": {
    "format": "LABEL",
    "label_args": {
      "col": "C"
    }
  },
  "transformTemplate": [
    {
      "operator": "RENAME_COLUMNS",
      "rename_args": {
        "rename": {
          "A": "B"
        }
      }
    },
    {
      "operator": "RENAME_COLUMNS",
      "rename_args": {
        "rename": {
          "B": "C"
        }
      }
    }
  ],
  "uuid": "1059fa46-eb5a-430f-aded-46bc2c257dce"
}
params: {
},
headers: headers

p JSON.parse(result)
import requests
headers = {
  'Accept': 'application/json',
  'Content-Type': 'application/json'
}

r = requests.post('https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/templates/metrics',
json={
  "dataset": "pagelines",
  "outputFormat": {
    "format": "LABEL",
    "label_args": {
      "col": "C"
    }
  },
  "transformTemplate": [
    {
      "operator": "RENAME_COLUMNS",
      "rename_args": {
        "rename": {
          "A": "B"
        }
      }
    },
    {
      "operator": "RENAME_COLUMNS",
      "rename_args": {
        "rename": {
          "B": "C"
        }
      }
    }
  ],
  "uuid": "1059fa46-eb5a-430f-aded-46bc2c257dce"
}
params={
},
headers = headers)

print r.json()
URL obj = new URL("https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/templates/metrics");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
String inputBody = "{" +
  "\"dataset\": \"pagelines\"," +
  "\"outputFormat\": {" +
    "\"format\": \"LABEL\"," +
    "\"label_args\": {" +
      "\"col\": \"C\"" +
    "}" +
  "}," +
  "\"transformTemplate\": [" +
    "{" +
      "\"operator\": \"RENAME_COLUMNS\"," +
      "\"rename_args\": {" +
        "\"rename\": {" +
          "\"A\": \"B\"" +
        "}" +
      "}" +
    "}," +
    "{" +
      "\"operator\": \"RENAME_COLUMNS\"," +
      "\"rename_args\": {" +
        "\"rename\": {" +
          "\"B\": \"C\"" +
        "}" +
      "}" +
    "}" +
  "]," +
  "\"uuid\": \"1059fa46-eb5a-430f-aded-46bc2c257dce\"" +
"}";

OutputStream os = conn.getOutputStream();
os.write(inputBody.getBytes("UTF-8"));
os.close();

int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

Example response

{
  "dataset": "pagelines",
  "outputFormat": {
    "format": "LABEL",
    "label_args": {
      "col": "C"
    }
  },
  "transformTemplate": [
    {
      "operator": "RENAME_COLUMNS",
      "rename_args": {
        "rename": {
          "A": "B"
        }
      }
    },
    {
      "operator": "RENAME_COLUMNS",
      "rename_args": {
        "rename": {
          "B": "C"
        }
      }
    }
  ],
  "uuid": "1059fa46-eb5a-430f-aded-46bc2c257dce"
}

Example response

{
  "errorCode": "apiError",
  "errorDetail": "The orderId parameter must be a number.",
  "tag": "1495051362575:sgw-2240268717-53tbz:21:j2s24o4n:18441"
}

Example response

{
  "errorCode": "apiError",
  "errorDetail": "The orderId parameter must be a number.",
  "tag": "1495051362575:sgw-2240268717-53tbz:21:j2s24o4n:18441"
}

POST /app/{appId}/templates/metrics

Create a new metric for your integration.

Parameters

Parameter Type Data Type Default Description
*appId path string A parameter indicating what integration ID to operate with.

Body Parameters

Metric object:

Property Type Description
dataset string The name of a dataset.
description string A human readable string to describe this object.
name string A human readable string for this object.
outputFormat The final output format for this metric. Note: each format value only supports one format arguments input. Each argument set is mutually exclusive.
transformTemplate array of A set of transformation steps.
uuid string The UUID version 4 used to identify a object.

Responses

Status Meaning Description Definition
201 Created Indicates the metric was created. Metric
400 Bad Request When the provided details do not meet the metric specifications, a 400 response is sent. ServiceErrorWithTag
500 Internal Server Error Indicates a internal error occurred. ServiceErrorWithTag

Delete metric.

Example request


curl -X delete https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/templates/metrics/{uuid} \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json'

DELETE https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/templates/metrics/{uuid} HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json



var headers = {
  'Accept':'application/json',
  'Content-Type':'application/json'

};

$.ajax({
  url: 'https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/templates/metrics/{uuid}',
  method: 'delete',
  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})
const request = require('node-fetch');
const headers = {
  'Accept':'application/json',
  'Content-Type':'application/json'

};

fetch('https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/templates/metrics/{uuid}',
{
  method: 'DELETE',headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'Content-Type' => 'application/json'
}

result = RestClient.delete 'https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/templates/metrics/{uuid}',

params: {
},
headers: headers

p JSON.parse(result)
import requests
headers = {
  'Accept': 'application/json',
  'Content-Type': 'application/json'
}

r = requests.delete('https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/templates/metrics/{uuid}',

params={
},
headers = headers)

print r.json()
URL obj = new URL("https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/templates/metrics/{uuid}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("DELETE");

int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

Example response

{
  "errorCode": "internalError",
  "errorDetail": "Database connection is broken.",
  "tag": "1495051362575:sgw-2240268717-53tbz:21:j2s24o4n:18441"
}

DELETE /app/{appId}/templates/metrics/{uuid}

Delete a metric by id for your integration.

Parameters

Parameter Type Data Type Default Description
*uuid path string The ID of the metric to operate on.
*appId path string A parameter indicating what integration ID to operate with.

Responses

Status Meaning Description Definition
204 No Content Indicates a successful delete. Note: this API does not return a 404. A non existent object is considered a successful delete.
500 Internal Server Error Indicates a internal error occurred. ServiceErrorWithTag

Provision

Provision a new appinsights connection.

Example request


curl -X post \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  --data-binary @- https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/accounts <<EOF
{
  "user": {
    "companyId": "5b1338e0-f6f4-4103-900f-2fbc5830f25e",
    "userId": "90bead93-f075-400d-9886-c54f0649f6f6"
  }
}
EOF

POST https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/accounts HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json

{
  "user": {
    "companyId": "5b1338e0-f6f4-4103-900f-2fbc5830f25e",
    "userId": "90bead93-f075-400d-9886-c54f0649f6f6"
  }
}


var headers = {
  'Accept':'application/json',
  'Content-Type':'application/json'

};

$.ajax({
  url: 'https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/accounts',
  method: 'post',
  dataType: 'json',
  data: {
  "user": {
    "companyId": "5b1338e0-f6f4-4103-900f-2fbc5830f25e",
    "userId": "90bead93-f075-400d-9886-c54f0649f6f6"
  }
},

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})
const request = require('node-fetch');
const inputBody = '{
  "user": {
    "companyId": "5b1338e0-f6f4-4103-900f-2fbc5830f25e",
    "userId": "90bead93-f075-400d-9886-c54f0649f6f6"
  }
}';
const headers = {
  'Accept':'application/json',
  'Content-Type':'application/json'

};

fetch('https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/accounts',
{
  method: 'POST',body: inputBody,headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'Content-Type' => 'application/json'
}

result = RestClient.post 'https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/accounts',
payload={
  "user": {
    "companyId": "5b1338e0-f6f4-4103-900f-2fbc5830f25e",
    "userId": "90bead93-f075-400d-9886-c54f0649f6f6"
  }
}
params: {
},
headers: headers

p JSON.parse(result)
import requests
headers = {
  'Accept': 'application/json',
  'Content-Type': 'application/json'
}

r = requests.post('https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/accounts',
json={
  "user": {
    "companyId": "5b1338e0-f6f4-4103-900f-2fbc5830f25e",
    "userId": "90bead93-f075-400d-9886-c54f0649f6f6"
  }
}
params={
},
headers = headers)

print r.json()
URL obj = new URL("https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/accounts");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
String inputBody = "{" +
  "\"user\": {" +
    "\"companyId\": \"5b1338e0-f6f4-4103-900f-2fbc5830f25e\"," +
    "\"userId\": \"90bead93-f075-400d-9886-c54f0649f6f6\"" +
  "}" +
"}";

OutputStream os = conn.getOutputStream();
os.write(inputBody.getBytes("UTF-8"));
os.close();

int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

Example response

{
  "errorCode": "apiError",
  "errorDetail": "The orderId parameter must be a number.",
  "tag": "1495051362575:sgw-2240268717-53tbz:21:j2s24o4n:18441"
}

Example response

{
  "errorCode": "internalError",
  "errorDetail": "Database connection is broken.",
  "tag": "1495051362575:sgw-2240268717-53tbz:21:j2s24o4n:18441"
}

POST /app/{appId}/accounts

Provision a new appinsights connection providing a userId and companyId.

Parameters

Parameter Type Data Type Default Description
*appId path string A parameter indicating what integration ID to operate with.

Body Parameters

ProvisionConnectionRequest object:

Property Type Description
user

Responses

Status Meaning Description Definition
201 Created Indicates provisioning was successful.
400 Bad Request When the provided details do not meet the request specifications, a 400 response is sent. ServiceErrorWithTag
500 Internal Server Error Indicates a internal error occurred. ServiceErrorWithTag

Widgets

List of widget templates.

Example request


curl -X get https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/templates/widgets \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json'

GET https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/templates/widgets HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json



var headers = {
  'Accept':'application/json',
  'Content-Type':'application/json'

};

$.ajax({
  url: 'https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/templates/widgets',
  method: 'get',
  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})
const request = require('node-fetch');
const headers = {
  'Accept':'application/json',
  'Content-Type':'application/json'

};

fetch('https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/templates/widgets',
{
  method: 'GET',headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'Content-Type' => 'application/json'
}

result = RestClient.get 'https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/templates/widgets',

params: {
},
headers: headers

p JSON.parse(result)
import requests
headers = {
  'Accept': 'application/json',
  'Content-Type': 'application/json'
}

r = requests.get('https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/templates/widgets',

params={
},
headers = headers)

print r.json()
URL obj = new URL("https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/templates/widgets");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");

int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

Example response

{
  "content": [
    {
      "dataRetrieverTypeId": 50,
      "gridHeight": 4,
      "gridWidth": 5,
      "gridX": 5,
      "gridY": 0,
      "maxHeight": 12,
      "maxWidth": 48,
      "metric": "d8da3b53-69b7-4016-880d-77d4e4fef60b",
      "minHeight": 1,
      "minWidth": 2,
      "params": {},
      "uuid": "126b397e-ab62-42eb-a265-05c5fa0d0d31",
      "widgetTypeId": 14
    }
  ],
  "page": {
    "number": 0,
    "size": 10,
    "totalElements": 1,
    "totalPages": 1
  }
}

Example response

{
  "errorCode": "apiError",
  "errorDetail": "The orderId parameter must be a number.",
  "tag": "1495051362575:sgw-2240268717-53tbz:21:j2s24o4n:18441"
}

GET /app/{appId}/templates/widgets

Get a list of widget templates.

Parameters

Parameter Type Data Type Default Description
*appId path string A parameter indicating what integration ID to operate with.
size query integer 10 Used for pagination. Determines the number of items per page.
page query integer 0 Used for pagination. Determines the page to start results from. 0 based index.

Responses

Status Meaning Description Definition
200 OK Indicates a successful listing call. WidgetTemplateResults
500 Internal Server Error Indicates a internal error occurred. ServiceErrorWithTag

Get widget template.

Example request


curl -X get https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/templates/widgets/{uuid} \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json'

GET https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/templates/widgets/{uuid} HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json



var headers = {
  'Accept':'application/json',
  'Content-Type':'application/json'

};

$.ajax({
  url: 'https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/templates/widgets/{uuid}',
  method: 'get',
  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})
const request = require('node-fetch');
const headers = {
  'Accept':'application/json',
  'Content-Type':'application/json'

};

fetch('https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/templates/widgets/{uuid}',
{
  method: 'GET',headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'Content-Type' => 'application/json'
}

result = RestClient.get 'https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/templates/widgets/{uuid}',

params: {
},
headers: headers

p JSON.parse(result)
import requests
headers = {
  'Accept': 'application/json',
  'Content-Type': 'application/json'
}

r = requests.get('https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/templates/widgets/{uuid}',

params={
},
headers = headers)

print r.json()
URL obj = new URL("https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/templates/widgets/{uuid}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");

int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

Example response

{
  "dataRetrieverTypeId": 7,
  "gridHeight": 4,
  "gridWidth": 5,
  "gridX": 5,
  "gridY": 0,
  "maxHeight": 12,
  "maxWidth": 12,
  "metric": "965a7af6-e31d-4316-bb1a-9f7dc200c875",
  "minHeight": 1,
  "minWidth": 2,
  "params": {},
  "uuid": "6753bf9d-22e9-43cf-a6f9-3f4254b862e5",
  "widgetTypeId": 14
}

Example response

{
  "errorCode": "notFound",
  "errorDetail": "The requested resource was not found.",
  "tag": "1494969891655:sgw-2240268717-53tbz:21:j2s24o4n:10104"
}

Example response

{
  "errorCode": "apiError",
  "errorDetail": "The orderId parameter must be a number.",
  "tag": "1495051362575:sgw-2240268717-53tbz:21:j2s24o4n:18441"
}

GET /app/{appId}/templates/widgets/{uuid}

Get a widget template by id.

Parameters

Parameter Type Data Type Default Description
*uuid path string The ID of the widget template to operate on.
*appId path string A parameter indicating what integration ID to operate with.

Responses

Status Meaning Description Definition
200 OK Indicates a successful fetch. WidgetTemplate
404 Not Found Indicates the requested widget template was not found. ServiceErrorWithTag
500 Internal Server Error Indicates a internal error occurred. ServiceErrorWithTag

Create widget template.

Example request


curl -X post \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  --data-binary @- https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/templates/widgets <<EOF
{
  "dataRetrieverTypeId": 50,
  "gridHeight": 4,
  "gridWidth": 5,
  "gridX": 5,
  "gridY": 0,
  "maxHeight": 12,
  "maxWidth": 48,
  "metric": "965a7af6-e31d-4316-bb1a-9f7dc200c875",
  "minHeight": 1,
  "minWidth": 2,
  "params": {},
  "serviceTypeId": 10,
  "uuid": "6753bf9d-22e9-43cf-a6f9-3f4254b862e5",
  "widgetTypeId": 14
}
EOF

POST https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/templates/widgets HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json

{
  "dataRetrieverTypeId": 50,
  "gridHeight": 4,
  "gridWidth": 5,
  "gridX": 5,
  "gridY": 0,
  "maxHeight": 12,
  "maxWidth": 48,
  "metric": "965a7af6-e31d-4316-bb1a-9f7dc200c875",
  "minHeight": 1,
  "minWidth": 2,
  "params": {},
  "serviceTypeId": 10,
  "uuid": "6753bf9d-22e9-43cf-a6f9-3f4254b862e5",
  "widgetTypeId": 14
}


var headers = {
  'Accept':'application/json',
  'Content-Type':'application/json'

};

$.ajax({
  url: 'https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/templates/widgets',
  method: 'post',
  dataType: 'json',
  data: {
  "dataRetrieverTypeId": 50,
  "gridHeight": 4,
  "gridWidth": 5,
  "gridX": 5,
  "gridY": 0,
  "maxHeight": 12,
  "maxWidth": 48,
  "metric": "965a7af6-e31d-4316-bb1a-9f7dc200c875",
  "minHeight": 1,
  "minWidth": 2,
  "params": {},
  "serviceTypeId": 10,
  "uuid": "6753bf9d-22e9-43cf-a6f9-3f4254b862e5",
  "widgetTypeId": 14
},

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})
const request = require('node-fetch');
const inputBody = '{
  "dataRetrieverTypeId": 50,
  "gridHeight": 4,
  "gridWidth": 5,
  "gridX": 5,
  "gridY": 0,
  "maxHeight": 12,
  "maxWidth": 48,
  "metric": "965a7af6-e31d-4316-bb1a-9f7dc200c875",
  "minHeight": 1,
  "minWidth": 2,
  "params": {},
  "serviceTypeId": 10,
  "uuid": "6753bf9d-22e9-43cf-a6f9-3f4254b862e5",
  "widgetTypeId": 14
}';
const headers = {
  'Accept':'application/json',
  'Content-Type':'application/json'

};

fetch('https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/templates/widgets',
{
  method: 'POST',body: inputBody,headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'Content-Type' => 'application/json'
}

result = RestClient.post 'https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/templates/widgets',
payload={
  "dataRetrieverTypeId": 50,
  "gridHeight": 4,
  "gridWidth": 5,
  "gridX": 5,
  "gridY": 0,
  "maxHeight": 12,
  "maxWidth": 48,
  "metric": "965a7af6-e31d-4316-bb1a-9f7dc200c875",
  "minHeight": 1,
  "minWidth": 2,
  "params": {},
  "serviceTypeId": 10,
  "uuid": "6753bf9d-22e9-43cf-a6f9-3f4254b862e5",
  "widgetTypeId": 14
}
params: {
},
headers: headers

p JSON.parse(result)
import requests
headers = {
  'Accept': 'application/json',
  'Content-Type': 'application/json'
}

r = requests.post('https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/templates/widgets',
json={
  "dataRetrieverTypeId": 50,
  "gridHeight": 4,
  "gridWidth": 5,
  "gridX": 5,
  "gridY": 0,
  "maxHeight": 12,
  "maxWidth": 48,
  "metric": "965a7af6-e31d-4316-bb1a-9f7dc200c875",
  "minHeight": 1,
  "minWidth": 2,
  "params": {},
  "serviceTypeId": 10,
  "uuid": "6753bf9d-22e9-43cf-a6f9-3f4254b862e5",
  "widgetTypeId": 14
}
params={
},
headers = headers)

print r.json()
URL obj = new URL("https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/templates/widgets");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
String inputBody = "{" +
  "\"dataRetrieverTypeId\": 50," +
  "\"gridHeight\": 4," +
  "\"gridWidth\": 5," +
  "\"gridX\": 5," +
  "\"gridY\": 0," +
  "\"maxHeight\": 12," +
  "\"maxWidth\": 48," +
  "\"metric\": \"965a7af6-e31d-4316-bb1a-9f7dc200c875\"," +
  "\"minHeight\": 1," +
  "\"minWidth\": 2," +
  "\"params\": {}," +
  "\"serviceTypeId\": 10," +
  "\"uuid\": \"6753bf9d-22e9-43cf-a6f9-3f4254b862e5\"," +
  "\"widgetTypeId\": 14" +
"}";

OutputStream os = conn.getOutputStream();
os.write(inputBody.getBytes("UTF-8"));
os.close();

int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

Example response

{
  "dataRetrieverTypeId": 7,
  "gridHeight": 4,
  "gridWidth": 5,
  "gridX": 5,
  "gridY": 0,
  "maxHeight": 12,
  "maxWidth": 12,
  "metric": "965a7af6-e31d-4316-bb1a-9f7dc200c875",
  "minHeight": 1,
  "minWidth": 2,
  "params": {},
  "uuid": "6753bf9d-22e9-43cf-a6f9-3f4254b862e5",
  "widgetTypeId": 14
}

Example response

{
  "errorCode": "apiError",
  "errorDetail": "The orderId parameter must be a number.",
  "tag": "1495051362575:sgw-2240268717-53tbz:21:j2s24o4n:18441"
}

Example response

{
  "errorCode": "apiError",
  "errorDetail": "The orderId parameter must be a number.",
  "tag": "1495051362575:sgw-2240268717-53tbz:21:j2s24o4n:18441"
}

POST /app/{appId}/templates/widgets

Create a new widget template.

Parameters

Parameter Type Data Type Default Description
*appId path string A parameter indicating what integration ID to operate with.

Body Parameters

WidgetTemplate object:

Property Type Description
dataRetrieverTypeId integer Represents the internal retriever type used. The following is a list of the various data retriever types available:
7 - Custom Number
8 - Custom Text
9 - Custom Leaderboard
10 - Custom Geo
20 - Custom List
120 - Custom Image
121 - Custom Label
122 - Custom Graph
174 - Custom Table
247 - Custom HTML
307 - Time
312 - Gallery
348 - Custom Multibar
For more details, please contact AppInsights.
gridHeight integer The height in grid units for a widget instance created from this widget template.
gridWidth integer The width in grid units for a widget instance created from this widget template.
gridX integer The X grid coordinate for the location of a widget instance created from this widget template. Note: 0, 0 represents the top left corder of a dashboard.
gridY integer The Y grid coordinate for the location of a widget instance created from this widget template. Note: 0, 0 represents the top left corder of a dashboard.
maxHeight integer The maximum height in grid units of a widget instance created from this widget template.
maxWidth integer The maximum width in grid units of a widget instance created from this widget template.
metric string A list of UUID strings.
minHeight integer The minimum height in grid units of a widget instance created from this widget template.
minWidth integer The minimum width in grid units of a widget instance created from this widget template.
params object Provides parameters specific to the widget type. Please contact AppInsights for details on this property.
uuid string The UUID version 4 used to identify a object.
widgetTypeId integer Represents the internal widget type to use. The following is a list of the various widget types available:
1 - Label
2 - Number
3 - Horizontal Bar
4 - Vertical Bar
5 - Dial
6 - USA Map
7 - World Map
8 - Text Feed
9 - Leaderboard
10 - List
11 - Image
12 - Stoplight
13 - Line Graph
14 - Sparkline
15 - XY Graph
16 - Bar Graph
17 - Table
18 - HTML
19 - Pie Chart
21 - World Maps
22 - The time
23 - Gallery Widget
24 - Bar Graph
25 - Custom HTML
26 - Multi-bar Graph
For more details, please contact AppInsights.

Responses

Status Meaning Description Definition
201 Created Indicates the widget template was created. WidgetTemplate
400 Bad Request When the provided details do not meet the widget template specifications, a 400 response is sent. ServiceErrorWithTag
500 Internal Server Error Indicates a internal error occurred. ServiceErrorWithTag

Delete widget template.

Example request


curl -X delete https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/templates/widgets/{uuid} \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json'

DELETE https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/templates/widgets/{uuid} HTTP/1.1
Host: appdirect.com
Content-Type: application/json
Accept: application/json



var headers = {
  'Accept':'application/json',
  'Content-Type':'application/json'

};

$.ajax({
  url: 'https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/templates/widgets/{uuid}',
  method: 'delete',
  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})
const request = require('node-fetch');
const headers = {
  'Accept':'application/json',
  'Content-Type':'application/json'

};

fetch('https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/templates/widgets/{uuid}',
{
  method: 'DELETE',headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
require 'rest-client'
require 'json'

headers = {
  'Accept' => 'application/json',
  'Content-Type' => 'application/json'
}

result = RestClient.delete 'https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/templates/widgets/{uuid}',

params: {
},
headers: headers

p JSON.parse(result)
import requests
headers = {
  'Accept': 'application/json',
  'Content-Type': 'application/json'
}

r = requests.delete('https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/templates/widgets/{uuid}',

params={
},
headers = headers)

print r.json()
URL obj = new URL("https://{marketplaceURL}/api/integration/v1/visualization/app/{appId}/templates/widgets/{uuid}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("DELETE");

int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

Example response

{
  "errorCode": "apiError",
  "errorDetail": "The orderId parameter must be a number.",
  "tag": "1495051362575:sgw-2240268717-53tbz:21:j2s24o4n:18441"
}

DELETE /app/{appId}/templates/widgets/{uuid}

Delete a widget template by id.

Parameters

Parameter Type Data Type Default Description
*uuid path string The ID of the widget template to operate on.
*appId path string A parameter indicating what integration ID to operate with.

Responses

Status Meaning Description Definition
204 No Content Indicates a successful delete. Note: this API does not return a 404. A non existent object is considered a successful delete.
500 Internal Server Error Indicates a internal error occurred. ServiceErrorWithTag

Definitions

CollectionTemplate

Represents a collection-template.

{
  "dashboardTemplates": [
    "7f140fe8-8277-41f6-b0fc-ffcd93a37df7"
  ],
  "title": "Example Folder"
}
Property Type Description
dashboardTemplates array of string A list of UUID strings.
title string Represents the title that will be used for an instnace of this collection template. This is exposed in the AppInsights user interface.
uuid string The UUID version 4 used to identify a object.

CollectionTemplateResults

{
  "content": [
    {
      "dashboardTemplates": [],
      "title": "Example Folder",
      "uuid": "64ebad8d-d42f-44fc-b89b-e103b98b6d5b"
    }
  ],
  "page": {
    "number": 0,
    "size": 10,
    "totalElements": 1,
    "totalPages": 1
  }
}
Property Type Description
content array of CollectionTemplate A list of results for the requested page.
page object Represents meta data information about the results being returned.

CreateDashboardRequest

Represent the request to create a dashboard

{
  "collectionId": 1,
  "dashboardId": 2,
  "dashboardTemplateId": "3062ebff-9281-470e-a4a7-c38381b15e3b"
}
Property Type Description
collectionId integer The collection (folder) to put this dashboard into. Note: when excluded a folder will automatically be created named with the current date.
dashboardId integer The dashboard to enforce the widgets for. Note: this assumes that the UI has either created a fresh dashboard, or has already cleared the target dashboard of widgets.
dashboardTemplateId string The dashboard template to use as a template.

CreateWidgetRequest

Represent the request to create a widget

{
  "dashboardId": "1",
  "metric": {
    "dataset": "transactions",
    "uuid": "81c8954e-95c5-44bc-87e5-dc7c38db1bb4"
  },
  "widget": {}
}
Property Type Description
dashboardId string The dashboard to target for creating the widget.
metric A metric object as returned from the metric listing api, using a context=ui query parameter.
widget object The details of the widget. This is the same details as the call being made to normally create a widget.

DashboardTemplate

Represents a dashboard-template.

{
  "description": "Visits",
  "fields": {
    "description": "Visits",
    "imageURL": "template02.png",
    "name": "Site Visitors"
  },
  "imageURL": "template02.png",
  "model": "base.template",
  "name": "Site Visitors",
  "serviceTypeId": 1,
  "title": "Example Dashboard",
  "uuid": "7f140fe8-8277-41f6-b0fc-ffcd93a37df7",
  "widgetTemplates": []
}
Property Type Description
description string Not in v1. This may be used in the future.
imageURL string Used as a image url for a preview image that shows what this template will look like.
model string Used as a internal identifier. The only valid value is currently base.template.
name string Used as an internal machine readable name for this template.
serviceTypeId integer For internal use. The only valid value as of v1 is 1.
title string Represents the title that will be used for instances of this dashboard template. This is exposed in the AppInsights user interface.
uuid string The UUID version 4 used to identify a object.
widgetTemplates array of string A list of UUID strings.

DatasetSvcAddRowsReply

Returns the number of successful rows added and rows updated for a given dataset.

{
  "rows_added": 2,
  "rows_updated": 1
}
Property Type Description
rows_added integer The total number of rows added.
rows_updated integer The total number of rows updated.

DatasetSvcDataset

Represents a dataset.

{
  "columns": [
    "stringColumn",
    "numberColumn",
    "floatColumn",
    "boolColumn"
  ],
  "name": "TestDataset",
  "rows": [
    [
      "a",
      123,
      99.99,
      false
    ],
    [
      "b",
      234,
      null,
      true
    ],
    [
      "a",
      345,
      null,
      true
    ]
  ]
}
Property Type Description
columns array of string A list of column names. The length of the column list must match the length of each row.
name string The name of the dataset.
rows array of array A list of row data that can be any format except an array or object. Each row must match the length of the columns list. The first item of each row is identified as the unique ID of that row.

DatasetSvcDeleteReply

Represents a successful dataset and rows delete.

{
  "success": true
}
Property Type Description
success boolean True if the dataset was successfully deleted.

DatasetSvcListDatasetsReply

Returns a list of datasets.

{
  "datasets": [
    {
      "columns": [
        "col1"
      ],
      "dataset_id": "1239f5f4-c2f2-4bdb-9546-f3bfc44a67a9",
      "name": "noRows",
      "row_count": 0,
      "source_id": "8B0AB2D7-B04B-449B-BE64-BD2F178A7552",
      "target_id": "aa89a3e6-153c-45a1-bd38-4bea06ff58d4"
    },
    {
      "columns": [
        "name",
        "age",
        "is_pet_owner",
        "pet_name"
      ],
      "dataset_id": "1239f5f4-c2f2-4bdb-9546-f3bfc44a67a8",
      "name": "hasRows",
      "row_count": 2,
      "source_id": "8B0AB2D7-B04B-449B-BE64-BD2F178A7552",
      "target_id": "aa89a3e6-153c-45a1-bd38-4bea06ff58d4"
    }
  ]
}
Property Type Description
datasets array of object The list of datasets.

DatasetSvcListRowsReply

Returns a list of datasets.

{
  "rows": [
    [
      "fizzy-drink",
      1.99,
      false,
      null
    ],
    [
      "flat-drink",
      0.99,
      true,
      "glass"
    ]
  ]
}
Property Type Description
rows array of array The list of rows.

DatasetSvcUpdateRows

Represents the request for updating rows.

{
  "columns": [
    "stringColumn",
    "numberColumn",
    "floatColumn",
    "boolColumn"
  ],
  "name": "TestDataset",
  "rows": [
    [
      "a",
      123,
      99.99,
      false
    ],
    [
      "b",
      234,
      null,
      true
    ],
    [
      "a",
      345,
      null,
      true
    ],
    [
      "c",
      456,
      99.99,
      true
    ]
  ]
}
Property Type Description
rows array of array A list of row data that can be any format except an array or object. Each row must match the length of the columns list. The first item of each row is identified as the unique ID of that row.

DatasetSvcUpdateRowsReply

Returns the number of successful rows added and rows updated for a given dataset.

{
  "rows_added": 1,
  "rows_updated": 3
}
Property Type Description
rows_added integer The total number of rows added.
rows_updated integer The total number of rows updated.

Metric

Represents a metric.

{
  "dataset": "pagelines",
  "outputFormat": {
    "format": "LABEL",
    "label_args": {
      "col": "C"
    }
  },
  "transformTemplate": [
    {
      "operator": "RENAME_COLUMNS",
      "rename_args": {
        "rename": {
          "A": "B"
        }
      }
    },
    {
      "operator": "RENAME_COLUMNS",
      "rename_args": {
        "rename": {
          "B": "C"
        }
      }
    }
  ],
  "uuid": "1059fa46-eb5a-430f-aded-46bc2c257dce"
}
Property Type Description
dataset string The name of a dataset.
description string A human readable string to describe this object.
name string A human readable string for this object.
outputFormat The final output format for this metric. Note: each format value only supports one format arguments input. Each argument set is mutually exclusive.
transformTemplate array of A set of transformation steps.
uuid string The UUID version 4 used to identify a object.

MetricResults

{
  "content": [
    {
      "dataset": "pagelines",
      "outputFormat": {
        "format": "LABEL",
        "label_args": {
          "col": "C"
        }
      },
      "transformTemplate": [
        {
          "operator": "RENAME_COLUMNS",
          "rename_args": {
            "rename": {
              "A": "B"
            }
          }
        },
        {
          "operator": "RENAME_COLUMNS",
          "rename_args": {
            "rename": {
              "B": "C"
            }
          }
        }
      ],
      "uuid": "1059fa46-eb5a-430f-aded-46bc2c257dce"
    }
  ],
  "page": {
    "number": 0,
    "size": 10,
    "totalElements": 1,
    "totalPages": 1
  }
}
Property Type Description
content array of object A list of results for the requested page.
page object Represents meta data information about the results being returned.

ProvisionConnectionRequest

Represent a request to provision a new appinsights connection

{
  "user": {
    "companyId": "5b1338e0-f6f4-4103-900f-2fbc5830f25e",
    "userId": "90bead93-f075-400d-9886-c54f0649f6f6"
  }
}
Property Type Description
user

ServiceError

{
  "error": "sourceId must be a valid uuid sourceId={sourceId}",
  "errorCode": "InvalidArgument"
}
Property Type Description
error string A description of why the error occurred.
errorCode string A code representing the http status code (InvalidArgument, Unknown, NotFound).

ServiceErrorWithTag

{
  "errorCode": "apiError",
  "errorDetail": "The orderId parameter must be a number.",
  "tag": "1495051362575:sgw-2240268717-53tbz:21:j2s24o4n:18441"
}
Property Type Description
errorCode string Status code returned by the server.
errorDetail A string or object giving more details of why the error occurred.
tag string A string representing the internal tag for this request. This helps to debug when looking through error logs.

WidgetTemplate

Represents a widget-template.

{
  "dataRetrieverTypeId": 50,
  "gridHeight": 4,
  "gridWidth": 5,
  "gridX": 5,
  "gridY": 0,
  "maxHeight": 12,
  "maxWidth": 48,
  "metric": "965a7af6-e31d-4316-bb1a-9f7dc200c875",
  "minHeight": 1,
  "minWidth": 2,
  "params": {},
  "serviceTypeId": 10,
  "uuid": "6753bf9d-22e9-43cf-a6f9-3f4254b862e5",
  "widgetTypeId": 14
}
Property Type Description
dataRetrieverTypeId integer Represents the internal retriever type used. The following is a list of the various data retriever types available:
7 - Custom Number
8 - Custom Text
9 - Custom Leaderboard
10 - Custom Geo
20 - Custom List
120 - Custom Image
121 - Custom Label
122 - Custom Graph
174 - Custom Table
247 - Custom HTML
307 - Time
312 - Gallery
348 - Custom Multibar
For more details, please contact AppInsights.
gridHeight integer The height in grid units for a widget instance created from this widget template.
gridWidth integer The width in grid units for a widget instance created from this widget template.
gridX integer The X grid coordinate for the location of a widget instance created from this widget template. Note: 0, 0 represents the top left corder of a dashboard.
gridY integer The Y grid coordinate for the location of a widget instance created from this widget template. Note: 0, 0 represents the top left corder of a dashboard.
maxHeight integer The maximum height in grid units of a widget instance created from this widget template.
maxWidth integer The maximum width in grid units of a widget instance created from this widget template.
metric string A list of UUID strings.
minHeight integer The minimum height in grid units of a widget instance created from this widget template.
minWidth integer The minimum width in grid units of a widget instance created from this widget template.
params object Provides parameters specific to the widget type. Please contact AppInsights for details on this property.
uuid string The UUID version 4 used to identify a object.
widgetTypeId integer Represents the internal widget type to use. The following is a list of the various widget types available:
1 - Label
2 - Number
3 - Horizontal Bar
4 - Vertical Bar
5 - Dial
6 - USA Map
7 - World Map
8 - Text Feed
9 - Leaderboard
10 - List
11 - Image
12 - Stoplight
13 - Line Graph
14 - Sparkline
15 - XY Graph
16 - Bar Graph
17 - Table
18 - HTML
19 - Pie Chart
21 - World Maps
22 - The time
23 - Gallery Widget
24 - Bar Graph
25 - Custom HTML
26 - Multi-bar Graph
For more details, please contact AppInsights.

WidgetTemplateResults

{
  "content": [
    {
      "dataRetrieverTypeId": 50,
      "gridHeight": 4,
      "gridWidth": 5,
      "gridX": 5,
      "gridY": 0,
      "maxHeight": 12,
      "maxWidth": 48,
      "metric": "d8da3b53-69b7-4016-880d-77d4e4fef60b",
      "minHeight": 1,
      "minWidth": 2,
      "params": {},
      "uuid": "126b397e-ab62-42eb-a265-05c5fa0d0d31",
      "widgetTypeId": 14
    }
  ],
  "page": {
    "number": 0,
    "size": 10,
    "totalElements": 1,
    "totalPages": 1
  }
}
Property Type Description
content array of object A list of results for the requested page.
page object Represents meta data information about the results being returned.