monitoring-api/Monitoramento Orius.postman_collection.json
2025-10-15 16:11:28 -03:00

481 lines
No EOL
10 KiB
JSON

{
"info": {
"_postman_id": "2b33c208-e7da-4385-be8d-11875f6867e4",
"name": "Monitoramento Orius",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
"_exporter_id": "32142370"
},
"item": [
{
"name": "User",
"item": [
{
"name": "Autenticação",
"event": [
{
"listen": "test",
"script": {
"exec": [
"const response = pm.response.json();\r",
"\r",
"// Salvando em variáveis da *collection*\r",
"pm.collectionVariables.set(\"BearerToken\", response.data.token);\r",
"\r",
"pm.test(\"Status code é 201 ou 200\", function () {\r",
" pm.expect(pm.response.code).to.be.oneOf([200, 201]);\r",
"});\r",
"\r",
"pm.test(\"Resposta contém ID ou confirmação\", function () {\r",
" const jsonData = pm.response.json();\r",
" pm.expect(jsonData).to.have.any.keys(\"id\", \"message\", \"status\");\r",
"});\r",
"\r",
"pm.test(\"Mensagem indica sucesso\", function () {\r",
" const jsonData = pm.response.json();\r",
" pm.expect(jsonData.message || \"\").to.match(/sucesso|criado|registrado/i);\r",
"});"
],
"type": "text/javascript",
"packages": {},
"requests": {}
}
}
],
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": "{\r\n \"email\": \"dev@oriustecnologia.com.br\",\r\n \"password\": \"123123\"\r\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{BaseUrlV1}}administrativo/user/authenticate",
"host": [
"{{BaseUrlV1}}administrativo"
],
"path": [
"user",
"authenticate"
]
}
},
"response": []
},
{
"name": "Meus dados",
"protocolProfileBehavior": {
"disableBodyPruning": true
},
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{BearerToken}}",
"type": "string"
}
]
},
"method": "GET",
"header": [],
"body": {
"mode": "raw",
"raw": "",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{BaseUrlV1}}administrativo/user/me",
"host": [
"{{BaseUrlV1}}administrativo"
],
"path": [
"user",
"me"
]
}
},
"response": []
},
{
"name": "Lista usuários",
"protocolProfileBehavior": {
"disableBodyPruning": true
},
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{BearerToken}}",
"type": "string"
}
]
},
"method": "GET",
"header": [],
"body": {
"mode": "raw",
"raw": "",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{BaseUrlV1}}administrativo/user",
"host": [
"{{BaseUrlV1}}administrativo"
],
"path": [
"user"
]
}
},
"response": []
},
{
"name": "Cadastra usuário",
"event": [
{
"listen": "test",
"script": {
"exec": [
"const response = pm.response.json();\r",
"\r",
"// Salvando em variáveis da *collection*\r",
"pm.collectionVariables.set(\"userId\", response.data.id);"
],
"type": "text/javascript",
"packages": {},
"requests": {}
}
}
],
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{BearerToken}}",
"type": "string"
}
]
},
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": "{\r\n \"name\": \"{{$randomFullName}}\",\r\n \"email\": \"{{$randomEmail}}\",\r\n \"password\": \"{{password}}\",\r\n \"position\": \"string\",\r\n \"team\": \"{{team}}\",\r\n \"status\": \"\",\r\n \"user_id_create\": 0\r\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{BaseUrlV1}}administrativo/user",
"host": [
"{{BaseUrlV1}}administrativo"
],
"path": [
"user"
]
}
},
"response": []
},
{
"name": "Buscar e-mail",
"protocolProfileBehavior": {
"disableBodyPruning": true
},
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{BearerToken}}",
"type": "string"
}
]
},
"method": "GET",
"header": [],
"body": {
"mode": "raw",
"raw": "",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{BaseUrlV1}}administrativo/user/email?email=Cooper1@gmail.com",
"host": [
"{{BaseUrlV1}}administrativo"
],
"path": [
"user",
"email"
],
"query": [
{
"key": "email",
"value": "Cooper1@gmail.com"
}
]
}
},
"response": []
},
{
"name": "Buscar ID",
"protocolProfileBehavior": {
"disableBodyPruning": true
},
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{BearerToken}}",
"type": "string"
}
]
},
"method": "GET",
"header": [],
"body": {
"mode": "raw",
"raw": "",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{BaseUrlV1}}administrativo/user/{{userId}}",
"host": [
"{{BaseUrlV1}}administrativo"
],
"path": [
"user",
"{{userId}}"
]
}
},
"response": []
},
{
"name": "Atualiza usuário",
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{BearerToken}}",
"type": "string"
}
]
},
"method": "PUT",
"header": [],
"body": {
"mode": "raw",
"raw": "{\r\n \"name\": \"{{$randomFullName}}\",\r\n \"email\": \"{{$randomEmail}}\",\r\n \"password\": \"{{password}}\",\r\n \"position\": \"string\",\r\n \"team\": \"{{team}}\",\r\n \"status\": \"\",\r\n \"user_id_create\": 0\r\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{BaseUrlV1}}administrativo/user/{{userId}}",
"host": [
"{{BaseUrlV1}}administrativo"
],
"path": [
"user",
"{{userId}}"
]
}
},
"response": []
},
{
"name": "Excluir usuário",
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{BearerToken}}",
"type": "string"
}
]
},
"method": "DELETE",
"header": [],
"body": {
"mode": "raw",
"raw": "{\r\n \"name\": \"{{$randomFullName}}\",\r\n \"email\": \"{{$randomEmail}}\",\r\n \"password\": \"{{password}}\",\r\n \"position\": \"string\",\r\n \"team\": \"{{team}}\",\r\n \"status\": \"\",\r\n \"user_id_create\": 0\r\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{BaseUrlV1}}administrativo/user/{{userId}}",
"host": [
"{{BaseUrlV1}}administrativo"
],
"path": [
"user",
"{{userId}}"
]
}
},
"response": []
}
]
},
{
"name": "Log",
"item": [
{
"name": "Lista log's",
"protocolProfileBehavior": {
"disableBodyPruning": true
},
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{BearerToken}}",
"type": "string"
}
]
},
"method": "GET",
"header": [],
"body": {
"mode": "raw",
"raw": "",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{BaseUrlV1}}administrativo/log?first=20&skip=80",
"host": [
"{{BaseUrlV1}}administrativo"
],
"path": [
"log"
],
"query": [
{
"key": "first",
"value": "20"
},
{
"key": "skip",
"value": "80"
}
]
}
},
"response": []
}
]
}
],
"event": [
{
"listen": "prerequest",
"script": {
"type": "text/javascript",
"packages": {},
"requests": {},
"exec": [
"// Lista de valores possíveis\r",
"const passList = [1,2,3,4,5,6];\r",
"\r",
"// Escolhe um valor aleatório\r",
"const randomPassList = passList[Math.floor(Math.random() * passList.length)];\r",
"\r",
"// Armazena como variável da collection\r",
"pm.collectionVariables.set(\"password\", randomPassList);\r",
"\r",
"\r",
"\r",
"// Lista de valores possíveis\r",
"const teamList = [\"Dev\", \"Support\"];\r",
"\r",
"// Escolhe um valor aleatório\r",
"const randomTeamList = teamList[Math.floor(Math.random() * teamList.length)];\r",
"\r",
"// Armazena como variável da collection\r",
"pm.collectionVariables.set(\"team\", randomTeamList);"
]
}
},
{
"listen": "test",
"script": {
"type": "text/javascript",
"packages": {},
"requests": {},
"exec": [
""
]
}
}
],
"variable": [
{
"key": "BaseUrlV1",
"value": ""
},
{
"key": "BearerToken",
"value": ""
},
{
"key": "password",
"value": ""
},
{
"key": "team",
"value": ""
},
{
"key": "userId",
"value": ""
}
]
}