Docs orders
This commit is contained in:
51
docs/sim-alai/Login.yml
Normal file
51
docs/sim-alai/Login.yml
Normal file
@@ -0,0 +1,51 @@
|
||||
info:
|
||||
name: Login
|
||||
type: http
|
||||
seq: 2
|
||||
|
||||
http:
|
||||
method: POST
|
||||
url: "{{baseurl}}/v1/auth/login"
|
||||
body:
|
||||
type: json
|
||||
data: |-
|
||||
{
|
||||
"username": "{{username}}",
|
||||
"password": "{{password}}",
|
||||
"brandID": "{{brandId}}"
|
||||
}
|
||||
auth: inherit
|
||||
|
||||
runtime:
|
||||
scripts:
|
||||
- type: after-response
|
||||
code: |-
|
||||
const data = res.getBody();
|
||||
|
||||
if (data.staus != 200) {
|
||||
console.error("Error de login: ", data)
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (data && data.accessToken) {
|
||||
|
||||
bru.setEnvVar("alai_token", data.accessToken);
|
||||
|
||||
if (data.tokenType) {
|
||||
bru.setEnvVar("alai_token_type", data.tokenType);
|
||||
}
|
||||
|
||||
console.log("Token guardado correctamente");
|
||||
} else {
|
||||
console.error("No se pudo encontrar el accessToken en la respuesta");
|
||||
}
|
||||
|
||||
settings:
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
followRedirects: true
|
||||
maxRedirects: 5
|
||||
|
||||
docs: |-
|
||||
Necesita un certificado p12 (PFX) y la contraseña asociada para efectuar la operacion.
|
||||
Collection Settings => ClientCertificates => Add Certificate
|
||||
15
docs/sim-alai/New Order.yml
Normal file
15
docs/sim-alai/New Order.yml
Normal file
@@ -0,0 +1,15 @@
|
||||
info:
|
||||
name: New Order
|
||||
type: http
|
||||
seq: 3
|
||||
|
||||
http:
|
||||
method: POST
|
||||
url: "{{baseurl}}/v1/order"
|
||||
auth: inherit
|
||||
|
||||
settings:
|
||||
encodeUrl: true
|
||||
timeout: 0
|
||||
followRedirects: true
|
||||
maxRedirects: 5
|
||||
BIN
docs/sim-alai/certificates/alai_cert.p12
Normal file
BIN
docs/sim-alai/certificates/alai_cert.p12
Normal file
Binary file not shown.
@@ -2,6 +2,6 @@ name: local
|
||||
color: "#2E8A54"
|
||||
variables:
|
||||
- name: baseurl
|
||||
value: http://localhost:3001
|
||||
value: http://localhost:3002
|
||||
- secret: true
|
||||
name: token
|
||||
|
||||
@@ -2,6 +2,12 @@ name: prod
|
||||
color: "#CE4F3B"
|
||||
variables:
|
||||
- name: baseurl
|
||||
value: https://nosconnectcenter-api.iot-x.com
|
||||
value: https://wsaccess.alaisecure.com/bssrest
|
||||
- name: username
|
||||
value: palomaibanez
|
||||
- name: password
|
||||
value: palomaibanez123
|
||||
- secret: true
|
||||
name: token
|
||||
name: certPasswd
|
||||
- name: brandId
|
||||
value: savefamily
|
||||
|
||||
@@ -2,6 +2,22 @@ opencollection: 1.0.0
|
||||
|
||||
info:
|
||||
name: sim-alai
|
||||
config:
|
||||
proxy:
|
||||
inherit: true
|
||||
config:
|
||||
protocol: http
|
||||
hostname: ""
|
||||
port: ""
|
||||
auth:
|
||||
username: ""
|
||||
password: ""
|
||||
bypassProxy: ""
|
||||
clientCertificates:
|
||||
- domain: wsaccess.alaisecure.com
|
||||
type: pkcs12
|
||||
pkcs12FilePath: certificates\alai_cert.p12
|
||||
passphrase: iHaaek+zyzWz6cH6rg==
|
||||
bundled: false
|
||||
extensions:
|
||||
bruno:
|
||||
|
||||
Reference in New Issue
Block a user