Api >

Service Portal REST API

Admin can access Site Data with account reference
Given I am authenticated as Admin
And there is an Account with SalesForceID account123abc
And there is a Site with SalesForceID site987xyz And with:
  • name set to Site Name
  • street set to Site Street
  • zip set to 00999
  • city set to Berlin
  • country set to DE
  • state set to state
  • azc set to 10
  • ndc set to 987
When I send /api/accounts/account123abc/sites/site987xyz
Then I should receive HTTP/1.1 200 OK
with following body
{
  "href": "/api/accounts/account123abc/sites/site987xyz",
  "links": [],
  "data": [{
    "name": "name",
    "value": "Site Name"
  }, {
    "name": "street",
    "value": "Site Street"
  }, {
    "name": "zip",
    "value": "00999"
  }, {
    "name": "city",
    "value": "Berlin"
  }, {
    "name": "state",
    "value": "state"
  }, {
    "name": "country",
    "value": "DE"
  }, {
    "name": "azc",
    "value": "10"
  }, {
    "name": "ndc",
    "value": "987"
  }]
}
Customer can't access to sites from account context
Given I am authenticated as Customer K0002
When I send /api/accounts/1234/sites/a062000000HbAsd
Then I should receive HTTP/1.1 403 Forbidden
with following body:
{
  "title": "Access forbidden",
  "detail": "Required role is missing",
  "described_by": "http://api.nfon.net/probs/invalid-authorization"
}
Cannot read data for missing Site
Given I am authenticated as Admin
And there is an Account with SalesForceID account123abc
When I send /api/accounts/account123abc/sites/404
Then I should receive HTTP/1.1 404 Not Found
with following body:
{
  "title": "Site not found",
  "detail": "Site with Salesforce ID 404 not found",
  "described_by": "http://api.nfon.net/probs/site-not-found"
}
Missing account
Given I am authenticated as Admin
When I send /api/accounts/404/sites/a062000000HbAsd
Then I should receive HTTP/1.1 404 Not Found
with following body:
{
  "title": "Account not found",
  "detail": "Account with Salesforce ID 404 not found",
  "described_by": "http://api.nfon.net/probs/account-not-found"
}
System Integrator cannot access Site
Given I am authenticated as System Integrator S0002
When I send /api/accounts/1234/sites/a062000000HbAsd
Then I should receive HTTP/1.1 403 Forbidden With following body
{
  "title": "Access forbidden",
  "detail": "Required role is missing"
}
Operator cannot access Site
Given I am authenticated as Operator C0002
When I send /api/accounts/1234/sites/a062000000HbAsd
Then I should receive HTTP/1.1 403 Forbidden With following body
{
  "title": "Access forbidden",
  "detail": "Required role is missing"
}