Files
sf-nfc-server/docs/nfc-server/Generate activation label.yml

114 lines
2.2 KiB
YAML
Raw Normal View History

2026-03-10 15:44:48 +01:00
info:
name: Generate an activation label
type: http
seq: 2
http:
method: POST
url: "{{baseUrl}}/nfc/generate"
body:
type: json
data: |-
{
2026-03-10 16:34:04 +01:00
"card_id": "1234",
2026-03-10 15:44:48 +01:00
"override": false
}
auth: inherit
2026-03-10 16:34:04 +01:00
runtime:
scripts:
- type: tests
code: |-
test("Should return 200", () => {
const body = res.getBody()
expect(res.getStatus()).to.equal(200)
})
test("Body should include the label", () => {
const body = res.getBody()
expect(body.label).to.be.defined()
)}
2026-03-10 15:44:48 +01:00
settings:
encodeUrl: true
timeout: 0
followRedirects: true
maxRedirects: 5
examples:
- name: 200 Response
description: Label generated or reused successfully
request:
url: "{{baseUrl}}/nfc/generate"
method: POST
body:
type: json
data: |-
{
2026-03-10 16:34:04 +01:00
"card_id": "",
2026-03-10 15:44:48 +01:00
"override": false
}
response:
status: 200
statusText: OK
headers:
- name: Content-Type
value: application/json
body:
type: json
data: |-
{
"code": "",
"label": "",
"overriden": false,
"reused": false
}
- name: 422 Response
description: Validation error
request:
url: "{{baseUrl}}/nfc/generate"
method: POST
body:
type: json
data: |-
{
2026-03-10 16:34:04 +01:00
"card_id": "",
2026-03-10 15:44:48 +01:00
"override": false
}
response:
status: 422
statusText: Unprocessable Entity
headers:
- name: Content-Type
value: application/json
body:
type: json
data: |-
{
"error": {
"msg": "",
"field": ""
}
}
- name: 500 Response
description: Internal server error
request:
url: "{{baseUrl}}/nfc/generate"
method: POST
body:
type: json
data: |-
{
2026-03-10 16:34:04 +01:00
"card_id": "",
2026-03-10 15:44:48 +01:00
"override": false
}
response:
status: 500
statusText: Internal Server Error
body:
type: text
2026-03-10 16:34:04 +01:00
data: |-
{
"error": ""
}