Api >

Service Portal REST API

Admin GETs an account
Given I am authenticated as admin
and there is an account with salesforce ID S123456
When I send /api/accounts/S123456
Then I should receive HTTP/1.1 200 OK with following body:
{
  "href": "/api/accounts/S123456",
  "links": [{
    "rel": "sites",
    "href": "/api/accounts/S123456/sites"
  }],
  "data": [{
    "name": "salesForceId",
    "value": "S123456"
  }]
}
Customer cannot GET an account
Given I am authenticated as K0002
and there is an account with salesforce ID existingAccount When I send /api/accounts/existingAccount
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"
}
Missing account
Given I am authenticated as admin
and there is noAccount with salesforce ID notExistingAccount When I send /api/accounts/notExistingAccount
Then I should receive HTTP/1.1 404 Not Found with following body:
{
  "title": "Account not found",
  "detail": "Account with Salesforce ID notExistingAccount not found",
  "described_by": "http://api.nfon.net/probs/account-not-found"
}
System Integrator cannot GET Account
Given I am authenticated as System Integrator S0002
When I send /api/accounts/existingAccount
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"
}
Operator cannot GET Account
Given I am authenticated as Operator C0002
When I send /api/accounts/existingAccount
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"
}