/api/customers/K0002/contracts with application/json; charset=UTF-8
and body:
{
"data": [{
"name": "name",
"value": "Contract"
}, {
"name": "salesForceId",
"value": "800D0000003ARnKIAW"
}, {
"name": "subId",
"value": 2
}]
}
Then I should receive HTTP/1.1 201 Created with http://localhost:9998/api/customers/K0002/contracts/800D0000003ARnKIAW
and following body:
{
"href": "/api/customers/K0002/contracts/800D0000003ARnKIAW"
}
/api/customers/K0002/contracts/800D0000003ARnKIAW
returns HTTP/1.1 200 OK
with following body:
{
"data": [{
"name": "name",
"value": "Contract"
}, {
"name": "salesForceId",
"value": "800D0000003ARnKIAW"
}, {
"name": "subId",
"value": 2
}]
}
/api/customers/K0002/contracts with application/json; charset=UTF-8
and body:
{
"data": [{
"name": "name",
"value": "New Contract"
}, {
"name": "salesForceId",
"value": "800D0000003ARnKIAW"
}, {
"name": "subId",
"value": 4
}]
}
Then I should receive HTTP/1.1 400 Bad Request
with following body:
{
"described_by": "http://api.nfon.net/probs/duplicated-customer-contract",
"title": "Customer contract exists",
"detail": "Customer K0002 contract with salesForceId 800D0000003ARnKIAW already exists"
}
/api/customers/K0002/contracts/800D0000003ARnKIAW
returns HTTP/1.1 200 OK
with following body:
{
"href": "/api/customers/K0002/contracts/800D0000003ARnKIAW",
"data": [{
"name": "name",
"value": "Contract"
}, {
"name": "salesForceId",
"value": "800D0000003ARnKIAW"
}, {
"name": "subId",
"value": 2
}]
}
/api/customers/K0002/contracts with application/json; charset=UTF-8
and body:
{
"data": [{
"name": "name",
"value": "New Contract"
}, {
"name": "subId",
"value": 4
}]
}
Then I should receive HTTP/1.1 400 Bad Request
with following body:
{
"errors": [{
"message": "may not be null",
"path": "salesForceId"
}]
}
/api/customers/K0002/contracts with application/json; charset=UTF-8
and body:
{
"data": [{
"name": "name",
"value": "New Contract"
}, {
"name": "salesForceId",
"value": "800D0000003ARnKIAW"
}]
}
Then I should receive HTTP/1.1 400 Bad Request
with following body:
{
"errors": [{
"message": "Value must be provided",
"path": "subId"
}]
}
/api/customers/K0002/contracts/800D0000003ARnKIAW
returns HTTP/1.1 404 Not Found
/api/customers/K0002/contracts with application/json; charset=UTF-8
and body:
{
"data": [{
"name": "salesForceId",
"value": "800D0000003ARnKIAW"
}, {
"name": "subId",
"value": 4
}]
}
Then I should receive HTTP/1.1 400 Bad Request
with following body:
{
"errors": [{
"message": "may not be null",
"path": "name"
}]
}
/api/customers/K0002/contracts/800D0000003ARnKIAW
returns HTTP/1.1 404 Not Found
/api/customers/K0002/contracts with application/json; charset=UTF-8
and body:
{
"data": [{
"name": "name",
"value": "New Contract"
}, {
"name": "salesForceId",
"value": "800D0000001INyrCNQ"
}, {
"name": "subId",
"value": 2
}]
}
Then I should receive HTTP/1.1 400 Bad Request
with following body:
{
"errors": [{
"message": "subId must be unique for customer K0002",
"path": "subId",
"value": 2
}]
}
/api/customers/K0002/contracts/800D0000001INyrCNQ
returns HTTP/1.1 404 Not Found
/api/customers/K0002/contracts with application/json; charset=UTF-8
and body:
{
"data": [{
"name": "name",
"value": "Contract"
}, {
"name": "salesForceId",
"value": "800D0000003ARnKIAW"
}, {
"name": "subId",
"value": 4
}]
}
Then I should receive HTTP/1.1 403 Forbidden
and following body:
{
"title": "Access forbidden",
"detail": "Required role is missing",
"described_by": "http://api.nfon.net/probs/invalid-authorization"
}
/api/customers/K0404/contracts application/json; charset=UTF-8
and body:
{
"data": [{
"name": "name",
"value": "Contract"
}, {
"name": "salesForceId",
"value": "800D0000003ARnKIAW"
}, {
"name": "subId",
"value": 4
}]
}
Then I should receive HTTP/1.1 404 Not Found {
"described_by": "http://api.nfon.net/probs/customer-not-found",
"title": "Customer not found",
"detail": "Customer with identifier K0404 has not been found"
}