Postman calls to test stuff

This commit is contained in:
UKDTOM 2020-05-24 19:56:42 +02:00
parent 37265fe0cc
commit a76a4edfcd
4 changed files with 418 additions and 0 deletions

View file

@ -0,0 +1,175 @@
{
"info": {
"_postman_id": "200deb21-86cb-4933-8438-d935b1fa48f4",
"name": "POEditor",
"description": "In this collection, we access the POEditor API\n\nWe use a ReadOnly Token for that, as well as an ID for our translation project",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"item": [
{
"name": "Get-Languages",
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "formdata",
"formdata": [
{
"key": "id",
"value": "{{id}}",
"type": "text"
},
{
"key": "api_token",
"value": "{{api-token}}",
"type": "text"
}
]
},
"url": {
"raw": "https://api.poeditor.com/v2/languages/list",
"protocol": "https",
"host": [
"api",
"poeditor",
"com"
],
"path": [
"v2",
"languages",
"list"
]
},
"description": "Get a list of languages avail on the POEditor.com site"
},
"response": []
},
{
"name": "Get-Translators",
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "formdata",
"formdata": [
{
"key": "api_token",
"value": "{{api-token}}",
"type": "text"
},
{
"key": "id",
"value": "{{id}}",
"type": "text"
}
]
},
"url": {
"raw": "https://api.poeditor.com/v2/contributors/list",
"protocol": "https",
"host": [
"api",
"poeditor",
"com"
],
"path": [
"v2",
"contributors",
"list"
]
},
"description": "Get a list of translators, and what they translated"
},
"response": []
},
{
"name": "GetTanslationLink",
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "formdata",
"formdata": [
{
"key": "id",
"value": "{{id}}",
"description": "id of project. Defined at folder level",
"type": "text"
},
{
"key": "api_token",
"value": "{{api-token}}",
"description": "api token. Defined at folder level",
"type": "text"
},
{
"key": "language",
"value": "da",
"description": "language",
"type": "text"
},
{
"key": "type",
"value": "key_value_json",
"description": "format of file to download",
"type": "text"
}
]
},
"url": {
"raw": "https://api.poeditor.com/v2/projects/export",
"protocol": "https",
"host": [
"api",
"poeditor",
"com"
],
"path": [
"v2",
"projects",
"export"
]
},
"description": "Retrieves a download link for a translated language"
},
"response": []
}
],
"event": [
{
"listen": "prerequest",
"script": {
"id": "c5196d1d-7a09-4e04-b536-96d299778cca",
"type": "text/javascript",
"exec": [
""
]
}
},
{
"listen": "test",
"script": {
"id": "bda2c131-bb1a-467b-8074-18be164c1138",
"type": "text/javascript",
"exec": [
""
]
}
}
],
"variable": [
{
"id": "c579020f-38a0-4f03-b6a9-5a621ebb0b57",
"key": "id",
"value": "342617",
"type": "string"
},
{
"id": "358c824e-cc8d-49e9-9925-e01a4ddcb649",
"key": "api-token",
"value": "5166c4294ff7fb3a82cbdc82958e850e",
"type": "string"
}
],
"protocolProfileBehavior": {}
}

View file

@ -0,0 +1,34 @@
{
"id": "8a252d90-179f-44a8-9187-1c3f7b61c533",
"name": "WebTools-NG",
"values": [
{
"key": "AccessToken",
"value": "",
"enabled": true
},
{
"key": "PMSAddress",
"value": "http://127.0.0.1:32400",
"enabled": true
},
{
"key": "X-Plex-Token",
"value": "",
"enabled": true
},
{
"key": "Pwd-PlexTV",
"value": "",
"enabled": true
},
{
"key": "Usr-PlexTV",
"value": "dane22",
"enabled": true
}
],
"_postman_variable_scope": "environment",
"_postman_exported_at": "2020-05-22T12:35:23.944Z",
"_postman_exported_using": "Postman/7.25.0"
}

View file

@ -0,0 +1,137 @@
{
"info": {
"_postman_id": "52332b53-b724-431c-b1f4-82b9757ebac0",
"name": "plex.tv",
"description": "Calls agains plex.tv api site\n\nReq. a local defined environtment named plex with the following entries\n\nX-Plex-Token: leave empty, since will be populated after a login\nUser: plex.tv user\nPwd: plex.tv users password\n\n\nWe also has variables defined at this folder level",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"item": [
{
"name": "Login",
"event": [
{
"listen": "test",
"script": {
"id": "06dac4ba-3dd6-477e-978c-9bf94955e33a",
"exec": [
"var data = JSON.parse(responseBody);",
"postman.setEnvironmentVariable(\"X-Plex-Token\", data.authToken)",
"console.log(\"AuthToken-PlexTV:\", postman.getEnvironmentVariable(\"X-Plex-Token\"))"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [
{
"key": "X-Plex-Client-Identifier",
"value": "{{X-Plex-Client-Identifier}}",
"type": "text"
},
{
"key": "Accept",
"value": "application/json",
"type": "text"
}
],
"url": {
"raw": "{{plextvapi}}/v2/users/signin?login={{Usr-PlexTV}}&password={{Pwd-PlexTV}}",
"host": [
"{{plextvapi}}"
],
"path": [
"v2",
"users",
"signin"
],
"query": [
{
"key": "login",
"value": "{{Usr-PlexTV}}"
},
{
"key": "password",
"value": "{{Pwd-PlexTV}}"
}
]
},
"description": "Use two defined local environtment variables named:\nUser\nPwd\n\nAbove are credentials for plex.tv\n\nA third variable named X-Plex-Token, that after a login will be populated with a token, other calls can use"
},
"response": []
},
{
"name": "Get-Resources",
"request": {
"method": "GET",
"header": [
{
"key": "X-Plex-Token",
"value": "{{X-Plex-Token}}",
"type": "text"
},
{
"key": "X-Plex-Client-Identifier",
"value": "{{X-Plex-Client-Identifier}}",
"type": "text"
},
{
"key": "Accept",
"value": "application/json",
"type": "text"
}
],
"url": {
"raw": "{{plextvapi}}/v2/resources",
"host": [
"{{plextvapi}}"
],
"path": [
"v2",
"resources"
]
},
"description": "Get Resources avail for the current plex.tv user"
},
"response": []
}
],
"event": [
{
"listen": "prerequest",
"script": {
"id": "0355f113-7ed5-4483-ac99-01f8665a8df5",
"type": "text/javascript",
"exec": [
""
]
}
},
{
"listen": "test",
"script": {
"id": "3d4cf58b-80b8-415e-b376-16a44cfbbd0d",
"type": "text/javascript",
"exec": [
""
]
}
}
],
"variable": [
{
"id": "12749f23-3086-47bd-a268-6e1dfa5bc5c5",
"key": "plextvapi",
"value": "https://plex.tv/api",
"type": "string"
},
{
"id": "ee6d38c1-4cd1-4fec-9d63-abab0174e473",
"key": "X-Plex-Client-Identifier",
"value": "WebTools-NG",
"type": "string"
}
],
"protocolProfileBehavior": {}
}

View file

@ -0,0 +1,72 @@
{
"info": {
"_postman_id": "daa2f31c-1db6-410b-a2ad-c8f4acc01d33",
"name": "pms",
"description": "In the PMS collection, we store calls against a local PMS\n\nIt req. some local variables, named PMSAddress and AccessToken",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"item": [
{
"name": "Get-Sections",
"request": {
"method": "GET",
"header": [
{
"key": "Accept",
"value": "application/json",
"type": "text"
},
{
"key": "X-Plex-Token",
"value": "{{AccessToken}}",
"type": "text"
}
],
"url": {
"raw": "{{PMSAddress}}/library/sections/all",
"host": [
"{{PMSAddress}}"
],
"path": [
"library",
"sections",
"all"
]
},
"description": "Will get a list of sections (Libraries) from a PMS\n\nWhat we need, is the key, type and title"
},
"response": []
}
],
"event": [
{
"listen": "prerequest",
"script": {
"id": "fe0095c1-f667-415f-bd56-9f081ad198e4",
"type": "text/javascript",
"exec": [
""
]
}
},
{
"listen": "test",
"script": {
"id": "83a53476-85dc-43a7-a656-9c273ff0c0d1",
"type": "text/javascript",
"exec": [
""
]
}
}
],
"variable": [
{
"id": "d5e46b4d-7ea6-4d2f-85bd-3b957b9319b7",
"key": "X-Plex-Client-Identifier",
"value": "WebTools-NG",
"type": "string"
}
],
"protocolProfileBehavior": {}
}