1580 lines
No EOL
33 KiB
JSON
Executable file
1580 lines
No EOL
33 KiB
JSON
Executable file
{
|
|
"info": {
|
|
"_postman_id": "a7eece2c-4939-461c-8b01-6d2ec1020193",
|
|
"name": "Resq Mobile API - API Controller",
|
|
"description": "API call to register a mobile number",
|
|
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
|
|
},
|
|
"item": [
|
|
{
|
|
"name": "[Normal] Register",
|
|
"event": [
|
|
{
|
|
"listen": "test",
|
|
"script": {
|
|
"id": "9170a06a-c4bd-4747-85c4-8f3d27b17984",
|
|
"exec": [
|
|
"pm.test(\"Status code is 200\", function () {",
|
|
" pm.response.to.have.status(200);",
|
|
"});",
|
|
"",
|
|
"pm.test(\"Register\", function () {",
|
|
" var jsonData = pm.response.json();",
|
|
" pm.expect(jsonData.error.status).to.eql(\"success\");",
|
|
" pm.expect(jsonData.data).to.have.property(\"session_id\");",
|
|
" ",
|
|
" // get session id value",
|
|
" let session_id = jsonData.data.session_id;",
|
|
" ",
|
|
" // store the session_id value as a global variable. The session id is the api_key in calls requiring an api_key",
|
|
" ",
|
|
" pm.globals.set(\"api_key\", session_id);",
|
|
"});"
|
|
],
|
|
"type": "text/javascript"
|
|
}
|
|
}
|
|
],
|
|
"request": {
|
|
"method": "POST",
|
|
"header": [],
|
|
"body": {
|
|
"mode": "formdata",
|
|
"formdata": [
|
|
{
|
|
"key": "phone_model",
|
|
"value": "{{phone_model}}",
|
|
"type": "text"
|
|
},
|
|
{
|
|
"key": "os_type",
|
|
"value": "{{os_type}}",
|
|
"type": "text"
|
|
},
|
|
{
|
|
"key": "os_version",
|
|
"value": "{{os_version}}",
|
|
"type": "text"
|
|
},
|
|
{
|
|
"key": "phone_id",
|
|
"value": "{{phone_id}}",
|
|
"type": "text"
|
|
}
|
|
]
|
|
},
|
|
"url": {
|
|
"raw": "{{resq_url}}/api/register",
|
|
"host": [
|
|
"{{resq_url}}"
|
|
],
|
|
"path": [
|
|
"api",
|
|
"register"
|
|
]
|
|
}
|
|
},
|
|
"response": []
|
|
},
|
|
{
|
|
"name": "[Abnormal] Missing parameters",
|
|
"event": [
|
|
{
|
|
"listen": "test",
|
|
"script": {
|
|
"id": "2cf0b49e-cc34-4437-ae6f-9a5da1c45afa",
|
|
"exec": [
|
|
"pm.test(\"Status code is 200\", function () {",
|
|
" pm.response.to.have.status(200);",
|
|
"});",
|
|
"",
|
|
"pm.test(\"Missing all parameters\", function () {",
|
|
" var jsonData = pm.response.json();",
|
|
" pm.expect(jsonData.error.status).to.eql(\"error\");",
|
|
" pm.expect(jsonData.error.message).to.include(\"Missing parameter\");",
|
|
" pm.expect(jsonData.data).to.be.empty;",
|
|
"});"
|
|
],
|
|
"type": "text/javascript"
|
|
}
|
|
}
|
|
],
|
|
"request": {
|
|
"method": "POST",
|
|
"header": [],
|
|
"url": {
|
|
"raw": "{{resq_url}}/api/register",
|
|
"host": [
|
|
"{{resq_url}}"
|
|
],
|
|
"path": [
|
|
"api",
|
|
"register"
|
|
]
|
|
}
|
|
},
|
|
"response": []
|
|
},
|
|
{
|
|
"name": "[Normal] Confirm Number",
|
|
"event": [
|
|
{
|
|
"listen": "test",
|
|
"script": {
|
|
"id": "4a6c099e-3484-4047-83db-a29ab500f27a",
|
|
"exec": [
|
|
"pm.test(\"Status code is 200\", function () {",
|
|
" pm.response.to.have.status(200);",
|
|
"});",
|
|
"",
|
|
"pm.test(\"Confirm number\", function () {",
|
|
" var jsonData = pm.response.json();",
|
|
" pm.expect(jsonData.error.status).to.eql(\"success\");",
|
|
"});"
|
|
],
|
|
"type": "text/javascript"
|
|
}
|
|
}
|
|
],
|
|
"request": {
|
|
"method": "POST",
|
|
"header": [],
|
|
"body": {
|
|
"mode": "formdata",
|
|
"formdata": [
|
|
{
|
|
"key": "phone_number",
|
|
"value": "{{phone_number}}",
|
|
"type": "text"
|
|
},
|
|
{
|
|
"key": "api_key",
|
|
"value": "{{api_key}}",
|
|
"type": "text",
|
|
"disabled": true
|
|
}
|
|
]
|
|
},
|
|
"url": {
|
|
"raw": "{{resq_url}}/api/number_confirm?api_key={{api_key}}",
|
|
"host": [
|
|
"{{resq_url}}"
|
|
],
|
|
"path": [
|
|
"api",
|
|
"number_confirm"
|
|
],
|
|
"query": [
|
|
{
|
|
"key": "api_key",
|
|
"value": "{{api_key}}"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"response": []
|
|
},
|
|
{
|
|
"name": "[Normal] Validate Code",
|
|
"event": [
|
|
{
|
|
"listen": "test",
|
|
"script": {
|
|
"id": "11118347-c2fd-466d-800c-82714070afab",
|
|
"exec": [
|
|
"pm.test(\"Status code is 200\", function () {",
|
|
" pm.response.to.have.status(200);",
|
|
"});",
|
|
"",
|
|
"pm.test(\"Validate Code\", function () {",
|
|
" var jsonData = pm.response.json();",
|
|
" pm.expect(jsonData.error.status).to.eql(\"success\");",
|
|
"});"
|
|
],
|
|
"type": "text/javascript"
|
|
}
|
|
}
|
|
],
|
|
"request": {
|
|
"method": "POST",
|
|
"header": [],
|
|
"body": {
|
|
"mode": "formdata",
|
|
"formdata": [
|
|
{
|
|
"key": "code",
|
|
"value": "{{code}}",
|
|
"type": "text"
|
|
}
|
|
]
|
|
},
|
|
"url": {
|
|
"raw": "{{resq_url}}/api/code_validate?api_key={{api_key}}",
|
|
"host": [
|
|
"{{resq_url}}"
|
|
],
|
|
"path": [
|
|
"api",
|
|
"code_validate"
|
|
],
|
|
"query": [
|
|
{
|
|
"key": "api_key",
|
|
"value": "{{api_key}}"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"response": []
|
|
},
|
|
{
|
|
"name": "[Normal] Get Status",
|
|
"event": [
|
|
{
|
|
"listen": "test",
|
|
"script": {
|
|
"id": "dabc1451-e75d-46c6-b3fa-5992b62a065f",
|
|
"exec": [
|
|
"pm.test(\"Status code is 200\", function () {",
|
|
" pm.response.to.have.status(200);",
|
|
"});",
|
|
"",
|
|
"pm.test(\"Status of mobile session\", function () {",
|
|
" var jsonData = pm.response.json();",
|
|
" pm.expect(jsonData.error.status).to.eql(\"success\");",
|
|
" pm.expect(jsonData.data.status).to.eql(\"confirmed\");",
|
|
"});"
|
|
],
|
|
"type": "text/javascript"
|
|
}
|
|
}
|
|
],
|
|
"request": {
|
|
"method": "GET",
|
|
"header": [],
|
|
"url": {
|
|
"raw": "{{resq_url}}/api/status?api_key={{api_key}}",
|
|
"host": [
|
|
"{{resq_url}}"
|
|
],
|
|
"path": [
|
|
"api",
|
|
"status"
|
|
],
|
|
"query": [
|
|
{
|
|
"key": "api_key",
|
|
"value": "{{api_key}}"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"response": []
|
|
},
|
|
{
|
|
"name": "[Normal] Update Info",
|
|
"event": [
|
|
{
|
|
"listen": "test",
|
|
"script": {
|
|
"id": "27592b25-ba3d-4218-813f-3a9ab710fccc",
|
|
"exec": [
|
|
"pm.test(\"Status code is 200\", function () {",
|
|
" pm.response.to.have.status(200);",
|
|
"});",
|
|
"",
|
|
"pm.test(\"Update Info\", function () {",
|
|
" var jsonData = pm.response.json();",
|
|
" pm.expect(jsonData.error.status).to.eql(\"success\");",
|
|
"});"
|
|
],
|
|
"type": "text/javascript"
|
|
}
|
|
}
|
|
],
|
|
"request": {
|
|
"method": "POST",
|
|
"header": [],
|
|
"body": {
|
|
"mode": "formdata",
|
|
"formdata": [
|
|
{
|
|
"key": "first_name",
|
|
"value": "{{first_name}}",
|
|
"type": "text"
|
|
},
|
|
{
|
|
"key": "last_name",
|
|
"value": "{{last_name}}",
|
|
"type": "text"
|
|
}
|
|
]
|
|
},
|
|
"url": {
|
|
"raw": "{{resq_url}}/api/info?api_key={{api_key}}",
|
|
"host": [
|
|
"{{resq_url}}"
|
|
],
|
|
"path": [
|
|
"api",
|
|
"info"
|
|
],
|
|
"query": [
|
|
{
|
|
"key": "api_key",
|
|
"value": "{{api_key}}"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"response": []
|
|
},
|
|
{
|
|
"name": "[Normal] Get Info",
|
|
"event": [
|
|
{
|
|
"listen": "test",
|
|
"script": {
|
|
"id": "24efd1b8-ad00-4cb0-beb5-85c014d8a09a",
|
|
"exec": [
|
|
"pm.test(\"Status code is 200\", function () {",
|
|
" pm.response.to.have.status(200);",
|
|
"});",
|
|
"",
|
|
"pm.test(\"Get Info\", function () {",
|
|
" var jsonData = pm.response.json();",
|
|
" pm.expect(jsonData.error.status).to.eql(\"success\");",
|
|
" pm.expect(jsonData.data.first_name).to.eql(\"Stiltzkin\");",
|
|
" pm.expect(jsonData.data.last_name).to.eql(\"Moogle\");",
|
|
"});"
|
|
],
|
|
"type": "text/javascript"
|
|
}
|
|
}
|
|
],
|
|
"request": {
|
|
"method": "GET",
|
|
"header": [],
|
|
"url": {
|
|
"raw": "{{resq_url}}/api/info?api_key={{api_key}}",
|
|
"host": [
|
|
"{{resq_url}}"
|
|
],
|
|
"path": [
|
|
"api",
|
|
"info"
|
|
],
|
|
"query": [
|
|
{
|
|
"key": "api_key",
|
|
"value": "{{api_key}}"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"response": []
|
|
},
|
|
{
|
|
"name": "[Normal] List Vehicle Manufacturers",
|
|
"event": [
|
|
{
|
|
"listen": "test",
|
|
"script": {
|
|
"id": "86275f4c-dd2b-42c8-9ac2-c7d7a7d2edfe",
|
|
"exec": [
|
|
"pm.test(\"Status code is 200\", function () {",
|
|
" pm.response.to.have.status(200);",
|
|
"});",
|
|
"",
|
|
"pm.test(\"List vehicle manufacturers\", function () {",
|
|
" var jsonData = pm.response.json();",
|
|
" pm.expect(jsonData.error.status).to.eql(\"success\");",
|
|
" pm.expect(jsonData.data.manufacturers).to.have.lengthOf(43);",
|
|
"});"
|
|
],
|
|
"type": "text/javascript"
|
|
}
|
|
}
|
|
],
|
|
"request": {
|
|
"method": "GET",
|
|
"header": [],
|
|
"url": {
|
|
"raw": "{{resq_url}}/api/vehicle/mfgs?api_key={{api_key}}",
|
|
"host": [
|
|
"{{resq_url}}"
|
|
],
|
|
"path": [
|
|
"api",
|
|
"vehicle",
|
|
"mfgs"
|
|
],
|
|
"query": [
|
|
{
|
|
"key": "api_key",
|
|
"value": "{{api_key}}"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"response": []
|
|
},
|
|
{
|
|
"name": "[Normal] List Vehicle Makes",
|
|
"event": [
|
|
{
|
|
"listen": "test",
|
|
"script": {
|
|
"id": "74a802f4-f8ea-4059-a18a-206d29a50199",
|
|
"exec": [
|
|
"pm.test(\"Status code is 200\", function () {",
|
|
" pm.response.to.have.status(200);",
|
|
"});",
|
|
"",
|
|
"pm.test(\"List Vehicle Makes\", function () {",
|
|
" var jsonData = pm.response.json();",
|
|
" pm.expect(jsonData.error.status).to.eql(\"success\");",
|
|
" pm.expect(jsonData.data.manufacturer.name).to.eql(\"VOLKSWAGEN\");",
|
|
" pm.expect(jsonData.data.makes).to.have.lengthOf(27);",
|
|
" pm.expect(jsonData.data.makes[0].make).to.eql(\"BEETLE 2013 - 2018\");",
|
|
"});"
|
|
],
|
|
"type": "text/javascript"
|
|
}
|
|
}
|
|
],
|
|
"request": {
|
|
"method": "GET",
|
|
"header": [],
|
|
"url": {
|
|
"raw": "{{resq_url}}/api/vehicle/mfgs/{{mfg_id}}/makes?api_key={{api_key}}",
|
|
"host": [
|
|
"{{resq_url}}"
|
|
],
|
|
"path": [
|
|
"api",
|
|
"vehicle",
|
|
"mfgs",
|
|
"{{mfg_id}}",
|
|
"makes"
|
|
],
|
|
"query": [
|
|
{
|
|
"key": "api_key",
|
|
"value": "{{api_key}}"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"response": []
|
|
},
|
|
{
|
|
"name": "[Normal] Add Vehicle",
|
|
"event": [
|
|
{
|
|
"listen": "test",
|
|
"script": {
|
|
"id": "efd6f228-c8d6-4e52-a9d1-fca7b5e3220e",
|
|
"exec": [
|
|
"pm.test(\"Status code is 200\", function () {",
|
|
" pm.response.to.have.status(200);",
|
|
"});",
|
|
"",
|
|
"pm.test(\"Add vehicle\", function () {",
|
|
" var jsonData = pm.response.json();",
|
|
" pm.expect(jsonData.error.status).to.eql(\"success\");",
|
|
" pm.expect(jsonData.data).to.have.property(\"cv_id\");",
|
|
" ",
|
|
" // store customer vehicle id for update vehicle",
|
|
" let cv_id = jsonData.data.cv_id;",
|
|
" pm.globals.set(\"global_cv_id\", cv_id);",
|
|
"});"
|
|
],
|
|
"type": "text/javascript"
|
|
}
|
|
}
|
|
],
|
|
"request": {
|
|
"method": "POST",
|
|
"header": [],
|
|
"body": {
|
|
"mode": "formdata",
|
|
"formdata": [
|
|
{
|
|
"key": "make_id",
|
|
"value": "{{make_id}}",
|
|
"type": "text"
|
|
},
|
|
{
|
|
"key": "name",
|
|
"value": "{{name}}",
|
|
"type": "text"
|
|
},
|
|
{
|
|
"key": "plate_num",
|
|
"value": "{{plate_num}}",
|
|
"type": "text"
|
|
},
|
|
{
|
|
"key": "model_year",
|
|
"value": "{{model_year}}",
|
|
"type": "text"
|
|
},
|
|
{
|
|
"key": "color",
|
|
"value": "{{color}}",
|
|
"type": "text"
|
|
},
|
|
{
|
|
"key": "condition",
|
|
"value": "{{condition}}",
|
|
"type": "text"
|
|
},
|
|
{
|
|
"key": "fuel_type",
|
|
"value": "{{fuel_type}}",
|
|
"type": "text"
|
|
}
|
|
]
|
|
},
|
|
"url": {
|
|
"raw": "{{resq_url}}/api/vehicles?api_key={{api_key}}",
|
|
"host": [
|
|
"{{resq_url}}"
|
|
],
|
|
"path": [
|
|
"api",
|
|
"vehicles"
|
|
],
|
|
"query": [
|
|
{
|
|
"key": "api_key",
|
|
"value": "{{api_key}}"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"response": []
|
|
},
|
|
{
|
|
"name": "[Normal] Update Vehicle",
|
|
"event": [
|
|
{
|
|
"listen": "test",
|
|
"script": {
|
|
"id": "8cd334bb-4032-47f3-9dcd-8c893135ac7d",
|
|
"exec": [
|
|
"pm.test(\"Status code is 200\", function () {",
|
|
" pm.response.to.have.status(200);",
|
|
"});",
|
|
"",
|
|
"pm.test(\"Update vehicle\", function () {",
|
|
" var jsonData = pm.response.json();",
|
|
" pm.expect(jsonData.error.status).to.eql(\"success\");",
|
|
" pm.expect(jsonData.data.cv_id).to.eql(pm.globals.get(\"global_cv_id\"));",
|
|
"});"
|
|
],
|
|
"type": "text/javascript"
|
|
}
|
|
}
|
|
],
|
|
"request": {
|
|
"method": "POST",
|
|
"header": [],
|
|
"body": {
|
|
"mode": "formdata",
|
|
"formdata": [
|
|
{
|
|
"key": "make_id",
|
|
"value": "{{make_id}}",
|
|
"type": "text"
|
|
},
|
|
{
|
|
"key": "name",
|
|
"value": "{{name}}",
|
|
"type": "text"
|
|
},
|
|
{
|
|
"key": "plate_num",
|
|
"value": "{{plate_num}}",
|
|
"type": "text"
|
|
},
|
|
{
|
|
"key": "model_year",
|
|
"value": "{{model_year}}",
|
|
"type": "text"
|
|
},
|
|
{
|
|
"key": "color",
|
|
"value": "{{color}}",
|
|
"type": "text"
|
|
},
|
|
{
|
|
"key": "condition",
|
|
"value": "{{condition}}",
|
|
"type": "text"
|
|
},
|
|
{
|
|
"key": "fuel_type",
|
|
"value": "{{fuel_type}}",
|
|
"type": "text"
|
|
},
|
|
{
|
|
"key": "wty_code",
|
|
"value": "{{wty_code}}",
|
|
"type": "text"
|
|
},
|
|
{
|
|
"key": "wty_expire",
|
|
"value": "{{wty_expire}}",
|
|
"type": "text"
|
|
},
|
|
{
|
|
"key": "is_motolite",
|
|
"value": "1",
|
|
"type": "text"
|
|
},
|
|
{
|
|
"key": "is_active",
|
|
"value": "1",
|
|
"type": "text"
|
|
}
|
|
]
|
|
},
|
|
"url": {
|
|
"raw": "{{resq_url}}/api/vehicles/{{global_cv_id}}?api_key={{api_key}}",
|
|
"host": [
|
|
"{{resq_url}}"
|
|
],
|
|
"path": [
|
|
"api",
|
|
"vehicles",
|
|
"{{global_cv_id}}"
|
|
],
|
|
"query": [
|
|
{
|
|
"key": "api_key",
|
|
"value": "{{api_key}}"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"response": []
|
|
},
|
|
{
|
|
"name": "[Normal] List Vehicles",
|
|
"event": [
|
|
{
|
|
"listen": "test",
|
|
"script": {
|
|
"id": "82efd001-0a54-4c45-b8b5-d996a197a3a6",
|
|
"exec": [
|
|
"pm.test(\"Status code is 200\", function () {",
|
|
" pm.response.to.have.status(200);",
|
|
"});",
|
|
"",
|
|
"pm.test(\"List vehicles\", function () {",
|
|
" var jsonData = pm.response.json();",
|
|
" pm.expect(jsonData.error.status).to.eql(\"success\");",
|
|
" pm.expect(jsonData.data.vehicles.length).to.be.gt(0);",
|
|
"});"
|
|
],
|
|
"type": "text/javascript"
|
|
}
|
|
}
|
|
],
|
|
"request": {
|
|
"method": "GET",
|
|
"header": [],
|
|
"url": {
|
|
"raw": "{{resq_url}}/api/vehicles?api_key={{api_key}}",
|
|
"host": [
|
|
"{{resq_url}}"
|
|
],
|
|
"path": [
|
|
"api",
|
|
"vehicles"
|
|
],
|
|
"query": [
|
|
{
|
|
"key": "api_key",
|
|
"value": "{{api_key}}"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"response": []
|
|
},
|
|
{
|
|
"name": "[Normal] List Promos",
|
|
"event": [
|
|
{
|
|
"listen": "test",
|
|
"script": {
|
|
"id": "5263af3d-5f82-4bef-9575-c0771e78fe1e",
|
|
"exec": [
|
|
"pm.test(\"Status code is 200\", function () {",
|
|
" pm.response.to.have.status(200);",
|
|
"});",
|
|
"",
|
|
"pm.test(\"List promos\", function () {",
|
|
" var jsonData = pm.response.json();",
|
|
" pm.expect(jsonData.error.status).to.eql(\"success\");",
|
|
" pm.expect(jsonData.data.promos).to.have.lengthOf(9);",
|
|
" pm.expect(jsonData.data.promos[0].code).to.eql(\"EMPLOY\");",
|
|
"});"
|
|
],
|
|
"type": "text/javascript"
|
|
}
|
|
}
|
|
],
|
|
"request": {
|
|
"method": "GET",
|
|
"header": [],
|
|
"url": {
|
|
"raw": "{{resq_url}}/api/promos?api_key={{api_key}}",
|
|
"host": [
|
|
"{{resq_url}}"
|
|
],
|
|
"path": [
|
|
"api",
|
|
"promos"
|
|
],
|
|
"query": [
|
|
{
|
|
"key": "api_key",
|
|
"value": "{{api_key}}"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"response": []
|
|
},
|
|
{
|
|
"name": "[Normal] Get Compatible Batteries",
|
|
"event": [
|
|
{
|
|
"listen": "test",
|
|
"script": {
|
|
"id": "8d860fb0-7e8b-4ac9-b229-15df1ade3677",
|
|
"exec": [
|
|
"pm.test(\"Status code is 200\", function () {",
|
|
" pm.response.to.have.status(200);",
|
|
"});",
|
|
"",
|
|
"pm.test(\"Get compatible batteries\", function () {",
|
|
" var jsonData = pm.response.json();",
|
|
" pm.expect(jsonData.error.status).to.eql(\"success\");",
|
|
" pm.expect(jsonData.data.batteries[0].model_name).to.eql(\"GOLD\");",
|
|
" pm.expect(jsonData.data.batteries[0].size_name).to.eql(\"DIN55\");",
|
|
"});"
|
|
],
|
|
"type": "text/javascript"
|
|
}
|
|
}
|
|
],
|
|
"request": {
|
|
"method": "GET",
|
|
"header": [],
|
|
"url": {
|
|
"raw": "{{resq_url}}/api/vehicles/{{make_id}}/compatible_batteries?api_key={{api_key}}",
|
|
"host": [
|
|
"{{resq_url}}"
|
|
],
|
|
"path": [
|
|
"api",
|
|
"vehicles",
|
|
"{{make_id}}",
|
|
"compatible_batteries"
|
|
],
|
|
"query": [
|
|
{
|
|
"key": "api_key",
|
|
"value": "{{api_key}}"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"response": []
|
|
},
|
|
{
|
|
"name": "[Normal] Request Job Order",
|
|
"event": [
|
|
{
|
|
"listen": "test",
|
|
"script": {
|
|
"id": "004a6b74-d182-45c9-aaca-26eac31ef663",
|
|
"exec": [
|
|
"pm.test(\"Status code is 200\", function () {",
|
|
" pm.response.to.have.status(200);",
|
|
"});",
|
|
"",
|
|
"pm.test(\"Request job order\", function () {",
|
|
" var jsonData = pm.response.json();",
|
|
" pm.expect(jsonData.error.status).to.eql(\"success\");",
|
|
" pm.expect(jsonData.data.invoice.items[0].title).to.eql(\"GOLD DIN77\");",
|
|
" pm.expect(jsonData.data.invoice.items[0].qty).to.eql(1);",
|
|
"});"
|
|
],
|
|
"type": "text/javascript"
|
|
}
|
|
}
|
|
],
|
|
"request": {
|
|
"method": "POST",
|
|
"header": [],
|
|
"body": {
|
|
"mode": "formdata",
|
|
"formdata": [
|
|
{
|
|
"key": "service_type",
|
|
"value": "{{service_type}}",
|
|
"type": "text"
|
|
},
|
|
{
|
|
"key": "cv_id",
|
|
"value": "{{global_cv_id}}",
|
|
"type": "text"
|
|
},
|
|
{
|
|
"key": "trade_in",
|
|
"value": "{{trade_in}}",
|
|
"type": "text"
|
|
},
|
|
{
|
|
"key": "long",
|
|
"value": "{{longitude}}",
|
|
"type": "text"
|
|
},
|
|
{
|
|
"key": "lat",
|
|
"value": "{{latitude}}",
|
|
"type": "text"
|
|
},
|
|
{
|
|
"key": "warranty",
|
|
"value": "{{warranty}}",
|
|
"type": "text"
|
|
},
|
|
{
|
|
"key": "mode_of_payment",
|
|
"value": "{{mode_of_payment}}",
|
|
"type": "text"
|
|
},
|
|
{
|
|
"key": "delivery_address",
|
|
"value": "{{delivery_address}}",
|
|
"type": "text"
|
|
},
|
|
{
|
|
"key": "delivery_instructions",
|
|
"value": "{{delivery_instructions}}",
|
|
"type": "text"
|
|
},
|
|
{
|
|
"key": "promo_id",
|
|
"value": "{{promo_id}}",
|
|
"type": "text"
|
|
},
|
|
{
|
|
"key": "batt_id",
|
|
"value": "{{batt_id}}",
|
|
"type": "text"
|
|
}
|
|
]
|
|
},
|
|
"url": {
|
|
"raw": "{{resq_url}}/api/job_order?api_key={{api_key}}",
|
|
"host": [
|
|
"{{resq_url}}"
|
|
],
|
|
"path": [
|
|
"api",
|
|
"job_order"
|
|
],
|
|
"query": [
|
|
{
|
|
"key": "api_key",
|
|
"value": "{{api_key}}"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"response": []
|
|
},
|
|
{
|
|
"name": "[Normal] Get Estimate",
|
|
"event": [
|
|
{
|
|
"listen": "test",
|
|
"script": {
|
|
"id": "e1573c58-a141-4d97-8812-c1b50f261f32",
|
|
"exec": [
|
|
"pm.test(\"Status code is 200\", function () {",
|
|
" pm.response.to.have.status(200);",
|
|
"});",
|
|
"",
|
|
"pm.test(\"Your test name\", function () {",
|
|
" var jsonData = pm.response.json();",
|
|
" pm.expect(jsonData.error.status).to.eql(\"success\");",
|
|
" pm.expect(jsonData.data.total_price).to.eql(8014.29);",
|
|
" pm.expect(jsonData.data.items[0].title).to.eql(\"GOLD DIN77\");",
|
|
" pm.expect(jsonData.data.items[0].qty).to.eql(1);",
|
|
"});"
|
|
],
|
|
"type": "text/javascript"
|
|
}
|
|
}
|
|
],
|
|
"request": {
|
|
"method": "POST",
|
|
"header": [],
|
|
"body": {
|
|
"mode": "formdata",
|
|
"formdata": [
|
|
{
|
|
"key": "service_type",
|
|
"value": "{{service_type}}",
|
|
"type": "text"
|
|
},
|
|
{
|
|
"key": "cv_id",
|
|
"value": "{{global_cv_id}}",
|
|
"type": "text"
|
|
},
|
|
{
|
|
"key": "trade_in",
|
|
"value": "{{trade_in}}",
|
|
"type": "text"
|
|
},
|
|
{
|
|
"key": "promo_id",
|
|
"value": "{{promo_id}}",
|
|
"type": "text"
|
|
},
|
|
{
|
|
"key": "batt_id",
|
|
"value": "{{batt_id}}",
|
|
"type": "text"
|
|
}
|
|
]
|
|
},
|
|
"url": {
|
|
"raw": "{{resq_url}}/api/estimate?api_key={{api_key}}",
|
|
"host": [
|
|
"{{resq_url}}"
|
|
],
|
|
"path": [
|
|
"api",
|
|
"estimate"
|
|
],
|
|
"query": [
|
|
{
|
|
"key": "api_key",
|
|
"value": "{{api_key}}"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"response": []
|
|
},
|
|
{
|
|
"name": "[Normal] GetOngoing Job Order",
|
|
"event": [
|
|
{
|
|
"listen": "test",
|
|
"script": {
|
|
"id": "7a7496f9-8ec7-4912-9887-55fda6e7c1c3",
|
|
"exec": [
|
|
"pm.test(\"Status code is 200\", function () {",
|
|
" pm.response.to.have.status(200);",
|
|
"});",
|
|
"",
|
|
"pm.test(\"Get ongoing job orders\", function () {",
|
|
" var jsonData = pm.response.json();",
|
|
" pm.expect(jsonData.error.status).to.eql(\"success\");",
|
|
" pm.expect(jsonData.data.has_ongoing).to.eql(true);",
|
|
"});"
|
|
],
|
|
"type": "text/javascript"
|
|
}
|
|
}
|
|
],
|
|
"request": {
|
|
"method": "GET",
|
|
"header": [],
|
|
"url": {
|
|
"raw": "{{resq_url}}/api/job_order/ongoing?api_key={{api_key}}",
|
|
"host": [
|
|
"{{resq_url}}"
|
|
],
|
|
"path": [
|
|
"api",
|
|
"job_order",
|
|
"ongoing"
|
|
],
|
|
"query": [
|
|
{
|
|
"key": "api_key",
|
|
"value": "{{api_key}}"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"response": []
|
|
},
|
|
{
|
|
"name": "[Normal] Get Rider Status - Job Order Pending",
|
|
"event": [
|
|
{
|
|
"listen": "test",
|
|
"script": {
|
|
"id": "f12508f6-cd9f-443b-ae56-835d4e913e55",
|
|
"exec": [
|
|
"pm.test(\"Status code is 200\", function () {",
|
|
" pm.response.to.have.status(200);",
|
|
"});",
|
|
"",
|
|
"pm.test(\"Get rider status\", function () {",
|
|
" var jsonData = pm.response.json();",
|
|
" pm.expect(jsonData.error.status).to.eql(\"success\");",
|
|
" pm.expect(jsonData.data.service_type).to.eql(\"battery_new\");",
|
|
" pm.expect(jsonData.data.status).to.eql(\"outlet_assign\");",
|
|
"});"
|
|
],
|
|
"type": "text/javascript"
|
|
}
|
|
}
|
|
],
|
|
"request": {
|
|
"method": "GET",
|
|
"header": [],
|
|
"url": {
|
|
"raw": "{{resq_url}}/api/rider?api_key={{api_key}}",
|
|
"host": [
|
|
"{{resq_url}}"
|
|
],
|
|
"path": [
|
|
"api",
|
|
"rider"
|
|
],
|
|
"query": [
|
|
{
|
|
"key": "api_key",
|
|
"value": "{{api_key}}"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"response": []
|
|
},
|
|
{
|
|
"name": "[Normal] Get Rider Status - Job Order Rider Assign",
|
|
"event": [
|
|
{
|
|
"listen": "test",
|
|
"script": {
|
|
"id": "f12508f6-cd9f-443b-ae56-835d4e913e55",
|
|
"exec": [
|
|
"pm.test(\"Status code is 200\", function () {",
|
|
" pm.response.to.have.status(200);",
|
|
"});",
|
|
"",
|
|
"pm.test(\"Get rider status\", function () {",
|
|
" var jsonData = pm.response.json();",
|
|
" pm.expect(jsonData.error.status).to.eql(\"success\");",
|
|
" pm.expect(jsonData.data.service_type).to.eql(\"battery_new\");",
|
|
" pm.expect(jsonData.data.status).to.eql(\"rider_assign\");",
|
|
"});"
|
|
],
|
|
"type": "text/javascript"
|
|
}
|
|
}
|
|
],
|
|
"request": {
|
|
"method": "GET",
|
|
"header": [],
|
|
"url": {
|
|
"raw": "{{resq_url}}/api/rider?api_key={{preset_api_key}}",
|
|
"host": [
|
|
"{{resq_url}}"
|
|
],
|
|
"path": [
|
|
"api",
|
|
"rider"
|
|
],
|
|
"query": [
|
|
{
|
|
"key": "api_key",
|
|
"value": "{{preset_api_key}}"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"response": []
|
|
},
|
|
{
|
|
"name": "[Normal] Add Rider Rating",
|
|
"event": [
|
|
{
|
|
"listen": "test",
|
|
"script": {
|
|
"id": "a597d7d6-7b5c-4b30-9163-3cd475343e41",
|
|
"exec": [
|
|
"pm.test(\"Status code is 200\", function () {",
|
|
" pm.response.to.have.status(200);",
|
|
"});",
|
|
"",
|
|
"pm.test(\"Add rider rating\", function () {",
|
|
" var jsonData = pm.response.json();",
|
|
" pm.expect(jsonData.error.status).to.eql(\"success\");",
|
|
"});"
|
|
],
|
|
"type": "text/javascript"
|
|
}
|
|
}
|
|
],
|
|
"request": {
|
|
"method": "POST",
|
|
"header": [],
|
|
"body": {
|
|
"mode": "formdata",
|
|
"formdata": [
|
|
{
|
|
"key": "jo_id",
|
|
"value": "{{jo_id_for_rider_rating}}",
|
|
"type": "text"
|
|
},
|
|
{
|
|
"key": "rating",
|
|
"value": "{{rating}}",
|
|
"type": "text"
|
|
},
|
|
{
|
|
"key": "comment",
|
|
"value": "{{comment}}",
|
|
"type": "text"
|
|
}
|
|
]
|
|
},
|
|
"url": {
|
|
"raw": "{{resq_url}}/api/rider_rating?api_key={{preset_api_key}}",
|
|
"host": [
|
|
"{{resq_url}}"
|
|
],
|
|
"path": [
|
|
"api",
|
|
"rider_rating"
|
|
],
|
|
"query": [
|
|
{
|
|
"key": "api_key",
|
|
"value": "{{preset_api_key}}"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"response": []
|
|
},
|
|
{
|
|
"name": "[Normal] Cancel Job Order",
|
|
"event": [
|
|
{
|
|
"listen": "test",
|
|
"script": {
|
|
"id": "1aca4c3c-353b-406d-b361-99b1b5e5331d",
|
|
"exec": [
|
|
"pm.test(\"Status code is 200\", function () {",
|
|
" pm.response.to.have.status(200);",
|
|
"});",
|
|
"",
|
|
"pm.test(\"Cancel job order\", function () {",
|
|
" var jsonData = pm.response.json();",
|
|
" pm.expect(jsonData.error.status).to.eql(\"success\");",
|
|
"});"
|
|
],
|
|
"type": "text/javascript"
|
|
}
|
|
}
|
|
],
|
|
"request": {
|
|
"method": "POST",
|
|
"header": [],
|
|
"body": {
|
|
"mode": "formdata",
|
|
"formdata": [
|
|
{
|
|
"key": "jo_id",
|
|
"value": "{{jo_id_for_cancel_jo}}",
|
|
"type": "text"
|
|
},
|
|
{
|
|
"key": "reason",
|
|
"value": "{{cancel_reason}}",
|
|
"type": "text"
|
|
}
|
|
]
|
|
},
|
|
"url": {
|
|
"raw": "{{resq_url}}/api/job_order/cancel?api_key={{preset_api_key}}",
|
|
"host": [
|
|
"{{resq_url}}"
|
|
],
|
|
"path": [
|
|
"api",
|
|
"job_order",
|
|
"cancel"
|
|
],
|
|
"query": [
|
|
{
|
|
"key": "api_key",
|
|
"value": "{{preset_api_key}}"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"response": []
|
|
},
|
|
{
|
|
"name": "[Normal] Privacy Settings",
|
|
"event": [
|
|
{
|
|
"listen": "test",
|
|
"script": {
|
|
"id": "080cb4ae-2e6a-4c41-a1a1-1f5993fb1703",
|
|
"exec": [
|
|
"pm.test(\"Status code is 200\", function () {",
|
|
" pm.response.to.have.status(200);",
|
|
"});",
|
|
"",
|
|
"pm.test(\"Privacy settings\", function () {",
|
|
" var jsonData = pm.response.json();",
|
|
" pm.expect(jsonData.error.status).to.eql(\"success\");",
|
|
"});"
|
|
],
|
|
"type": "text/javascript"
|
|
}
|
|
}
|
|
],
|
|
"request": {
|
|
"method": "POST",
|
|
"header": [],
|
|
"body": {
|
|
"mode": "formdata",
|
|
"formdata": [
|
|
{
|
|
"key": "priv_third_party",
|
|
"value": "true",
|
|
"type": "text"
|
|
}
|
|
]
|
|
},
|
|
"url": {
|
|
"raw": "{{resq_url}}/api/privacy?api_key={{api_key}}",
|
|
"host": [
|
|
"{{resq_url}}"
|
|
],
|
|
"path": [
|
|
"api",
|
|
"privacy"
|
|
],
|
|
"query": [
|
|
{
|
|
"key": "api_key",
|
|
"value": "{{api_key}}"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"response": []
|
|
},
|
|
{
|
|
"name": "[Normal] Activate Warranty",
|
|
"event": [
|
|
{
|
|
"listen": "test",
|
|
"script": {
|
|
"id": "4644fedd-befd-4d63-bf49-118ae368e690",
|
|
"exec": [
|
|
"pm.test(\"Status code is 200\", function () {",
|
|
" pm.response.to.have.status(200);",
|
|
"});",
|
|
"",
|
|
"//pm.test(\"Activate warranty\", function () {",
|
|
"// var jsonData = pm.response.json();",
|
|
"// pm.expect(jsonData.error.status).to.eql(\"success\");",
|
|
"//});"
|
|
],
|
|
"type": "text/javascript"
|
|
}
|
|
}
|
|
],
|
|
"request": {
|
|
"method": "POST",
|
|
"header": [],
|
|
"body": {
|
|
"mode": "formdata",
|
|
"formdata": [
|
|
{
|
|
"key": "plate_number",
|
|
"value": "{{plate_num}}",
|
|
"type": "text"
|
|
}
|
|
]
|
|
},
|
|
"url": {
|
|
"raw": "{{resq_url}}/api/activate_warranty?api_key={{api_key}}",
|
|
"host": [
|
|
"{{resq_url}}"
|
|
],
|
|
"path": [
|
|
"api",
|
|
"activate_warranty"
|
|
],
|
|
"query": [
|
|
{
|
|
"key": "api_key",
|
|
"value": "{{api_key}}"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
"response": []
|
|
}
|
|
],
|
|
"event": [
|
|
{
|
|
"listen": "prerequest",
|
|
"script": {
|
|
"id": "2d197aae-8a0c-410b-b188-4f788959d2c2",
|
|
"type": "text/javascript",
|
|
"exec": [
|
|
""
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"listen": "test",
|
|
"script": {
|
|
"id": "050072f2-bd10-4001-a44f-3e486904a34e",
|
|
"type": "text/javascript",
|
|
"exec": [
|
|
""
|
|
]
|
|
}
|
|
}
|
|
],
|
|
"variable": [
|
|
{
|
|
"id": "5d93f375-0011-406c-a88f-a63e2f68488c",
|
|
"key": "resq_url",
|
|
"value": "resq.local",
|
|
"type": "string",
|
|
"disabled": true
|
|
},
|
|
{
|
|
"id": "c5ab2ec9-5fa1-42c0-9b59-a5f39c341c93",
|
|
"key": "phone_model",
|
|
"value": "iPhone8",
|
|
"type": "string"
|
|
},
|
|
{
|
|
"id": "3a5bc033-4298-41f2-a2a6-723af86e8941",
|
|
"key": "os_type",
|
|
"value": "IOS",
|
|
"type": "string"
|
|
},
|
|
{
|
|
"id": "1100e110-9b61-4e86-9e5b-0d2b9ce1d459",
|
|
"key": "os_version",
|
|
"value": "11.4",
|
|
"type": "string"
|
|
},
|
|
{
|
|
"id": "1e79c0c3-a365-48bf-b279-8082e49ab690",
|
|
"key": "phone_id",
|
|
"value": "11376660-F8BF-46ED-B30A-EF3F361EE223",
|
|
"type": "string"
|
|
},
|
|
{
|
|
"id": "72e74248-809b-46d5-a7f8-19132e90ebd4",
|
|
"key": "phone_number",
|
|
"value": "9221111111",
|
|
"type": "string"
|
|
},
|
|
{
|
|
"id": "a9ed9e37-8497-4a6e-885c-e6bc7b90d0a2",
|
|
"key": "first_name",
|
|
"value": "Stiltzkin",
|
|
"type": "string"
|
|
},
|
|
{
|
|
"id": "99f734c3-1b7f-4c38-b1fd-33add5c21e90",
|
|
"key": "last_name",
|
|
"value": "Moogle",
|
|
"type": "string"
|
|
},
|
|
{
|
|
"id": "c4a4859a-fd69-42ac-b6f1-9b745b2e7e1e",
|
|
"key": "mfg_id",
|
|
"value": "1435",
|
|
"type": "string"
|
|
},
|
|
{
|
|
"id": "f6eaa575-52c9-43be-8d1a-e2b6d82155fd",
|
|
"key": "make_id",
|
|
"value": "22043",
|
|
"type": "string"
|
|
},
|
|
{
|
|
"id": "2abf6bbb-35e3-48bf-98b2-c935fa22f809",
|
|
"key": "name",
|
|
"value": "Beetle 1.2 TSI MT (Gas)",
|
|
"type": "string"
|
|
},
|
|
{
|
|
"id": "974d51f3-7de7-4601-aedf-8118534760fd",
|
|
"key": "plate_num",
|
|
"value": "MGL1234",
|
|
"type": "string"
|
|
},
|
|
{
|
|
"id": "302e37a0-de56-4dbb-b04d-51e6cc6ceb67",
|
|
"key": "model_year",
|
|
"value": "2016",
|
|
"type": "string"
|
|
},
|
|
{
|
|
"id": "c2bd2449-d853-4834-8610-2a50e7a2f44b",
|
|
"key": "color",
|
|
"value": "White",
|
|
"type": "string"
|
|
},
|
|
{
|
|
"id": "5e1c7cf7-6c2d-4ccb-a7c7-a57fd9f28cba",
|
|
"key": "condition",
|
|
"value": "Brand New",
|
|
"type": "string"
|
|
},
|
|
{
|
|
"id": "a5f72792-689d-4cf3-889a-57389ce61e10",
|
|
"key": "fuel_type",
|
|
"value": "Gas",
|
|
"type": "string"
|
|
},
|
|
{
|
|
"id": "ad681bc9-dfb5-4c20-8df0-8be64917b87b",
|
|
"key": "wty_code",
|
|
"value": "MKUP0123456",
|
|
"type": "string"
|
|
},
|
|
{
|
|
"id": "b36813a5-50a8-42da-be7a-6a393b7c4029",
|
|
"key": "wty_expire",
|
|
"value": "20201125",
|
|
"type": "string"
|
|
},
|
|
{
|
|
"id": "e2492bad-83af-4c36-b718-e735c615acf5",
|
|
"key": "service_type",
|
|
"value": "battery_new",
|
|
"type": "string"
|
|
},
|
|
{
|
|
"id": "543637fd-dba2-47c7-ad57-17e7514c46e6",
|
|
"key": "trade_in",
|
|
"value": "MOTOLITE",
|
|
"type": "string"
|
|
},
|
|
{
|
|
"id": "4ccd2182-6d87-4293-a471-ec4ea3a36230",
|
|
"key": "longitude",
|
|
"value": "121.018039",
|
|
"type": "string"
|
|
},
|
|
{
|
|
"id": "1af5abab-b961-4123-8ff2-8b6bfd26b64a",
|
|
"key": "latitude",
|
|
"value": "14.606807",
|
|
"type": "string"
|
|
},
|
|
{
|
|
"id": "339b4adb-35ea-4a62-9c18-5e0b4d510dba",
|
|
"key": "warranty",
|
|
"value": "private",
|
|
"type": "string"
|
|
},
|
|
{
|
|
"id": "3011207b-0efe-4990-bf1a-07ac93f0d997",
|
|
"key": "mode_of_payment",
|
|
"value": "CASH",
|
|
"type": "string"
|
|
},
|
|
{
|
|
"id": "906c85a0-d63c-49be-9bad-95a5c3995efa",
|
|
"key": "delivery_address",
|
|
"value": "#123 Moogle Drive",
|
|
"type": "string"
|
|
},
|
|
{
|
|
"id": "9d8631f3-6f4a-4617-b9c6-a891dbdb7080",
|
|
"key": "delivery_instructions",
|
|
"value": "Look for the red bon-bon",
|
|
"type": "string"
|
|
},
|
|
{
|
|
"id": "817cba3e-5a1c-4437-a3a1-a435fb6e2102",
|
|
"key": "promo_id",
|
|
"value": "1",
|
|
"type": "string"
|
|
},
|
|
{
|
|
"id": "830e5413-aede-49d5-96d6-9f9ffd69d362",
|
|
"key": "code",
|
|
"value": "123456",
|
|
"type": "string"
|
|
},
|
|
{
|
|
"id": "5c63ff91-5a46-46a6-bb50-a99fcf9c2469",
|
|
"key": "batt_id",
|
|
"value": "1050",
|
|
"type": "string"
|
|
},
|
|
{
|
|
"id": "df43d18c-da1e-4d1e-a39e-ff497e1e3ade",
|
|
"key": "jo_id_for_rider_rating",
|
|
"value": "4",
|
|
"type": "string"
|
|
},
|
|
{
|
|
"id": "ba2bfbc9-4177-46c9-9bba-a99fa4cf6800",
|
|
"key": "preset_api_key",
|
|
"value": "5d427428b1541",
|
|
"type": "string"
|
|
},
|
|
{
|
|
"id": "35e07ec1-e1ac-42ba-94cb-284fac688eeb",
|
|
"key": "rating",
|
|
"value": "4",
|
|
"type": "string"
|
|
},
|
|
{
|
|
"id": "ab22b498-e2ae-4148-954f-6d3b42e2a8bc",
|
|
"key": "comment",
|
|
"value": "Very professional, kupo!",
|
|
"type": "string"
|
|
},
|
|
{
|
|
"id": "4e7ec753-ab40-4814-8e54-2808a82659f0",
|
|
"key": "jo_id_for_cancel_jo",
|
|
"value": "3",
|
|
"type": "string"
|
|
},
|
|
{
|
|
"id": "be480a65-6da0-48e3-b388-7545d237a123",
|
|
"key": "cancel_reason",
|
|
"value": "No money, kupo!",
|
|
"type": "string"
|
|
}
|
|
]
|
|
} |