Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
{
"info": {
"_postman_id": "e3ad840b-0fe8-42d2-976c-af3cbbb4d083",
"name": "c5 API",
"description": "concrete5's built in API",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"item": [
{
"name": "oauth",
"description": "",
"item": [
{
"name": "Grant: client_credentials",
"description": "",
"item": [
{
"name": "200: Valid oauth client_credentials flow",
"event": [
{
"listen": "test",
"script": {
"id": "67a18066-b4d6-4a80-ad70-59e3d2560e08",
"type": "text/javascript",
"exec": [
"pm.test('Should recieve a \"ok\" response', function() {",
" pm.response.to.be.ok",
"})",
"pm.test('Result should be properly json formatted', function() {",
" pm.response.to.have.jsonBody('access_token')",
" pm.response.to.have.jsonBody('expires_in')",
" ",
" pm.response.to.have.body(/Bearer/)",
" pm.response.to.have.body(/3600/)",
"})",
"",
"pm.environment.set(\"access_token\", pm.response.json().access_token);",
""
]
}
},
{
"listen": "prerequest",
"script": {
"id": "63e6699e-6f0c-4754-9f7e-e3dc34a57294",
"type": "text/javascript",
"exec": [
""
]
}
}
],
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "formdata",
"formdata": [
{
"key": "client_id",
"value": "{{api_key}}",
"description": "",
"type": "text"
},
{
"key": "client_secret",
"value": "{{api_secret}}",
"description": "",
"type": "text"
},
{
"key": "grant_type",
"value": "client_credentials",
"description": "",
"type": "text"
},
{
"key": "scope",
"value": "system",
"description": "",
"type": "text"
}
]
},
"url": {
"raw": "{{base_url}}/oauth/2.0/token",
"host": [
"{{base_url}}"
],
"path": [
"oauth",
"2.0",
"token"
]
},
"description": "Get system information"
},
"response": []
}
],
"_postman_isSubFolder": true
}
],
"auth": {
"type": "noauth"
},
"event": [
{
"listen": "prerequest",
"script": {
"id": "1ec2a6a3-ae3a-4f4c-8e54-1b15c1905ba8",
"type": "text/javascript",
"exec": [
""
]
}
},
{
"listen": "test",
"script": {
"id": "f3530bdd-045f-441f-8cec-750eab566c28",
"type": "text/javascript",
"exec": [
""
]
}
}
]
},
{
"name": "system",
"description": "",
"item": [
{
"name": "/system/info",
"event": [
{
"listen": "test",
"script": {
"id": "37a2943f-5a10-4ce6-85b1-1b3194ba4063",
"type": "text/javascript",
"exec": [
"pm.test('Route should succeed', function() {",
" pm.response.to.be.ok;",
"})",
"pm.test('System info route should contain all the expected stuff', function() {",
" pm.response.to.have.jsonBody('data.version')",
" pm.response.to.have.jsonBody('data.code_version')",
" pm.response.to.have.jsonBody('data.db_version')",
" pm.response.to.have.jsonBody('data.packages')",
" pm.response.to.have.jsonBody('data.overrides')",
" pm.response.to.have.jsonBody('data.cache')",
" pm.response.to.have.jsonBody('data.server')",
" pm.response.to.have.jsonBody('data.server_api')",
" pm.response.to.have.jsonBody('data.php_version')",
" pm.response.to.have.jsonBody('data.php_extensions')",
" pm.response.to.have.jsonBody('data.php_settings')",
"})"
]
}
}
],
"request": {
"method": "GET",
"header": [],
"body": {},
"url": {
"raw": "{{url}}/system/info",
"host": [
"{{url}}"
],
"path": [
"system",
"info"
]
},
"description": "Get system information"
},
"response": []
},
{
"name": "/site/trees",
"event": [
{
"listen": "test",
"script": {
"id": "8b401017-66cc-4674-8d16-94f14b8fb16c",
"type": "text/javascript",
"exec": [
"pm.test('Route should succeed', function() {",
" pm.response.to.be.ok;",
"})",
"pm.test('Route should contain at least one site tree', function() {",
" pm.response.to.have.jsonBody('data.0.id')",
" pm.response.to.have.jsonBody('data.0.name')",
" pm.response.to.have.jsonBody('data.0.icon')",
"})"
]
}
}
],
"request": {
"method": "GET",
"header": [],
"body": {},
"url": {
"raw": "{{url}}/site/trees",
"host": [
"{{url}}"
],
"path": [
"site",
"trees"
]
},
"description": "List site trees"
},
"response": []
},
{
"name": "/system/status/queue",
"event": [
{
"listen": "test",
"script": {
"id": "0e8aa600-00c5-4505-bd90-87b137ac09f2",
"type": "text/javascript",
"exec": [
"pm.test('Route should succeed', function() {",
" pm.response.to.be.ok;",
"})",
"pm.test('Route should contain some data', function() {",
" pm.response.to.have.jsonBody('data.queues')",
"})"
]
}
}
],
"request": {
"method": "GET",
"header": [],
"body": {},
"url": {
"raw": "{{url}}/system/status/queue",
"host": [
"{{url}}"
],
"path": [
"system",
"status",
"queue"
]
},
"description": "Get system information"
},
"response": []
}
],
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{access_token}}",
"type": "string"
}
]
},
"event": [
{
"listen": "prerequest",
"script": {
"id": "cc9b8032-a3d8-464b-ae35-10ffa0e49a85",
"type": "text/javascript",
"exec": [
""
]
}
},
{
"listen": "test",
"script": {
"id": "5c722abd-8823-4f3f-a291-8ba7b83ab845",
"type": "text/javascript",
"exec": [
""
]
}
}
]
}
],
"event": [
{
"listen": "prerequest",
"script": {
"id": "2e2a8b37-8c83-47d0-ae9f-e5f63484c299",
"type": "text/javascript",
"exec": [
""
]
}
},
{
"listen": "test",
"script": {
"id": "89649328-a603-4c66-bcd2-79b72791e961",
"type": "text/javascript",
"exec": [
""
]
}
}
],
"variable": [
{
"id": "b8c20515-a022-4d69-8a89-52d878f8c88a",
"key": "api_key",
"value": "",
"type": "string",
"description": ""
},
{
"id": "2228ca6b-4cde-4027-ab05-0181f82f4f12",
"key": "api_secret",
"value": "",
"type": "string",
"description": ""
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.