Api >

Service Portal REST API

Admin should GET Customer Lync Option for Phone Extension
Test setup
Given there is a LyncSite with id 500 and name Lync Site
and there is a Phone Extension with extension number 201
and display name PhoneExtension
which has Inbound Trunk Number +48 (22) 1111-119
Given I am authenticated as Admin
and there is a Lync Option with id 134
When I send /api/customers/K0002/targets/phone-extensions/201/lync/134
Then I should receive HTTP/1.1 200 OK
with following body:
{
  "href": "/api/customers/K0002/targets/phone-extensions/201/lync/134",
  "links": [{
    "rel": "lyncSite",
    "href": "/api/customers/K0002/lync/sites/500"
  }, {
    "rel": "inboundTrunkNumber",
    "href": "/api/customers/K0002/targets/phone-extensions/201/inbound-trunk-numbers/0048.22.1111-119"
  }],
  "data": [{
    "name": "extensionNumber",
    "value": "201"
  }, {
    "name": "inboundNumber",
    "value": "+48 (22) 1111-119"
  }, {
    "name": "lync",
    "value": "Lync Site"
  }]
}
Customer should GET Customer Lync Option for Phone Extension
Test setup
Given there is a LyncSite with id 500 and name Lync Site
and there is a Phone Extension with extension number 201
and display name PhoneExtension
which has Inbound Trunk Number +48 (22) 1111-119
Given I am authenticated as customer K0002
and there is a Lync Option with id 134
When I send /api/customers/K0002/targets/phone-extensions/201/lync/134
Then I should receive HTTP/1.1 200 OK
with following body:
{
  "href": "/api/customers/K0002/targets/phone-extensions/201/lync/134",
  "links": [{
    "rel": "lyncSite",
    "href": "/api/customers/K0002/lync/sites/500"
  }, {
    "rel": "inboundTrunkNumber",
    "href": "/api/customers/K0002/targets/phone-extensions/201/inbound-trunk-numbers/0048.22.1111-119"
  }],
  "data": [{
    "name": "extensionNumber",
    "value": "201"
  }, {
    "name": "inboundNumber",
    "value": "+48 (22) 1111-119"
  }, {
    "name": "lync",
    "value": "Lync Site"
  }]
}
Fail meaningfully when getting Lync Option for not existing Customer
Test setup
Given there is a LyncSite with id 500 and name Lync Site
and there is a Phone Extension with extension number 201
and display name PhoneExtension
which has Inbound Trunk Number +48 (22) 1111-119
Given I am authenticated as Admin
When I ask for lync sites of not existing Customer /api/customers/K0404/targets/phone-extensions/201/lync/134
Then I should receive HTTP/1.1 404 Not Found
And Content-Type header should be application/api-problem+json
with following body:
{
  "title": "Customer not found",
  "detail": "Customer with identifier K0404 has not been found",
  "described_by": "http://api.nfon.net/probs/customer-not-found"
}
Should not get Lync Option for not existing Phone Extension
Test setup
Given there is a LyncSite with id 500 and name Lync Site
and there is a Phone Extension with extension number 201
and display name PhoneExtension
which has Inbound Trunk Number +48 (22) 1111-119
Given I am authenticated as Customer K0002
When I send /api/customers/K0002/targets/phone-extensions/345/lync/134
Then I should receive HTTP/1.1 404 Not Found
And Content-Type header should be application/api-problem+json
with following body:
{
  "title": "Extension not found",
  "detail": "Extension with extension number 345 has not been found",
  "described_by": "http://api.nfon.net/probs/extension-not-found"
}
Should not get not existing Lync Option
Test setup
Given there is a LyncSite with id 500 and name Lync Site
and there is a Phone Extension with extension number 201
and display name PhoneExtension
which has Inbound Trunk Number +48 (22) 1111-119
Given I am authenticated as Customer K0002
When I send /api/customers/K0002/targets/phone-extensions/201/lync/404
Then I should receive HTTP/1.1 404 Not Found
And Content-Type header should be application/api-problem+json
with following body:
{
  "title": "Lync Option not found",
  "detail": "Lync Option with id 404 not found for Phone Extension 201",
  "described_by": "http://api.nfon.net/probs/lync-option-not-found"
}
Customer cannot GET Lync Option for another Customer
Test setup
Given there is a LyncSite with id 500 and name Lync Site
and there is a Phone Extension with extension number 201
and display name PhoneExtension
which has Inbound Trunk Number +48 (22) 1111-119
Given I am authenticated as customer K0003
When I send /api/customers/K0002/targets/phone-extensions/201/lync/134
Then I should receive HTTP/1.1 403 Forbidden
And Content-Type header should be application/api-problem+json
with following body:
{
  "title": "Access forbidden",
  "detail": "Access denied to [Customer] with id [K0002]",
  "described_by": "http://api.nfon.net/probs/invalid-authorization"
}
System Integrator cannot GET Lync Option of Customer, that does not belong to him
Test setup
Given there is a LyncSite with id 500 and name Lync Site
and there is a Phone Extension with extension number 201
and display name PhoneExtension
which has Inbound Trunk Number +48 (22) 1111-119
Given I am authenticated as System Integrator S0002
When I send /api/customers/K0003/targets/phone-extensions/201/lync/134
Then I should receive HTTP/1.1 403 Forbidden
with following body:
{
  "title": "Access forbidden",
  "detail": "Access denied to [Customer] with id [K0003]",
  "described_by": "http://api.nfon.net/probs/invalid-authorization"
}
Operator cannot GET Lync Option of Customer, that does not belong to him
Test setup
Given there is a LyncSite with id 500 and name Lync Site
and there is a Phone Extension with extension number 201
and display name PhoneExtension
which has Inbound Trunk Number +48 (22) 1111-119
Given I am authenticated as Operator C0002
When I send /api/customers/K0003/targets/phone-extensions/201/lync/134
Then I should receive HTTP/1.1 403 Forbidden
with following body:
{
  "title": "Access forbidden",
  "detail": "Access denied to [Customer] with id [K0003]",
  "described_by": "http://api.nfon.net/probs/invalid-authorization"
}