Skip to content

Instantly share code, notes, and snippets.

@kundzi
Created September 5, 2019 15:56
Show Gist options
  • Select an option

  • Save kundzi/20cf330ad8d952a4ebd8a03e7864a45d to your computer and use it in GitHub Desktop.

Select an option

Save kundzi/20cf330ad8d952a4ebd8a03e7864a45d to your computer and use it in GitHub Desktop.
{
"info": {
"_postman_id": "78a06991-03ee-4e6d-a10c-30ca05298a6f",
"name": "sana_learn_content_registry",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"item": [
{
"name": "Create / Update an Asset",
"event": [
{
"listen": "prerequest",
"script": {
"id": "4d1487d7-042d-49f7-9bab-091b3c208162",
"exec": [
""
],
"type": "text/javascript"
}
},
{
"listen": "test",
"script": {
"id": "3b93faec-68cf-4248-90a2-8b8f255a72da",
"exec": [
"pm.test(\"Status code is 200\", function () {",
" pm.response.to.have.status(200);",
"});"
],
"type": "text/javascript"
}
}
],
"request": {
"auth": {
"type": "apikey",
"apikey": [
{
"key": "value",
"value": "{{adminApiKey}}",
"type": "string"
},
{
"key": "key",
"value": "X-API-KEY",
"type": "string"
}
]
},
"method": "PUT",
"header": [
{
"key": "Content-Type",
"name": "Content-Type",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"type\": \"theory\",\n \"tags\": [\n {\n \"name\": \"tn21\",\n \"value\": \"tv21\"\n },\n {\n \"name\": \"tn22\",\n \"value\": \"tv22\"\n }\n ],\n \"metadata\": {\n \t\"ak20\": \"av20\",\n \"ak21\": \"av21\",\n \"ak22\": \"av22\"\n },\n \"description\": \"some good content\",\n \"content_url\": \"https://api.sanalabs.com/v1/assets/asset_2\"\t\n}"
},
"url": {
"raw": "{{baseUrl}}/v1/assets/:asset_id",
"host": [
"{{baseUrl}}"
],
"path": [
"v1",
"assets",
":asset_id"
],
"variable": [
{
"key": "asset_id",
"value": "asset_2"
}
]
}
},
"response": []
},
{
"name": "Bulk Create / Update Assets",
"event": [
{
"listen": "prerequest",
"script": {
"id": "4d1487d7-042d-49f7-9bab-091b3c208162",
"exec": [
""
],
"type": "text/javascript"
}
},
{
"listen": "test",
"script": {
"id": "3b93faec-68cf-4248-90a2-8b8f255a72da",
"exec": [
"pm.test(\"Status code is 200\", function () {",
" pm.response.to.have.status(200);",
"});"
],
"type": "text/javascript"
}
}
],
"request": {
"auth": {
"type": "apikey",
"apikey": [
{
"key": "value",
"value": "{{adminApiKey}}",
"type": "string"
},
{
"key": "key",
"value": "X-API-KEY",
"type": "string"
}
]
},
"method": "PUT",
"header": [
{
"key": "Content-Type",
"name": "Content-Type",
"type": "text",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"assets\": [\n {\n \t\"id\" : \"asset_id_0\",\n \"type\": \"theory\",\n \"tags\": [\n {\n \"name\": \"tn21\",\n \"value\": \"tv21\"\n },\n {\n \"name\": \"tn22\",\n \"value\": \"tv22\"\n }\n ],\n \"metadata\": {\n \"ak20\": \"av20\",\n \"ak21\": \"av21\",\n \"ak22\": \"av22\"\n },\n \"description\": \"some good content\",\n \"content_url\": \"https://api.sanalabs.com/v1/assets/asset_2\"\n },\n {\n \"id\": \"asset_id_1\",\n \"type\": \"exercise\",\n \"tags\": [],\n \"attributes\": {\n \"ak11\": \"av11\"\n }\n },\n {\n \"id\": \"asset_id_2\",\n \"type\": \"theory\",\n \"tags\": [\n {\n \"name\": \"tn21\",\n \"value\": \"tv21\"\n },\n {\n \"name\": \"tn22\",\n \"value\": \"tv22\"\n }\n ],\n \"attributes\": {\n \"ak21\": \"av21\",\n \"ak22\": \"av22\"\n }\n }\n ]\n}"
},
"url": {
"raw": "{{baseUrl}}/v1/assets",
"host": [
"{{baseUrl}}"
],
"path": [
"v1",
"assets"
]
}
},
"response": []
},
{
"name": "Bulk Delete",
"event": [
{
"listen": "prerequest",
"script": {
"id": "4d1487d7-042d-49f7-9bab-091b3c208162",
"exec": [
""
],
"type": "text/javascript"
}
},
{
"listen": "test",
"script": {
"id": "3b93faec-68cf-4248-90a2-8b8f255a72da",
"exec": [
"pm.test(\"Status code is 200\", function () {",
" pm.response.to.have.status(200);",
"});"
],
"type": "text/javascript"
}
}
],
"request": {
"auth": {
"type": "apikey",
"apikey": [
{
"key": "value",
"value": "{{adminApiKey}}",
"type": "string"
},
{
"key": "key",
"value": "X-API-KEY",
"type": "string"
}
]
},
"method": "PUT",
"header": [
{
"key": "Content-Type",
"name": "Content-Type",
"type": "text",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"assets\": [\n {\n \t\"id\" : \"asset_id_0\",\n \"type\": \"theory\",\n \"tags\": [\n {\n \"name\": \"tn21\",\n \"value\": \"tv21\"\n },\n {\n \"name\": \"tn22\",\n \"value\": \"tv22\"\n }\n ],\n \"metadata\": {\n \"ak20\": \"av20\",\n \"ak21\": \"av21\",\n \"ak22\": \"av22\"\n },\n \"description\": \"some good content\",\n \"content_url\": \"https://api.sanalabs.com/v1/assets/asset_2\"\n },\n {\n \"id\": \"asset_id_1\",\n \"type\": \"exercise\",\n \"tags\": [],\n \"attributes\": {\n \"ak11\": \"av11\"\n }\n },\n {\n \"id\": \"asset_id_2\",\n \"type\": \"theory\",\n \"tags\": [\n {\n \"name\": \"tn21\",\n \"value\": \"tv21\"\n },\n {\n \"name\": \"tn22\",\n \"value\": \"tv22\"\n }\n ],\n \"attributes\": {\n \"ak21\": \"av21\",\n \"ak22\": \"av22\"\n }\n }\n ]\n}"
},
"url": {
"raw": "{{baseUrl}}/v1/assets",
"host": [
"{{baseUrl}}"
],
"path": [
"v1",
"assets"
]
}
},
"response": []
},
{
"name": "Get Multiple Assets",
"event": [
{
"listen": "prerequest",
"script": {
"id": "4d1487d7-042d-49f7-9bab-091b3c208162",
"exec": [
""
],
"type": "text/javascript"
}
},
{
"listen": "test",
"script": {
"id": "3b93faec-68cf-4248-90a2-8b8f255a72da",
"exec": [
"pm.test(\"Status code is 200\", function () {",
" pm.response.to.have.status(200);",
"});"
],
"type": "text/javascript"
}
}
],
"protocolProfileBehavior": {
"disableBodyPruning": true
},
"request": {
"auth": {
"type": "apikey",
"apikey": [
{
"key": "value",
"value": "{{adminApiKey}}",
"type": "string"
},
{
"key": "key",
"value": "X-API-KEY",
"type": "string"
}
]
},
"method": "GET",
"header": [
{
"key": "Content-Type",
"name": "Content-Type",
"type": "text",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": ""
},
"url": {
"raw": "{{baseUrl}}/v1/assets?asset_ids=asset_id_1,asset_id_2,asset_2",
"host": [
"{{baseUrl}}"
],
"path": [
"v1",
"assets"
],
"query": [
{
"key": "asset_ids",
"value": "asset_id_1,asset_id_2,asset_2"
}
]
}
},
"response": []
},
{
"name": "Get an Asset",
"event": [
{
"listen": "prerequest",
"script": {
"id": "4d1487d7-042d-49f7-9bab-091b3c208162",
"exec": [
""
],
"type": "text/javascript"
}
},
{
"listen": "test",
"script": {
"id": "3b93faec-68cf-4248-90a2-8b8f255a72da",
"exec": [
"pm.test(\"Status code is 200\", function () {",
" pm.response.to.have.status(200);",
"});"
],
"type": "text/javascript"
}
}
],
"request": {
"auth": {
"type": "apikey",
"apikey": [
{
"key": "value",
"value": "{{adminApiKey}}",
"type": "string"
},
{
"key": "key",
"value": "X-API-KEY",
"type": "string"
}
]
},
"method": "PUT",
"header": [
{
"key": "Content-Type",
"name": "Content-Type",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"type\": \"theory\",\n \"tags\": [\n {\n \"name\": \"tn21\",\n \"value\": \"tv21\"\n },\n {\n \"name\": \"tn22\",\n \"value\": \"tv22\"\n }\n ],\n \"attributes\": {\n \"ak21\": \"av21\",\n \"ak22\": \"av22\"\n }\n}"
},
"url": {
"raw": "{{baseUrl}}/v1/assets/:asset_id",
"host": [
"{{baseUrl}}"
],
"path": [
"v1",
"assets",
":asset_id"
],
"variable": [
{
"key": "asset_id",
"value": "asset_2"
}
]
}
},
"response": []
},
{
"name": "Delete an Asset",
"event": [
{
"listen": "prerequest",
"script": {
"id": "4d1487d7-042d-49f7-9bab-091b3c208162",
"exec": [
""
],
"type": "text/javascript"
}
},
{
"listen": "test",
"script": {
"id": "3b93faec-68cf-4248-90a2-8b8f255a72da",
"exec": [
"pm.test(\"Status code is 200\", function () {",
" pm.response.to.have.status(200);",
"});"
],
"type": "text/javascript"
}
}
],
"request": {
"auth": {
"type": "apikey",
"apikey": [
{
"key": "value",
"value": "{{adminApiKey}}",
"type": "string"
},
{
"key": "key",
"value": "X-API-KEY",
"type": "string"
}
]
},
"method": "PUT",
"header": [
{
"key": "Content-Type",
"name": "Content-Type",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"type\": \"theory\",\n \"tags\": [\n {\n \"name\": \"tn21\",\n \"value\": \"tv21\"\n },\n {\n \"name\": \"tn22\",\n \"value\": \"tv22\"\n }\n ],\n \"attributes\": {\n \"ak21\": \"av21\",\n \"ak22\": \"av22\"\n }\n}"
},
"url": {
"raw": "{{baseUrl}}/v1/assets/:asset_id",
"host": [
"{{baseUrl}}"
],
"path": [
"v1",
"assets",
":asset_id"
],
"variable": [
{
"key": "asset_id",
"value": "asset_2"
}
]
}
},
"response": []
},
{
"name": "Delete a View",
"event": [
{
"listen": "prerequest",
"script": {
"id": "4d1487d7-042d-49f7-9bab-091b3c208162",
"exec": [
""
],
"type": "text/javascript"
}
},
{
"listen": "test",
"script": {
"id": "3b93faec-68cf-4248-90a2-8b8f255a72da",
"exec": [
"pm.test(\"Status code is 200\", function () {",
" pm.response.to.have.status(200);",
"});"
],
"type": "text/javascript"
}
}
],
"request": {
"auth": {
"type": "apikey",
"apikey": [
{
"key": "value",
"value": "{{adminApiKey}}",
"type": "string"
},
{
"key": "key",
"value": "X-API-KEY",
"type": "string"
}
]
},
"method": "PUT",
"header": [
{
"key": "Content-Type",
"name": "Content-Type",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"type\": \"theory\",\n \"tags\": [\n {\n \"name\": \"tn21\",\n \"value\": \"tv21\"\n },\n {\n \"name\": \"tn22\",\n \"value\": \"tv22\"\n }\n ],\n \"attributes\": {\n \"ak21\": \"av21\",\n \"ak22\": \"av22\"\n }\n}"
},
"url": {
"raw": "{{baseUrl}}/v1/assets/:asset_id",
"host": [
"{{baseUrl}}"
],
"path": [
"v1",
"assets",
":asset_id"
],
"variable": [
{
"key": "asset_id",
"value": "asset_2"
}
]
}
},
"response": []
},
{
"name": "Get a View",
"event": [
{
"listen": "prerequest",
"script": {
"id": "4d1487d7-042d-49f7-9bab-091b3c208162",
"exec": [
""
],
"type": "text/javascript"
}
},
{
"listen": "test",
"script": {
"id": "3b93faec-68cf-4248-90a2-8b8f255a72da",
"exec": [
"pm.test(\"Status code is 200\", function () {",
" pm.response.to.have.status(200);",
"});"
],
"type": "text/javascript"
}
}
],
"request": {
"auth": {
"type": "apikey",
"apikey": [
{
"key": "value",
"value": "{{adminApiKey}}",
"type": "string"
},
{
"key": "key",
"value": "X-API-KEY",
"type": "string"
}
]
},
"method": "GET",
"header": [
{
"key": "Content-Type",
"name": "Content-Type",
"value": "application/json",
"type": "text"
}
],
"url": {
"raw": "{{baseUrl}}/v1/views/:view_id",
"host": [
"{{baseUrl}}"
],
"path": [
"v1",
"views",
":view_id"
],
"variable": [
{
"key": "view_id",
"value": "view_id_1"
}
]
}
},
"response": []
},
{
"name": "Get all Views",
"event": [
{
"listen": "prerequest",
"script": {
"id": "4d1487d7-042d-49f7-9bab-091b3c208162",
"exec": [
""
],
"type": "text/javascript"
}
},
{
"listen": "test",
"script": {
"id": "3b93faec-68cf-4248-90a2-8b8f255a72da",
"exec": [
"pm.test(\"Status code is 200\", function () {",
" pm.response.to.have.status(200);",
"});"
],
"type": "text/javascript"
}
}
],
"request": {
"auth": {
"type": "apikey",
"apikey": [
{
"key": "value",
"value": "{{adminApiKey}}",
"type": "string"
},
{
"key": "key",
"value": "X-API-KEY",
"type": "string"
}
]
},
"method": "GET",
"header": [
{
"key": "Content-Type",
"name": "Content-Type",
"type": "text",
"value": "application/json"
}
],
"url": {
"raw": "{{baseUrl}}/v1/views?last_view_id=&limit=10",
"host": [
"{{baseUrl}}"
],
"path": [
"v1",
"views"
],
"query": [
{
"key": "last_view_id",
"value": ""
},
{
"key": "limit",
"value": "10"
}
]
}
},
"response": []
},
{
"name": "Create / Update a View",
"event": [
{
"listen": "prerequest",
"script": {
"id": "4d1487d7-042d-49f7-9bab-091b3c208162",
"exec": [
""
],
"type": "text/javascript"
}
},
{
"listen": "test",
"script": {
"id": "3b93faec-68cf-4248-90a2-8b8f255a72da",
"exec": [
"pm.test(\"Status code is 200\", function () {",
" pm.response.to.have.status(200);",
"});"
],
"type": "text/javascript"
}
}
],
"request": {
"auth": {
"type": "apikey",
"apikey": [
{
"key": "value",
"value": "{{adminApiKey}}",
"type": "string"
},
{
"key": "key",
"value": "X-API-KEY",
"type": "string"
}
]
},
"method": "PUT",
"header": [
{
"key": "Content-Type",
"name": "Content-Type",
"type": "text",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"name\": \"awesome view\",\n \"description\": \"awesome desc\",\n \"path\": \"/math\",\n \"ordered\": true,\n \"assets\": [\n {\n \"asset_id\": \"asset_id_1\",\n \"view_path\": \"/math/path1\"\n },\n {\n \"asset_id\": \"asset_id_2\",\n \"view_path\": \"/math/path1\"\n }\n ]\n}"
},
"url": {
"raw": "{{baseUrl}}/v1/views/:view_id",
"host": [
"{{baseUrl}}"
],
"path": [
"v1",
"views",
":view_id"
],
"variable": [
{
"key": "view_id",
"value": "view_id_1"
}
]
}
},
"response": []
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment