Postman/HELLOMobility
Jump to navigation
Jump to search
{
"info": {
"_postman_id": "44630425-bb87-451f-80b3-4e2698f32568",
"name": "Hello API",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"item": [
{
"name": "onboarding",
"item": [
{
"name": "Create sign up request",
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.test(\"Sign up request created\", function () {",
" pm.response.to.have.status(201);",
" var jsonData = pm.response.json();",
" pm.environment.set(\"requestId\", jsonData.id);",
"});"
],
"type": "text/javascript"
}
}
],
"request": {
"auth": {
"type": "noauth"
},
"method": "POST",
"header": [
{
"key": "QUISQUE-APP-ID",
"value": "{{applicationId}}",
"type": "text"
},
{
"key": "QUISQUE-SESSION-ID",
"value": "{{clientSessionId}}",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"firstName\": \"{{$randomFirstName}}\",\n \"lastName\": \"{{$randomLastName}}\",\n \"phoneNumber\": \"+393334443343\"\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{url}}{{api}}{{v1}}/hello/sign-up-requests",
"host": [
"{{url}}{{api}}{{v1}}"
],
"path": [
"hello",
"sign-up-requests"
]
}
},
"response": []
},
{
"name": "Send again PIN code",
"request": {
"auth": {
"type": "noauth"
},
"method": "POST",
"header": [
{
"key": "QUISQUE-APP-ID",
"value": "{{applicationId}}",
"type": "text"
},
{
"key": "QUISQUE-SESSION-ID",
"value": "{{clientSessionId}}",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"firstName\": \"{{$randomFirstName}}\",\n \"lastName\": \"{{$randomLastName}}\",\n \"phoneNumber\": \"{{phoneNumber}\"\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{url}}{{api}}{{v1}}/hello/sign-up-requests",
"host": [
"{{url}}{{api}}{{v1}}"
],
"path": [
"hello",
"sign-up-requests"
]
}
},
"response": []
},
{
"name": "Verify PIN",
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.test(\"Create user\", function () {",
" pm.response.to.have.status(200);",
" pm.environment.set(\"apiKey\", pm.response.json().apiKey);",
"});"
],
"type": "text/javascript"
}
}
],
"request": {
"auth": {
"type": "noauth"
},
"method": "PUT",
"header": [
{
"key": "QUISQUE-APP-ID",
"value": "{{applicationId}}",
"type": "text"
},
{
"key": "QUISQUE-SESSION-ID",
"value": "{{clientSessionId}}",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"pin\": \"{{pin}}\"\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{url}}{{api}}{{v1}}/hello/sign-up-requests/{{requestId}}",
"host": [
"{{url}}{{api}}{{v1}}"
],
"path": [
"hello",
"sign-up-requests",
"{{requestId}}"
]
}
},
"response": []
},
{
"name": "Get sign up request information",
"request": {
"auth": {
"type": "noauth"
},
"method": "GET",
"header": [
{
"key": "QUISQUE-APP-ID",
"value": "{{applicationId}}",
"type": "text"
},
{
"key": "QUISQUE-SESSION-ID",
"value": "{{clientSessionId}}",
"type": "text"
}
],
"url": {
"raw": "{{url}}{{api}}{{v1}}/hello/sign-up-requests/{{requestId}}",
"host": [
"{{url}}{{api}}{{v1}}"
],
"path": [
"hello",
"sign-up-requests",
"{{requestId}}"
]
}
},
"response": []
},
{
"name": "[DEV ONLY] - Get sign up PIN",
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.test(\"PIN received\", function () {",
" pm.response.to.have.status(200);",
" pm.environment.set(\"pin\", pm.response.json().pin);",
"});"
],
"type": "text/javascript"
}
}
],
"request": {
"auth": {
"type": "noauth"
},
"method": "GET",
"header": [
{
"key": "QUISQUE-APP-ID",
"value": "{{applicationId}}",
"type": "text"
}
],
"url": {
"raw": "{{url}}{{api}}{{v1}}/maintenance/phone-number-pin/{{requestId}}",
"host": [
"{{url}}{{api}}{{v1}}"
],
"path": [
"maintenance",
"phone-number-pin",
"{{requestId}}"
]
}
},
"response": []
},
{
"name": "Set password",
"event": [
{
"listen": "test",
"script": {
"exec": [
""
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [
{
"key": "QUISQUE-APP-ID",
"value": "{{applicationId}}",
"type": "text"
},
{
"key": "QUISQUE-SESSION-ID",
"value": "{{clientSessionId}}",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"password\": \"{{$randomPassword}}\"\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{url}}{{api}}{{v2}}/me/password",
"host": [
"{{url}}{{api}}{{v2}}"
],
"path": [
"me",
"password"
]
}
},
"response": []
}
]
},
{
"name": "completamento profilo",
"item": [
{
"name": "Search vehicle information",
"event": [
{
"listen": "test",
"script": {
"exec": [
""
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [
{
"key": "QUISQUE-APP-ID",
"value": "{{applicationId}}",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"licensePlate\": \"ca220ne\"\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{url}}{{api}}{{v1}}/vehicles",
"host": [
"{{url}}{{api}}{{v1}}"
],
"path": [
"vehicles"
]
}
},
"response": []
},
{
"name": "Add vehicle",
"event": [
{
"listen": "test",
"script": {
"exec": [
""
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [
{
"key": "QUISQUE-APP-ID",
"value": "{{applicationId}}",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"licensePlate\": \"ca220ne\",\n \"name\": \"{{$randomFirstName}}\"\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{url}}{{api}}{{v2}}/me/vehicles",
"host": [
"{{url}}{{api}}{{v2}}"
],
"path": [
"me",
"vehicles"
]
}
},
"response": []
}
]
},
{
"name": "Sign In",
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.test(\"Sign in OK\", function () {",
" pm.response.to.have.status(200);",
" pm.environment.set(\"apiKey\", pm.response.json().apiKey);",
"});"
],
"type": "text/javascript"
}
}
],
"request": {
"auth": {
"type": "noauth"
},
"method": "POST",
"header": [
{
"key": "QUISQUE-APP-ID",
"value": "{{applicationId}}",
"type": "text"
},
{
"key": "QUISQUE-SESSION-ID",
"value": "{{clientSessionId}}",
"type": "text"
}
],
"body": {
"mode": "raw",
"raw": "{\n \"username\": \"{{phoneNumber}}\",\n \"password\": \"Hello\"\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{url}}{{api}}{{v2}}/keys",
"host": [
"{{url}}{{api}}{{v2}}"
],
"path": [
"keys"
]
}
},
"response": []
},
{
"name": "Generate sessionId and get configurations",
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.test(\"Session created\", function () {",
" pm.response.to.have.status(200);",
" pm.environment.set(\"clientSessionId\", pm.response.json().sessionId);",
" pm.environment.set(\"url\", pm.response.json().baseUrl);",
"});"
],
"type": "text/javascript"
}
}
],
"request": {
"auth": {
"type": "noauth"
},
"method": "POST",
"header": [
{
"key": "QUISQUE-APP-ID",
"value": "{{applicationId}}",
"type": "text"
},
{
"key": "Accept-Language",
"value": "it",
"type": "text",
"disabled": true
}
],
"body": {
"mode": "raw",
"raw": "{\n \"appName\": \"{{$randomProductName}}\",\n \"appVersion\": \"{{$randomSemver}}\",\n \"os\": \"iOS\",\n \"osVersion\": \"{{$randomSemver}}\",\n \"appBundle\": \"net.hellomobility.whatever\"\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{url}}{{api}}{{v2}}/configurations",
"host": [
"{{url}}{{api}}{{v2}}"
],
"path": [
"configurations"
]
}
},
"response": []
}
],
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{apiKey}}",
"type": "string"
}
]
},
"event": [
{
"listen": "prerequest",
"script": {
"type": "text/javascript",
"exec": [
""
]
}
},
{
"listen": "test",
"script": {
"type": "text/javascript",
"exec": [
""
]
}
}
],
"variable": [
{
"key": "v1",
"value": "/v1"
},
{
"key": "v2",
"value": "/v2"
},
{
"key": "applicationId",
"value": "hellomajvsjnpcmn"
},
{
"key": "api",
"value": "/api"
}
]
}