The Postman request:


Request configuration

a.-Params

Keyvaluenotes
fileId{{file-id}}the fileId that has been given (by DAS) during a previous transaction

b.- Headers

Standard headers, nothing to update here.


c.- Body

Empty body (this request uses params to pass the info to the api).



d.- Pre-request script

Not used here




e.- Tests script

The following script is executed after the request is sent, to evaluate the response and also to set up environment variables (if they are needed for following requests)

// following test will verify the expected response code for this request

pm.test("Status code is 201", function () {
    pm.response.to.have.status(201);
});

//the following test checks if the system has provided a the Acknowledgement Id for the request
pm.test("requestAckId", function () {
    var jsonData = pm.response.json();
    pm.expect(jsonData.requestAckId).not.eql(undefined);
    if (jsonData.requestAckId !== undefined) {
        console.log("requestAckId:"+jsonData.requestAckId)
        pm.environment.set("request-ack", jsonData.requestAckId);
    }
});
//this tests if the location is provided in the response
pm.test("Location", function () {
    var location = pm.response.headers.get("Location");
    pm.expect(location).not.eql(undefined);
    if (location !== undefined) {
        console.log("location:"+location)
        pm.environment.set("location", location);
    }
});

Expected response

e.- Body

Here is the json response with the details of the registered record. Particularly the request AckId and the status of the request(for this operation, "registration - recorded")


f.- Headers

Normal headers.


g.- Test results

This depends on the test we set up in the test script



  • No labels