info: name: Generate an activation label type: http seq: 2 http: method: POST url: "{{baseUrl}}/nfc/generate" body: type: json data: |- { "card_id": "019cdd39-fc08-7417-b16d-a78794a24c01", "override": false } auth: inherit runtime: scripts: - type: tests code: |- test("Should return 200", () => { const body = res.getBody() expect(res.getStatus()).to.equal(200) }) test("Body must include a data field", () => { const body = res.getBody() expect(body.data).to.not.be.undefined }) test("Body should include the label", () => { const body = res.getBody() expect(body.data.label).to.not.be.undefined }) 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: |- { "card_id": "019cd877-ab5f-718c-9d77-3cbf6972e535", "override": false } { "card_id": "019cd877-ab5f-718c-9d77-3cbf6972e535", "override": true } { "card_id": "019cd877-ab5f-718c-9d77-3cbf6972e535", } 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: |- { "card_id": "1234", // no es un uuid valido "override": false } response: status: 422 statusText: Unprocessable Entity headers: - name: Content-Type value: application/json body: type: json data: |- { "error": { "msg": "El campo card_id no es un uuidv7", "field": "card_id" } } - name: 500 Response description: Internal server error request: url: "{{baseUrl}}/nfc/generate" method: POST body: type: json data: |- { "card_id": "", "override": false } response: status: 500 statusText: Internal Server Error body: type: text data: |- { "error": "" }