Facebook
From Smelly Owl, 3 Years ago, written in Ruby.
Embed
Download Paste or View Raw
Hits: 57
  1.  
  2. #LOGIN
  3. curl -X POST \
  4. -H 'cache-control: no-cache' \
  5. https://hp.gestocorp.com/api/v1/login \
  6. -H 'content-type: application/json' \
  7. -d '{"email" : "[email protected]","password" : "trocar123"}'
  8.  
  9. #body
  10. {"email" : "[email protected]","password" : "senha123"}
  11.  
  12.  
  13. ##quando administrator = true usuario pode editar carregamentos listados que contenham load_end preenchido.
  14. #resposta sucesso
  15. {
  16.   "name": "Romulo Danzer",
  17.   "branch_id": 1,
  18.   "email": "[email protected]",
  19.   "administrator": true,
  20.   "auth_token": "_Z8lflknUXtjKcbS1wdpXg"
  21. }
  22.  
  23. #listar carregamentos da filial do usuario balsas
  24.  
  25. #listar carregamentos da filial do usuario balsas
  26. curl -X GET \
  27.   -H 'cache-control: no-cache' \
  28.   https://hp.gestocorp.com/api/v1/ferry_load \
  29.   -H 'content-type: application/json' \
  30.   -d '{"auth_token":"_Z8lflknUXtjKcbS1wdpXg"}'
  31.  
  32. #listar placas carregadas em carregamento
  33.   curl -X GET \
  34.     -H 'cache-control: no-cache' \
  35.     https://hp.gestocorp.com/api/v1/ferry_load/12 \
  36.     -H 'content-type: application/json' \
  37.     -d '{"auth_token":"_Z8lflknUXtjKcbS1wdpXg"}'
  38.  
  39.  
  40. #listar balsas
  41.   curl -X GET \
  42.     -H 'cache-control: no-cache' \
  43.     https://hp.gestocorp.com/api/v1/ferry \
  44.     -H 'content-type: application/json' \
  45.     -d '{"auth_token":"_Z8lflknUXtjKcbS1wdpXg"}'
  46.  
  47. #mostrar balsa unica
  48.       curl -X GET \
  49.         -H 'cache-control: no-cache' \
  50.         https://hp.gestocorp.com/api/v1/ferry/id \
  51.         -H 'content-type: application/json' \
  52.         -d '{"auth_token":"_Z8lflknUXtjKcbS1wdpXg"}'
  53.  
  54.  
  55. #listar filiais
  56.   curl -X GET \
  57.     -H 'cache-control: no-cache' \
  58.     https://hp.gestocorp.com/api/v1/branch \
  59.     -H 'content-type: application/json' \
  60.     -d '{"auth_token":"_Z8lflknUXtjKcbS1wdpXg"}'
  61. #
  62.  
  63. #listar clientes
  64.   curl -X GET \
  65.     -H 'cache-control: no-cache' \
  66.     https://hp.gestocorp.com/api/v1/client \
  67.     -H 'content-type: application/json' \
  68.     -d '{"auth_token":"_Z8lflknUXtjKcbS1wdpXg"}'
  69. #
  70. listar motoristas
  71.     curl -X GET \
  72.       -H 'cache-control: no-cache' \
  73.       https://hp.gestocorp.com/api/v1/driver \
  74.       -H 'content-type: application/json' \
  75.       -d '{"auth_token":"_Z8lflknUXtjKcbS1wdpXg"}'
  76.  
  77. #incluir carretas
  78. curl -X POST \
  79.         -H 'cache-control: no-cache' \
  80.         https://hp.gestocorp.com/api/v1/movimento \
  81.         -H 'content-type: application/json' \
  82.         -d '{"auth_token":"_Z8lflknUXtjKcbS1wdpXg",
  83.        "trailer_id":"900",
  84.        "ferry_load_id":"11",
  85.        "position":"22",
  86.        "client_id":"11",
  87.        "driver_id":"4",
  88.        "photos":"http://foto1.com, http://foto2.com, http://foto3.com",
  89.        "seal":"11",
  90.        "created_at":"2020-10-05 00:00:00"}'
  91.  
  92. # SE SALVO COM sucesso
  93. 'Embarque realizado com sucesso', status: 200
  94. # SE POSICAO JA utilizada
  95. json: "Posição já utilizada", status: 200
  96. # SE CARRETA DUPLICADA
  97. {"trailer_id":["já está em uso"]}
  98.