Created
February 20, 2020 14:46
-
-
Save simonhearne/0866192eea8a9c38dae869c4592e794f to your computer and use it in GitHub Desktop.
A Postman collection for interacting with mPulse APIs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"info": { | |
"_postman_id": "7eaf462d-6713-446d-9872-0c5ecef206d8", | |
"name": "mPulse", | |
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" | |
}, | |
"item": [ | |
{ | |
"name": "Annotations", | |
"item": [ | |
{ | |
"name": "Create Annotation", | |
"event": [ | |
{ | |
"listen": "test", | |
"script": { | |
"id": "7a9e4b74-434c-4406-9c73-f3328567d6ad", | |
"exec": [ | |
"var jsonData = pm.response.json();", | |
"var annotationID = jsonData.id;", | |
"pm.globals.set(\"annotationID\", annotationID);" | |
], | |
"type": "text/javascript" | |
} | |
} | |
], | |
"request": { | |
"method": "POST", | |
"header": [ | |
{ | |
"key": "Content-Type", | |
"name": "Content-Type", | |
"value": "application/json", | |
"type": "text" | |
} | |
], | |
"body": { | |
"mode": "raw", | |
"raw": " {\n \"title\":\"Annotation API Test\",\n \"start\":{{$timestamp}}000,\n \"text\":\"This was created using the API\",\n \"domainIds\":[{{domain}}]\n}", | |
"options": { | |
"raw": { | |
"language": "json" | |
} | |
} | |
}, | |
"url": { | |
"raw": "https://mpulse.soasta.com/concerto/mpulse/api/annotations/v1", | |
"protocol": "https", | |
"host": [ | |
"mpulse", | |
"soasta", | |
"com" | |
], | |
"path": [ | |
"concerto", | |
"mpulse", | |
"api", | |
"annotations", | |
"v1" | |
] | |
} | |
}, | |
"response": [] | |
}, | |
{ | |
"name": "Get Annotations", | |
"request": { | |
"method": "GET", | |
"header": [], | |
"url": { | |
"raw": "https://mpulse.soasta.com/concerto/mpulse/api/annotations/v1?domain={{domain}}", | |
"protocol": "https", | |
"host": [ | |
"mpulse", | |
"soasta", | |
"com" | |
], | |
"path": [ | |
"concerto", | |
"mpulse", | |
"api", | |
"annotations", | |
"v1" | |
], | |
"query": [ | |
{ | |
"key": "domain", | |
"value": "{{domain}}" | |
} | |
] | |
} | |
}, | |
"response": [] | |
}, | |
{ | |
"name": "Edit Annotation", | |
"request": { | |
"method": "PUT", | |
"header": [ | |
{ | |
"key": "Content-Type", | |
"name": "Content-Type", | |
"value": "application/json", | |
"type": "text" | |
} | |
], | |
"body": { | |
"mode": "raw", | |
"raw": "{\n \"end\":{{$timestamp}},\n \"text\":\"Annotation was updated via the API\"\n}", | |
"options": { | |
"raw": { | |
"language": "json" | |
} | |
} | |
}, | |
"url": { | |
"raw": "https://mpulse.soasta.com/concerto/mpulse/api/annotations/v1/{{annotationID}}", | |
"protocol": "https", | |
"host": [ | |
"mpulse", | |
"soasta", | |
"com" | |
], | |
"path": [ | |
"concerto", | |
"mpulse", | |
"api", | |
"annotations", | |
"v1", | |
"{{annotationID}}" | |
] | |
} | |
}, | |
"response": [] | |
}, | |
{ | |
"name": "Delete Annotation", | |
"event": [ | |
{ | |
"listen": "test", | |
"script": { | |
"id": "a717207c-0edc-43fb-8e5b-9cfedd80e6f7", | |
"exec": [ | |
"pm.test(\"Status code is 204\", function () {", | |
" pm.response.to.have.status(204);", | |
"});" | |
], | |
"type": "text/javascript" | |
} | |
} | |
], | |
"request": { | |
"method": "DELETE", | |
"header": [], | |
"url": { | |
"raw": "https://mpulse.soasta.com/concerto/mpulse/api/annotations/v1/{{annotationID}}", | |
"protocol": "https", | |
"host": [ | |
"mpulse", | |
"soasta", | |
"com" | |
], | |
"path": [ | |
"concerto", | |
"mpulse", | |
"api", | |
"annotations", | |
"v1", | |
"{{annotationID}}" | |
] | |
} | |
}, | |
"response": [] | |
} | |
], | |
"event": [ | |
{ | |
"listen": "prerequest", | |
"script": { | |
"id": "e09550f6-72cc-41d6-b7e6-4e2d80795780", | |
"type": "text/javascript", | |
"exec": [ | |
"pm.request.headers.upsert({key: 'X-Auth-Token', value: '{{token}}' })" | |
] | |
} | |
}, | |
{ | |
"listen": "test", | |
"script": { | |
"id": "3b183aa1-d480-42d3-ba2a-37da7d023023", | |
"type": "text/javascript", | |
"exec": [ | |
"" | |
] | |
} | |
} | |
], | |
"protocolProfileBehavior": {} | |
}, | |
{ | |
"name": "Query API", | |
"item": [ | |
{ | |
"name": "Summary Stats", | |
"request": { | |
"auth": { | |
"type": "apikey", | |
"apikey": [ | |
{ | |
"key": "key", | |
"value": "", | |
"type": "string" | |
} | |
] | |
}, | |
"method": "GET", | |
"header": [], | |
"url": { | |
"raw": "https://mpulse.soasta.com/concerto/mpulse/api/v2/{{apiKey}}/summary?date-comparator=Last24Hours&timer=FirstPaint", | |
"protocol": "https", | |
"host": [ | |
"mpulse", | |
"soasta", | |
"com" | |
], | |
"path": [ | |
"concerto", | |
"mpulse", | |
"api", | |
"v2", | |
"{{apiKey}}", | |
"summary" | |
], | |
"query": [ | |
{ | |
"key": "date-comparator", | |
"value": "Last24Hours" | |
}, | |
{ | |
"key": "timer", | |
"value": "FirstPaint" | |
} | |
] | |
} | |
}, | |
"response": [] | |
}, | |
{ | |
"name": "Metrics by Dimension", | |
"request": { | |
"auth": { | |
"type": "apikey", | |
"apikey": [ | |
{ | |
"key": "key", | |
"value": "", | |
"type": "string" | |
} | |
] | |
}, | |
"method": "GET", | |
"header": [], | |
"url": { | |
"raw": "https://mpulse.soasta.com/concerto/mpulse/api/v2/{{apiKey}}/metrics-by-dimension?date-comparator=Last24Hours&dimension=page_group", | |
"protocol": "https", | |
"host": [ | |
"mpulse", | |
"soasta", | |
"com" | |
], | |
"path": [ | |
"concerto", | |
"mpulse", | |
"api", | |
"v2", | |
"{{apiKey}}", | |
"metrics-by-dimension" | |
], | |
"query": [ | |
{ | |
"key": "date-comparator", | |
"value": "Last24Hours" | |
}, | |
{ | |
"key": "dimension", | |
"value": "page_group" | |
} | |
] | |
} | |
}, | |
"response": [] | |
}, | |
{ | |
"name": "App Errors", | |
"request": { | |
"auth": { | |
"type": "apikey", | |
"apikey": [ | |
{ | |
"key": "key", | |
"value": "", | |
"type": "string" | |
} | |
] | |
}, | |
"method": "GET", | |
"header": [], | |
"url": { | |
"raw": "https://mpulse.soasta.com/concerto/mpulse/api/v2/{{apiKey}}/metrics-by-dimension?date-comparator=Last24Hours&dimension=page_group", | |
"protocol": "https", | |
"host": [ | |
"mpulse", | |
"soasta", | |
"com" | |
], | |
"path": [ | |
"concerto", | |
"mpulse", | |
"api", | |
"v2", | |
"{{apiKey}}", | |
"metrics-by-dimension" | |
], | |
"query": [ | |
{ | |
"key": "date-comparator", | |
"value": "Last24Hours" | |
}, | |
{ | |
"key": "dimension", | |
"value": "page_group" | |
} | |
] | |
} | |
}, | |
"response": [] | |
}, | |
{ | |
"name": "Timeseries", | |
"request": { | |
"auth": { | |
"type": "apikey", | |
"apikey": [ | |
{ | |
"key": "key", | |
"value": "", | |
"type": "string" | |
} | |
] | |
}, | |
"method": "GET", | |
"header": [], | |
"url": { | |
"raw": "https://mpulse.soasta.com/concerto/mpulse/api/v2/{{apiKey}}/metrics-by-dimension?date-comparator=Last24Hours&dimension=page_group", | |
"protocol": "https", | |
"host": [ | |
"mpulse", | |
"soasta", | |
"com" | |
], | |
"path": [ | |
"concerto", | |
"mpulse", | |
"api", | |
"v2", | |
"{{apiKey}}", | |
"metrics-by-dimension" | |
], | |
"query": [ | |
{ | |
"key": "date-comparator", | |
"value": "Last24Hours" | |
}, | |
{ | |
"key": "dimension", | |
"value": "page_group" | |
} | |
] | |
} | |
}, | |
"response": [] | |
} | |
], | |
"protocolProfileBehavior": {} | |
}, | |
{ | |
"name": "Alerts", | |
"item": [ | |
{ | |
"name": "Trigger Alert", | |
"request": { | |
"method": "GET", | |
"header": [], | |
"url": { | |
"raw": "" | |
} | |
}, | |
"response": [] | |
}, | |
{ | |
"name": "Clear Alert", | |
"request": { | |
"method": "GET", | |
"header": [], | |
"url": { | |
"raw": "" | |
} | |
}, | |
"response": [] | |
} | |
], | |
"protocolProfileBehavior": {} | |
}, | |
{ | |
"name": "Authenticate", | |
"event": [ | |
{ | |
"listen": "test", | |
"script": { | |
"id": "7adb0130-e5b7-49e1-b385-622ea38cb61e", | |
"exec": [ | |
"var jsonData = pm.response.json();", | |
"var token = jsonData.token;", | |
"pm.globals.set(\"token\", token);" | |
], | |
"type": "text/javascript" | |
} | |
} | |
], | |
"request": { | |
"method": "PUT", | |
"header": [ | |
{ | |
"key": "Content-Type", | |
"name": "Content-Type", | |
"value": "application/json", | |
"type": "text" | |
} | |
], | |
"body": { | |
"mode": "raw", | |
"raw": "{\"apiToken\":\"{{apiToken}}\", \"tenant\": \"{{tenantName}}\"}", | |
"options": { | |
"raw": { | |
"language": "json" | |
} | |
} | |
}, | |
"url": { | |
"raw": "https://mpulse.soasta.com/concerto/services/rest/RepositoryService/v1/Tokens", | |
"protocol": "https", | |
"host": [ | |
"mpulse", | |
"soasta", | |
"com" | |
], | |
"path": [ | |
"concerto", | |
"services", | |
"rest", | |
"RepositoryService", | |
"v1", | |
"Tokens" | |
] | |
} | |
}, | |
"response": [] | |
} | |
], | |
"event": [ | |
{ | |
"listen": "prerequest", | |
"script": { | |
"id": "590ff0e9-59e4-4e29-8eff-462ec9315a9c", | |
"type": "text/javascript", | |
"exec": [ | |
"pm.request.headers.upsert({key: 'Authentication', value: '{{token}}' })" | |
] | |
} | |
}, | |
{ | |
"listen": "test", | |
"script": { | |
"id": "26cb3f1a-78bc-404e-96ca-9e5b7e285f39", | |
"type": "text/javascript", | |
"exec": [ | |
"" | |
] | |
} | |
} | |
], | |
"variable": [ | |
{ | |
"id": "9e86f5df-ed08-4d61-81f9-18de50504dd1", | |
"key": "apiToken", | |
"value": "", | |
"type": "string" | |
}, | |
{ | |
"id": "63df40d7-ddfc-4679-85f5-65a2044a50d1", | |
"key": "domain", | |
"value": "", | |
"type": "string" | |
}, | |
{ | |
"id": "3e16549b-99e4-48fc-a7c0-a4c3cdcc8ada", | |
"key": "tenant", | |
"value": "", | |
"type": "string" | |
}, | |
{ | |
"id": "7c6df71f-1ef5-42e8-975d-de190fff51d0", | |
"key": "apiKey", | |
"value": "", | |
"type": "string" | |
}, | |
{ | |
"id": "007f8a3c-b471-475e-99d2-4720af55e9da", | |
"key": "tenantName", | |
"value": "", | |
"type": "string" | |
}, | |
{ | |
"id": "e590a47a-c39b-406d-a45a-536022865d4e", | |
"key": "alertID", | |
"value": "", | |
"type": "string" | |
} | |
], | |
"protocolProfileBehavior": {} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment