1
0
mirror of https://github.com/krateng/maloja.git synced 2023-08-10 21:12:55 +03:00
maloja/dev/testing/Maloja.postman_collection.json

907 lines
20 KiB
JSON
Raw Normal View History

2020-09-06 18:45:07 +03:00
{
"info": {
2021-12-27 22:35:00 +03:00
"_postman_id": "71b19d5e-78a1-4a4a-98b5-12cbf2f13fe6",
2020-09-06 18:45:07 +03:00
"name": "Maloja",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"item": [
{
2021-12-27 22:35:00 +03:00
"name": "Scrobbling",
2020-09-06 18:45:07 +03:00
"item": [
{
2021-12-27 22:35:00 +03:00
"name": "Scrobble Native",
"item": [
{
"name": "Query String",
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "formdata",
"formdata": []
},
"url": {
"raw": "{{url}}/apis/mlj_1/newscrobble?key={{api_key}}&artist={{data.artist1}}&title={{data.title1}}&artist={{data.artist2}}",
"host": [
"{{url}}"
],
"path": [
"apis",
"mlj_1",
"newscrobble"
],
"query": [
{
"key": "key",
"value": "{{api_key}}"
},
{
"key": "artist",
"value": "{{data.artist1}}"
},
{
"key": "title",
"value": "{{data.title1}}"
},
{
"key": "artist",
"value": "{{data.artist2}}"
}
]
}
},
"response": []
2020-09-06 18:45:07 +03:00
},
2021-12-27 22:35:00 +03:00
{
"name": "Query String Redirect",
"request": {
"method": "POST",
"header": [],
"url": {
"raw": "{{url}}/api/newscrobble?key={{api_key}}&artist={{data.artist1}}&title={{data.title1}}&artist={{data.artist2}}",
"host": [
"{{url}}"
],
"path": [
"api",
"newscrobble"
],
"query": [
{
"key": "key",
"value": "{{api_key}}"
},
{
"key": "artist",
"value": "{{data.artist1}}"
},
{
"key": "title",
"value": "{{data.title1}}"
},
{
"key": "artist",
"value": "{{data.artist2}}"
}
]
}
},
"response": []
},
{
"name": "Formdata",
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "formdata",
"formdata": [
{
"key": "key",
"value": "{{api_key}}",
"type": "text"
},
{
"key": "artist",
"value": "{{data.artist1}}",
"type": "text"
},
{
"key": "title",
"value": "{{data.title1}}",
"type": "text"
},
{
"key": "artist",
"value": "{{data.artist2}}",
"type": "text"
}
]
2020-09-06 18:45:07 +03:00
},
2021-12-27 22:35:00 +03:00
"url": {
"raw": "{{url}}/apis/mlj_1/newscrobble",
"host": [
"{{url}}"
],
"path": [
"apis",
"mlj_1",
"newscrobble"
]
}
},
"response": []
},
{
"name": "Formdata Redirect",
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "formdata",
"formdata": [
{
"key": "key",
"value": "{{api_key}}",
"type": "text"
},
{
"key": "artist",
"value": "{{data.artist1}}",
"type": "text"
},
{
"key": "title",
"value": "{{data.title1}}",
"type": "text"
},
{
"key": "artist",
"value": "{{data.artist2}}",
"type": "text"
}
]
2020-09-06 18:45:07 +03:00
},
2021-12-27 22:35:00 +03:00
"url": {
"raw": "{{url}}/api/newscrobble",
"host": [
"{{url}}"
],
"path": [
"api",
"newscrobble"
]
}
},
"response": []
},
{
"name": "JSON",
"request": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"name": "Content-Type",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"key\": \"{{api_key}}\",\n \"artist\": \"{{data.artist1}}\",\n \"title\": \"{{data.title1}}\"\n}"
2021-01-10 19:00:16 +03:00
},
2021-12-27 22:35:00 +03:00
"url": {
"raw": "{{url}}/apis/mlj_1/newscrobble",
"host": [
"{{url}}"
],
"path": [
"apis",
"mlj_1",
"newscrobble"
]
}
},
"response": []
},
{
"name": "JSON Multiartist",
"request": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"name": "Content-Type",
"type": "text",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"key\": \"{{api_key}}\",\n \"artists\": [\"{{data.artist1}}\",\"{{data.artist2}}\"],\n \"title\": \"{{data.title1}}\"\n}"
},
"url": {
"raw": "{{url}}/apis/mlj_1/newscrobble",
"host": [
"{{url}}"
],
"path": [
"apis",
"mlj_1",
"newscrobble"
]
2020-09-06 18:45:07 +03:00
}
2021-12-27 22:35:00 +03:00
},
"response": []
},
{
"name": "JSON Redirect",
"request": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"name": "Content-Type",
"type": "text",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"key\": \"{{api_key}}\",\n \"artist\": \"{{data.artist1}}\",\n \"title\": \"{{data.artist2}}\"\n}"
},
"url": {
"raw": "{{url}}/api/newscrobble",
"host": [
"{{url}}"
],
"path": [
"api",
"newscrobble"
]
}
},
"response": []
2020-09-06 18:45:07 +03:00
}
2021-12-27 22:35:00 +03:00
]
2020-09-06 18:45:07 +03:00
},
{
2021-12-27 22:35:00 +03:00
"name": "Scrobble Listenbrainz",
"item": [
{
"name": "JSON",
"request": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"name": "Content-Type",
"value": "application/json",
"type": "text"
},
{
"key": "Authorization",
"value": "token {{api_key}}",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\n\t\"listen_type\":\"single\",\n\t\"payload\":[\n\t\t{\n\t\t\t\"track_metadata\":{\n\t\t\t\t\"artist_name\":\"{{data.artist1}}\",\n\t\t\t\t\"track_name\":\"{{data.title1}}\"\n\t\t\t}\n\t\t}\n\t]\n}"
2020-09-06 18:45:07 +03:00
},
2021-12-27 22:35:00 +03:00
"url": {
"raw": "{{url}}/apis/listenbrainz/1/submit-listens",
"host": [
"{{url}}"
],
"path": [
"apis",
"listenbrainz",
"1",
"submit-listens"
]
}
},
"response": []
},
{
"name": "JSON Redirect",
"request": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"name": "Content-Type",
"type": "text",
"value": "application/json"
},
{
"key": "Authorization",
"type": "text",
"value": "token {{api_key}}"
}
],
"body": {
"mode": "raw",
"raw": "{\n\t\"listen_type\":\"single\",\n\t\"payload\":[\n\t\t{\n\t\t\t\"track_metadata\":{\n\t\t\t\t\"artist_name\":\"{{data.artist1}}\",\n\t\t\t\t\"track_name\":\"{{data.title1}}\"\n\t\t\t}\n\t\t}\n\t]\n}"
2021-01-10 19:00:16 +03:00
},
2021-12-27 22:35:00 +03:00
"url": {
"raw": "{{url}}/api/s/listenbrainz/1/submit-listens",
"host": [
"{{url}}"
],
"path": [
"api",
"s",
"listenbrainz",
"1",
"submit-listens"
]
2020-09-06 18:45:07 +03:00
}
2021-12-27 22:35:00 +03:00
},
"response": []
2020-09-06 18:45:07 +03:00
}
2021-12-27 22:35:00 +03:00
]
2020-09-06 18:45:07 +03:00
},
{
2021-12-27 22:35:00 +03:00
"name": "Scrobble Audioscrobbler",
"item": [
{
"name": "JSON",
"event": [
2020-09-06 18:45:07 +03:00
{
2021-12-27 22:35:00 +03:00
"listen": "test",
"script": {
"exec": [
""
],
"type": "text/javascript"
}
2020-09-06 18:45:07 +03:00
},
{
2021-12-27 22:35:00 +03:00
"listen": "prerequest",
"script": {
"exec": [
""
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"name": "Content-Type",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\n\t\"method\":\"track.scrobble\",\n\t\"artist\":\"{{data.artist1}}\",\n\t\"track\":\"{{data.title1}}\",\n\t\"sk\":\"{{session_key}}\"\n}"
2020-09-06 18:45:07 +03:00
},
2021-12-27 22:35:00 +03:00
"url": {
"raw": "{{url}}/apis/audioscrobbler/2.0/",
"host": [
"{{url}}"
],
"path": [
"apis",
"audioscrobbler",
"2.0",
""
]
}
},
"response": []
},
{
"name": "JSON Redirect",
"event": [
2020-09-06 18:45:07 +03:00
{
2021-12-27 22:35:00 +03:00
"listen": "test",
"script": {
"exec": [
""
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"name": "Content-Type",
"type": "text",
"value": "application/json"
}
],
"body": {
"mode": "raw",
"raw": "{\n\t\"method\":\"track.scrobble\",\n\t\"artist\":\"{{data.artist1}}\",\n\t\"track\":\"{{data.title1}}\",\n\t\"sk\":\"{{session_key}}\"\n}"
2021-01-10 19:00:16 +03:00
},
2021-12-27 22:35:00 +03:00
"url": {
"raw": "{{url}}/api/s/audioscrobbler/2.0/",
"host": [
"{{url}}"
],
"path": [
"api",
"s",
"audioscrobbler",
"2.0",
""
]
2020-09-06 18:45:07 +03:00
}
2021-12-27 22:35:00 +03:00
},
"response": []
2020-09-06 18:45:07 +03:00
},
2021-12-27 22:35:00 +03:00
{
"name": "Authorize",
"event": [
{
"listen": "test",
"script": {
"exec": [
"var data = JSON.parse(responseBody);",
"pm.environment.set(\"session_key\", data.session.key);",
"tests[\"gotkey\"] = true;"
],
"type": "text/javascript"
}
}
2020-09-06 18:45:07 +03:00
],
2021-12-27 22:35:00 +03:00
"request": {
"method": "POST",
"header": [
{
"key": "Content-Type",
"name": "Content-Type",
"value": "application/json",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\n\t\"method\":\"auth.getMobileSession\",\n\t\"authToken\":\"abc\",\n\t\"username\":\"someguy\",\n\t\"password\":\"{{api_key}}\"\n}"
},
"url": {
"raw": "{{url}}/apis/audioscrobbler/2.0/",
"host": [
"{{url}}"
],
"path": [
"apis",
"audioscrobbler",
"2.0",
""
]
}
},
"response": []
2020-09-06 18:45:07 +03:00
}
2021-12-27 22:35:00 +03:00
]
2020-09-06 18:45:07 +03:00
},
{
2021-12-27 22:35:00 +03:00
"name": "Scrobble Audioscrobbler Legacy",
"item": [
{
"name": "Authorize",
"event": [
2020-09-06 18:45:07 +03:00
{
2021-12-27 22:35:00 +03:00
"listen": "test",
"script": {
"exec": [
"var data = responseBody.split(\"\\n\");",
"",
"pm.environment.set(\"session_key\", data[1]);",
"pm.environment.set(\"scrobble_url\", data[3]);"
],
"type": "text/javascript"
}
2021-01-10 19:00:16 +03:00
},
{
2021-12-27 22:35:00 +03:00
"listen": "prerequest",
"script": {
"exec": [
"apikey = pm.variables.get(\"api_key\");",
"ts = pm.variables.get(\"data.timestamp1\");",
"",
"token = CryptoJS.MD5(CryptoJS.MD5(apikey) + ts).toString()",
"pm.environment.set(\"legacy_token\", token);"
],
"type": "text/javascript"
}
2020-09-06 18:45:07 +03:00
}
2021-01-10 19:00:16 +03:00
],
2021-12-27 22:35:00 +03:00
"protocolProfileBehavior": {
"disableBodyPruning": true
2020-09-06 18:45:07 +03:00
},
2021-12-27 22:35:00 +03:00
"request": {
"method": "GET",
"header": [],
"body": {
"mode": "raw",
"raw": ""
},
"url": {
"raw": "{{url}}/apis/audioscrobbler_legacy/?hs=true&t={{data.timestamp1}}&a={{legacy_token}}",
"host": [
"{{url}}"
],
"path": [
"apis",
"audioscrobbler_legacy",
""
],
"query": [
{
"key": "hs",
"value": "true"
},
{
"key": "t",
"value": "{{data.timestamp1}}"
},
{
"key": "a",
"value": "{{legacy_token}}"
}
]
}
2020-09-06 18:45:07 +03:00
},
2021-12-27 22:35:00 +03:00
"response": []
2020-09-06 18:45:07 +03:00
},
2021-12-27 22:35:00 +03:00
{
"name": "Scrobble",
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "{{scrobble_url}}?s={{session_key}}&a[0]={{data.artist1}}&t[0]={{data.title1}}&a[1]={{data.artist2}}&t[1]={{data.title2}}&i[0]={{data.timestamp1}}&i[1]={{data.timestamp2}}",
"host": [
"{{scrobble_url}}"
],
"query": [
{
"key": "s",
"value": "{{session_key}}"
},
{
"key": "a[0]",
"value": "{{data.artist1}}"
},
{
"key": "t[0]",
"value": "{{data.title1}}"
},
{
"key": "a[1]",
"value": "{{data.artist2}}"
},
{
"key": "t[1]",
"value": "{{data.title2}}"
},
{
"key": "i[0]",
"value": "{{data.timestamp1}}"
},
{
"key": "i[1]",
"value": "{{data.timestamp2}}"
}
]
}
},
"response": []
2020-09-06 18:45:07 +03:00
}
2021-12-27 22:35:00 +03:00
]
2020-09-06 18:45:07 +03:00
}
]
},
{
2021-12-27 22:35:00 +03:00
"name": "Metadata",
2020-09-06 18:45:07 +03:00
"item": [
{
2021-12-27 22:35:00 +03:00
"name": "Spotify",
"item": [
2020-09-06 18:45:07 +03:00
{
2021-12-27 22:35:00 +03:00
"name": "Authorize",
"event": [
{
"listen": "prerequest",
"script": {
"exec": [
"apiid = pm.collectionVariables.get(\"external.spotify.api_id\");",
"apisecret = pm.collectionVariables.get(\"external.spotify.api_secret\");",
"",
"authb64 = new Buffer(apiid + ':' + apisecret).toString('base64');",
"pm.environment.set(\"authb64\", authb64);",
""
],
"type": "text/javascript"
}
},
{
"listen": "test",
"script": {
"exec": [
"var data = JSON.parse(responseBody);",
"pm.collectionVariables.set(\"external.spotify.access_token\", data.access_token);"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [
{
"key": "Authorization",
"value": "Basic {{authb64}}",
"type": "text"
}
2020-10-29 19:21:50 +03:00
],
2021-12-27 22:35:00 +03:00
"body": {
"mode": "urlencoded",
"urlencoded": [
{
"key": "grant_type",
"value": "client_credentials",
"type": "text"
}
]
},
"url": {
"raw": "https://accounts.spotify.com/api/token",
"protocol": "https",
"host": [
"accounts",
"spotify",
"com"
],
"path": [
"api",
"token"
]
}
},
"response": []
2020-09-06 18:45:07 +03:00
},
2020-09-06 19:54:31 +03:00
{
2021-12-27 22:35:00 +03:00
"name": "Track Info Old",
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "https://api.spotify.com/v1/search?type=track&access_token={{external.spotify.access_token}}&q=artist:{{data.artist3}} track:{{data.title3}}",
"protocol": "https",
"host": [
"api",
"spotify",
"com"
],
"path": [
"v1",
"search"
],
"query": [
{
"key": "type",
"value": "track"
},
{
"key": "access_token",
"value": "{{external.spotify.access_token}}"
},
{
"key": "q",
"value": "artist:{{data.artist3}} track:{{data.title3}}"
}
]
}
},
"response": []
2020-09-06 19:54:31 +03:00
},
2020-09-06 18:45:07 +03:00
{
2021-12-27 22:35:00 +03:00
"name": "Track Info New",
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"value": "Bearer {{external.spotify.access_token}}",
"type": "text"
}
2020-09-06 18:45:07 +03:00
],
2021-12-27 22:35:00 +03:00
"url": {
"raw": "https://api.spotify.com/v1/search?type=track&q=artist:{{data.artist3}}%20track:{{data.title3}}",
"protocol": "https",
"host": [
"api",
"spotify",
"com"
],
"path": [
"v1",
"search"
],
"query": [
{
"key": "type",
"value": "track"
},
{
"key": "q",
"value": "artist:{{data.artist3}}%20track:{{data.title3}}"
}
]
}
},
"response": []
2020-09-06 18:45:07 +03:00
}
2021-12-27 22:35:00 +03:00
]
2020-09-06 18:45:07 +03:00
}
]
2020-10-29 19:21:50 +03:00
},
{
2021-12-27 22:35:00 +03:00
"name": "Scrobbleforward",
2020-10-29 19:21:50 +03:00
"item": [
{
2021-12-27 22:35:00 +03:00
"name": "Last.fm",
"item": [
2020-10-29 19:21:50 +03:00
{
2021-12-27 22:35:00 +03:00
"name": "Authorize",
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "urlencoded",
"urlencoded": []
2020-10-29 19:21:50 +03:00
},
2021-12-27 22:35:00 +03:00
"url": {
"raw": "https://ws.audioscrobbler.com/2.0/?method=auth.getMobileSession&username={{external.lastfm.username}}&password={{external.lastfm.password}}&api_key={{external.lastfm.api_key}}&api_sig=TODO",
"protocol": "https",
"host": [
"ws",
"audioscrobbler",
"com"
],
"path": [
"2.0",
""
],
"query": [
{
"key": "method",
"value": "auth.getMobileSession"
},
{
"key": "username",
"value": "{{external.lastfm.username}}"
},
{
"key": "password",
"value": "{{external.lastfm.password}}"
},
{
"key": "api_key",
"value": "{{external.lastfm.api_key}}"
},
{
"key": "api_sig",
"value": "TODO"
}
]
2020-10-29 19:21:50 +03:00
}
2021-12-27 22:35:00 +03:00
},
"response": []
2020-10-29 19:21:50 +03:00
}
2021-12-27 22:35:00 +03:00
]
2020-10-29 19:21:50 +03:00
}
2021-01-10 19:00:16 +03:00
]
2020-09-06 18:45:07 +03:00
}
],
"event": [
{
"listen": "prerequest",
"script": {
"type": "text/javascript",
"exec": [
"var current_timestamp = Math.floor(Date.now() / 1000);",
2021-12-27 22:35:00 +03:00
"pm.collectionVariables.set(\"data.timestamp1\", current_timestamp);",
2021-12-30 09:29:55 +03:00
"pm.collectionVariables.set(\"data.timestamp2\", current_timestamp - 200);"
2020-09-06 18:45:07 +03:00
]
}
},
{
"listen": "test",
"script": {
"type": "text/javascript",
"exec": [
""
]
}
}
],
"variable": [
{
2020-09-06 19:54:31 +03:00
"key": "url",
2020-10-29 19:21:50 +03:00
"value": "http://localhost:42010"
2020-09-06 19:54:31 +03:00
},
{
2020-09-06 18:45:07 +03:00
"key": "api_key",
2020-10-29 19:21:50 +03:00
"value": "localdevtestkey"
2020-09-06 18:45:07 +03:00
},
{
2021-12-27 22:35:00 +03:00
"key": "session_key",
"value": ""
2020-09-06 18:45:07 +03:00
},
{
2021-12-27 22:35:00 +03:00
"key": "data.artist1",
"value": "EXID ft. Jeremy Soule"
2020-10-29 19:21:50 +03:00
},
{
2021-12-27 22:35:00 +03:00
"key": "data.artist2",
2020-10-29 19:21:50 +03:00
"value": "BLACKPINK ft. Tzuyu"
},
{
2021-12-27 22:35:00 +03:00
"key": "data.artist3",
"value": "TWICE"
},
{
"key": "data.title1",
"value": "Why is the Rum gone?"
},
{
"key": "data.title2",
2020-10-29 19:21:50 +03:00
"value": "POP/STARS"
2021-12-27 22:35:00 +03:00
},
{
"key": "data.title3",
"value": "One in a Million"
},
{
"key": "data.timestamp1",
"value": ""
},
{
"key": "data.timestamp2",
"value": ""
},
{
"key": "external.spotify.api_id",
"value": ""
},
{
"key": "external.spotify.api_secret",
"value": ""
},
{
"key": "external.spotify.access_token",
"value": ""
},
{
"key": "external.lastfm.username",
"value": ""
},
{
"key": "external.lastfm.password",
"value": ""
},
{
"key": "external.lastfm.api_key",
"value": ""
},
{
"key": "external.lastfm.secret",
"value": ""
2020-09-06 18:45:07 +03:00
}
]
2020-09-06 19:54:31 +03:00
}