/api/customers/K0002/devices/softphone with application/json; charset=UTF-8 {
"links": [{
"rel": "deviceType",
"href": "/api/customers/K0002/device-types/softphone"
}],
"data": [{
"name": "uniqueIdentifier",
"value": "softphoneTest0123"
}, {
"name": "suppressLineno",
"value": "DEFAULT"
}]
}
Then I should receive HTTP/1.1 201 Created with http://localhost:9998/api/customers/K0002/devices/softphone/softphoneTest0123 {
"href": "/api/customers/K0002/devices/softphone/softphoneTest0123"
}
/api/customers/K0002/devices/softphone/softphoneTest0123 HTTP/1.1 200 OK {
"href": "/api/customers/K0002/devices/softphone/softphoneTest0123",
"links": [{
"rel": "deviceType",
"href": "/api/customers/K0002/device-types/softphone"
}, {
"rel": "site",
"href": "/api/customers/K0002/sites/1"
}, {
"rel": "customer",
"href": "/api/customers/K0002"
}, {
"rel": "activation",
"href": "/api/customers/K0002/devices/softphone/softphoneTest0123/activate"
}, {
"rel": "siteOptions",
"href": "/api/customers/K0002/devices/softphone/softphoneTest0123/site-options"
}],
"data": [{
"name": "uniqueIdentifier",
"value": "softphoneTest0123"
}, {
"name": "active",
"value": true
}, {
"name": "useSiteOptionsFromSite",
"value": true
}, {
"name": "suppressLineno",
"value": "DEFAULT"
}]
}
/api/customers/K0002/devices/softphone with application/json; charset=UTF-8 {
"links": [{
"rel": "deviceType",
"href": "/api/customers/K0002/device-types/softphone"
}],
"data": [{
"name": "uniqueIdentifier",
"value": "softphoneTest0123"
}, {
"name": "note",
"value": "my personal note on post request"
}]
}
Then I should receive HTTP/1.1 201 Created with http://localhost:9998/api/customers/K0002/devices/softphone/softphoneTest0123 {
"href": "/api/customers/K0002/devices/softphone/softphoneTest0123"
}
/api/customers/K0002/devices/softphone/softphoneTest0123 HTTP/1.1 200 OK {
"href": "/api/customers/K0002/devices/softphone/softphoneTest0123",
"links": [{
"rel": "deviceType",
"href": "/api/customers/K0002/device-types/softphone"
}, {
"rel": "site",
"href": "/api/customers/K0002/sites/1"
}, {
"rel": "customer",
"href": "/api/customers/K0002"
}, {
"rel": "activation",
"href": "/api/customers/K0002/devices/softphone/softphoneTest0123/activate"
}, {
"rel": "siteOptions",
"href": "/api/customers/K0002/devices/softphone/softphoneTest0123/site-options"
}],
"data": [{
"name": "uniqueIdentifier",
"value": "softphoneTest0123"
}, {
"name": "active",
"value": true
}, {
"name": "useSiteOptionsFromSite",
"value": true
}, {
"name": "note",
"value": "my personal note on post request"
}]
}
/api/customers/K0003/devices/softphone
with application/json; charset=UTF-8 {
"links": [{
"rel": "deviceType",
"href": "/api/customers/K0003/device-types/softphone"
}, {
"rel": "site",
"href": "/api/customers/K0003/sites/a062000000HbAsd"
}],
"data": [{
"name": "uniqueIdentifier",
"value": "123456789softphone"
}]
}
Then I should receive HTTP/1.1 400 Bad Request
with following body:
{
"errors": [{
"message": "Customer contract type does not allow to add more Devices"
}]
}
/api/customers/K0002/devices/softphone with application/json; charset=UTF-8 {
"links": [{
"rel": "deviceType",
"href": "/api/customers/K0002/device-types/softphone"
}],
"data": [{
"name": "uniqueIdentifier",
"value": "123456789abc"
}]
}
Then I should receive HTTP/1.1 201 Created/api/customers/K0002/devices/softphone with application/json; charset=UTF-8 {
"links": [{
"rel": "deviceType",
"href": "/api/customers/K0002/device-types/softphone"
}],
"data": [{
"name": "uniqueIdentifier",
"value": "123456789abc"
}]
}
Then I should receive HTTP/1.1 400 Bad Request {
"errors": [{
"message": "device id not unique",
"path": "uniqueIdentifier"
}]
}
/api/customers/K0002/devices/softphone with application/json; charset=UTF-8 {
"links": [{
"rel": "deviceType",
"href": "/api/customers/K0002/device-types/softphone"
}],
"data": [{
"name": "uniqueIdentifier",
"value": ""
}]
}
Then I should receive HTTP/1.1 400 Bad Request {
"errors": [{
"message": "device id not defined",
"path": "uniqueIdentifier"
}]
}
/api/customers/K0002/devices/softphone with application/json; charset=UTF-8 {
"links": [{
"rel": "deviceType",
"href": "/api/customers/K0002/device-types/not-existing"
}],
"data": [{
"name": "uniqueIdentifier",
"value": "123456789abc"
}]
}
Then I should receive HTTP/1.1 404 Not Found {
"title": "Device Type not found",
"detail": "Device Type with name not-existing not found",
"described_by": "http://api.nfon.net/probs/device-type-not-found"
}
/api/customers/K0002/devices/softphone with application/json; charset=UTF-8 {
"links": [{
"rel": "deviceType",
"href": "/api/customers/K0002/device-types/base"
}],
"data": [{
"name": "uniqueIdentifier",
"value": "123456789abc"
}]
}
Then I should receive HTTP/1.1 400 Bad Request {
"errors": [{
"message": "Cannot create Softphone Device with type that is not Softphone category",
"path": "deviceType",
"value": "/api/customers/K0002/device-types/base"
}]
}
/api/customers/K0002/devices/softphone with application/json; charset=UTF-8 {
"links": [{
"rel": "deviceType",
"href": "/api/customers/K0002/device-types/softphone"
}, {
"rel": "site",
"href": "/api/customers/K0002/sites/not-existing"
}],
"data": [{
"name": "uniqueIdentifier",
"value": "123456789abc"
}]
}
Then I should receive HTTP/1.1 404 Not Found {
"detail": "Site [not-existing] not found for Customer [K0002]",
"described_by": "http://api.nfon.net/probs/site-not-found"
}
/api/customers/K0002/devices/softphone with application/json; charset=UTF-8 {
"links": [{
"rel": "deviceType",
"href": "/api/customers/K0002/device-types/softphone"
}, {
"rel": "site",
"href": "/api/customers/K0003/sites/anotherSite"
}],
"data": [{
"name": "uniqueIdentifier",
"value": "123456789abc"
}]
}
Then I should receive HTTP/1.1 400 Bad Request {
"errors": [{
"message": "Site not allowed",
"detailMessage": "Site [anotherSite] is not reachable for customer [K0002]",
"path": "site"
}]
}
/api/customers/K0404/devices/softphone
with application/json; charset=UTF-8 {
"links": [{
"rel": "deviceType",
"href": "/api/customers/K0002/device-types/softphone"
}],
"data": [{
"name": "uniqueIdentifier",
"value": "123456789abc"
}]
}
Then I should receive HTTP/1.1 404 Not Found {
"title": "Customer not found",
"detail": "Customer with identifier K0404 has not been found",
"described_by": "http://api.nfon.net/probs/customer-not-found"
}