Version 0.0.1
API Terms

Overview

The core api

Auth Service

AssignWorkerRolesInAsg

A command to assign roles to a worker in an ASG

Path /roles/workers/[worker-id]/[application-service-group-id]
Method POST
Headers
Authorization: JWT
Accepts: application/json+ld
Content-Type: application/json+ld
Query Parameters
Request Body
        {
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@graph": [
    {
      "@id": "role/ClinicalManager",
      "@type": "Role"
    },
    {
      "@id": "role/Clinician",
      "@type": "Role"
    }
  ]
}

      
Constraints
http://vocabularies.xenzone.com/xcp-api/0.0.1/AssignWorkerRolesInAsg.schema.json
        {
  "type": "object",
  "properties": {
    "@graph": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "@id": {
            "type": "string"
          },
          "@type": {
            "type": "string"
          }
        },
        "required": [
          "@id",
          "@type"
        ]
      }
    }
  },
  "required": [
    "@graph"
  ]
}
      

Responses

Status code: 201
Response Headers
Response Body
            {
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@graph": [
    {
      "@id": "[event-id]",
      "@type": "WorkerRolesAssignedEvent",
      "atTime": "2018-01-10T16:56:15Z",
      "causedBy": "commands/[command-uuid]"
    },
    {
      "@id": "[worker-id]",
      "@type": "Worker"
    },
    {
      "@id": "YoungPeople",
      "@type": "ApplicationServiceGroup"
    },
    {
      "@id": "ClinicalManager",
      "@type": "Role"
    },
    {
      "@id": "Clinician",
      "@type": "Role"
    }
  ]
}
          
Status code: 400
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity is invalid - [actual information]"
    
    }
		
          
Status code: 401
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The requested resource requires authorization"
    
    }
		
          
Status code: 403
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "You are not authorized to access the resource"
    
    }
		
          
Status code: 409
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity conflicts with an pre-existing entity - [actual information]"
    
    }
		
          
Status code: 500
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "Server error - [actual information]"
    
    }
		
          

Emits

WorkerRolesAssignedEvent
Path: /subscriptions/[service-name]/WorkerRolesAssignedEvent
Method: POST
Body

            {
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@graph": [
    {
      "@id": "[event-id]",
      "@type": "WorkerRolesAssignedEvent",
      "atTime": "2018-01-10T16:56:15Z",
      "causedBy": "commands/[command-uuid]"
    },
    {
      "@id": "[worker-id]",
      "@type": "Worker"
    },
    {
      "@id": "YoungPeople",
      "@type": "ApplicationServiceGroup"
    },
    {
      "@id": "ClinicalManager",
      "@type": "Role"
    },
    {
      "@id": "Clinician",
      "@type": "Role"
    }
  ]
}
          

[#] [back to top]

AuthenticateRefreshToken

OAuth2 Token endpoint following refresh token flow following RFC-6749. Parameter values should be URL-encoded.

Path /token
Method POST
Headers
Accepts: application/json+ld
Content-Type: application/x-www-form-urlencoded
Query Parameters
Request Body
        
grant_type=refresh_token&refresh_token=eyJhbGciO

      

Responses

Status code: 200
Response Headers
Response Body
            
{
    "access_token": "eyJhbGciO...iJIw",
    "token_type": "Bearer",
    "expires_in": 900
}

          
Status code: 400
Response Headers
Response Body
            {
  "error":"invalid_request",
  "error_description": "lorem ipsum",
     }

          

Emits

[#] [back to top]

AuthenticateResourceOwnerCredentials

OAuth2 Token endpoint following resource owner credentials flow following RFC-6749. Parameter values should be URL-encoded.

Path /token
Method POST
Headers
Accepts: application/json+ld
Content-Type: application/x-www-form-urlencoded
Query Parameters
Request Body
        
grant_type=password&username=foobar%7Eemail@example.com&password=pass%21word&scope=applicationServiceGroupId%3Aasg%2FYoungPeople%20applicationId%3A000d1d88-5b43-487e-8ad5-df64794c9e1d

      

Responses

Status code: 200
Response Headers
Response Body
            
{
    "access_token": "eyJhbGciO...iJIw",
    "token_type": "Bearer",
    "expires_in": 900
}

          
Status code: 400
Response Headers
Response Body
            {
  "error":"invalid_request",
  "error_description": "lorem ipsum",
     }

          

Emits

[#] [back to top]

AuthenticateVerificationToken

OAuth2 Token endpoint following custom verification token flow allowed by RFC-6749. Parameter values should be URL-encoded.

Path /token
Method POST
Headers
Accepts: application/json+ld
Content-Type: application/x-www-form-urlencoded
Query Parameters
Request Body
        
grant_type=com.xenzone.verification_token&verification_token=eyJhbGciO

      

Responses

Status code: 200
Response Headers
Response Body
            
{
    "access_token": "eyJhbGciO...iJIw",
    "token_type": "Bearer",
    "expires_in": 900
}

          
Status code: 400
Response Headers
Response Body
            {
  "error":"invalid_request",
  "error_description": "lorem ipsum",
     }

          

Emits

[#] [back to top]

CheckUsernameExists

Checks if a username exists for a service user

Path /credentials/service-users/check-username-exists
Method GET
Headers
Query Parameters
username: pacoelflaco
applicationId: applications/uuid

Responses

Status code: 200
Response Headers
Response Body
            
{
  'exists': true
}

          
Status code: 400
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity is invalid - [actual information]"
    
    }
		
          
Status code: 401
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The requested resource requires authorization"
    
    }
		
          
Status code: 403
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "You are not authorized to access the resource"
    
    }
		
          
Status code: 500
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "Server error - [actual information]"
    
    }
		
          

Emits

[#] [back to top]

CreateServiceUserCredentials

A command to create service-user credentials

Path /credentials/service-users/[service-user-id] or /credentials/service-users/me
Method POST
Headers
Authorization: JWT
Accepts: application/json+ld
Content-Type: application/json+ld
Query Parameters
Request Body
        {
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@type": "UsernamePasswordCredential",
  "password": "Strong password",
  "username": "UseRname"
}
      
Constraints
http://vocabularies.xenzone.com/xcp-api/0.0.1/CreateServiceUserCredentials.schema.json
        {
  "title": "CreateServiceUserCredentials",
  "type": "object",
  "properties": {
    "@type": {
      "type": "string",
    },
    "password": {
      "type": "string",
      "minLength": 8,
      "pattern": "^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[$@$!%*?&])[A-Za-z\d$@$!%*?&]{8,}"
    },
    "username": {
      "type": "string",
      "pattern": "^.+@.+$"
    },
    "active": {
      "type": "boolean",
      "default": true
    }
  },
  "required": [
    "@type",
    "password",
    "username"
  ]
}
      

Responses

Status code: 201
Response Headers
Response Body
            {
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@graph": [
    {
      "@id": "[event-id]",
      "@type": "ServiceUserCredentialsCreatedEvent",
      "atTime": "2018-01-10T16:56:15Z",
      "causedBy": "commands/[command-uuid]"
    }
  ]
}
          
Status code: 400
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity is invalid - [actual information]"
    
    }
		
          
Status code: 401
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The requested resource requires authorization"
    
    }
		
          
Status code: 403
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "You are not authorized to access the resource"
    
    }
		
          
Status code: 409
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity conflicts with an pre-existing entity - [actual information]"
    
    }
		
          
Status code: 500
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "Server error - [actual information]"
    
    }
		
          

Emits

ServiceUserCredentialsCreateFailedEvent
Path: null
Method: null
Body

            {
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@type": "ServiceUserCredentialsCreateFailedEvent", 
  "atTime": "2018-01-05T16:56:15+00:00",
  "causedBy": "commands/[command-uuid]"
}
          
ServiceUserCredentialsCreatedEvent
Path: /subscribers/[service-name]/ServiceUserCredentialsCreatedEvent
Method: null
Body
            {
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@graph": [
    {
      "@id": "[event-id]",
      "@type": "ServiceUserCredentialsCreatedEvent",
      "atTime": "2018-01-10T16:56:15Z",
      "causedBy": "commands/[command-uuid]"
    }
  ]
}
          

[#] [back to top]

CreateWorkerCredentials

A command to create worker credentials

Path /credentials/workers/[worker-id] or /credentials/workers/me
Method POST
Headers
Authorization: JWT
Accepts: application/json+ld
Content-Type: application/json+ld
Query Parameters
Request Body
        {
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@type": "UsernamePasswordCredential",
  "password": "Strong password",
  "username": "UseRname"
}
      
Constraints
http://vocabularies.xenzone.com/xcp-api/0.0.1/CreateWorkerCredentials.schema.json
        {
  "title": "CreateWorkerCredentials",
  "type": "object",
  "properties": {
    "@type": {
      "type": "string",
    },
    "password": {
      "type": "string",
      "minLength": 8,
      "pattern": "^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[$@$!%*?&])[A-Za-z\d$@$!%*?&]{8,}"
    },
    "username": {
      "type": "string",
      "pattern": "^.+@.+$"
    },
    "active": {
      "type": "boolean",
      "default": true
    }
  },
  "required": [
    "@type",
    "password",
    "username"
  ]
}
      

Responses

Status code: 201
Response Headers
Response Body
            {
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@graph": [
    {
      "@id": "[event-id]",
      "@type": "WorkerCredentialsCreatedEvent",
      "atTime": "2018-01-10T16:56:15Z",
      "causedBy": "commands/[command-uuid]"
    }
  ]
}
          
Status code: 400
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity is invalid - [actual information]"
    
    }
		
          
Status code: 401
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The requested resource requires authorization"
    
    }
		
          
Status code: 403
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "You are not authorized to access the resource"
    
    }
		
          
Status code: 409
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity conflicts with an pre-existing entity - [actual information]"
    
    }
		
          
Status code: 500
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "Server error - [actual information]"
    
    }
		
          

Emits

WorkerCredentialsCreatedEvent
Path: /subscribers/[service-name]/WorkerCredentialsCreatedEvent
Method: null
Body

            {
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@graph": [
    {
      "@id": "[event-id]",
      "@type": "WorkerCredentialsCreatedEvent",
      "atTime": "2018-01-10T16:56:15Z",
      "causedBy": "commands/[command-uuid]"
    }
  ]
}
          
WorkerCredentialsCreateFailedEvent
Path: null
Method: null
Body
            
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "atTime": "2018-01-05T16:56:15+00:00"
}

          

[#] [back to top]

GetAssignedWorkerRolesInAsg

A command to get assigned roles for a worker in an ASG

Path /roles/workers/[worker-id]/[application-service-group-id]
Method GET
Headers
Authorization: JWT
Accepts: application/json+ld
Content-Type: application/json+ld
Query Parameters

Responses

Status code: 200
Response Headers
Response Body
            
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@type": "Collection",
  "results": [
    {
      "@id": "ClinicalManager",
      "@type": "Role"
    },
    {
      "@id": "Clinician",
      "@type": "Role"
    }
  ],
  "pagination": {
    "currentPage": 5,
    "perPage": 20,
    "total": 521
  }
}

          
Status code: 400
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity is invalid - [actual information]"
    
    }
		
          
Status code: 401
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The requested resource requires authorization"
    
    }
		
          
Status code: 403
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "You are not authorized to access the resource"
    
    }
		
          
Status code: 404
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity was not found - [actual information]"
    
    }
		
          
Status code: 500
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "Server error - [actual information]"
    
    }
		
          

Emits

[#] [back to top]

GetServiceUserCredentials

Get service user credentials

Path /credentials/service-users
Method GET
Headers
Query Parameters
username: username (required)
applicationId: application id (required)

Responses

Status code: 200
Response Headers
Response Body
            
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@type": "UsernamePasswordCredentials",
  "username": "Username",
  "active": false,
  "privateReason": "They were rude to one of the Workers",
  "publicReason": "They did not follow our acceptable behaviour policies"
}

          
Status code: 400
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity is invalid - [actual information]"
    
    }
		
          
Status code: 401
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The requested resource requires authorization"
    
    }
		
          
Status code: 403
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "You are not authorized to access the resource"
    
    }
		
          
Status code: 500
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "Server error - [actual information]"
    
    }
		
          

Emits

[#] [back to top]

GetServiceUserCredentialsById

Get service user credentials by service user ID

Path /credentials/service-users/[service-user-id] or /credentials/service-users/me
Method GET
Headers
Query Parameters
applicationId: application id (required)

Responses

Status code: 200
Response Headers
Response Body
            
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@type": "UsernamePasswordCredentials",
  "username": "Username",
  "active": false,
  "privateReason": "They were rude to one of the Workers",
  "publicReason": "They did not follow our acceptable behaviour policies"
}

          
Status code: 400
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity is invalid - [actual information]"
    
    }
		
          
Status code: 401
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The requested resource requires authorization"
    
    }
		
          
Status code: 403
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "You are not authorized to access the resource"
    
    }
		
          
Status code: 500
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "Server error - [actual information]"
    
    }
		
          

Emits

[#] [back to top]

UpdateAssignedWorkerRolesInAsg

A command to update assigned roles to a worker in an ASG

Path /roles/workers/[worker-id]/[application-service-group-id]
Method PUT
Headers
Authorization: JWT
Accepts: application/json+ld
Content-Type: application/json+ld
Query Parameters
Request Body
        {
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@graph": [
    {
      "@id": "ClinicalManager",
      "@type": "Role"
    },
    {
      "@id": "Clinician",
      "@type": "Role"
    }
  ]
}

      
Constraints
http://vocabularies.xenzone.com/xcp-api/0.0.1/UpdateAssignedWorkerRolesInAsg.schema.json
        {
  "type": "object",
  "properties": {
    "@graph": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "@id": {
            "type": "string"
          },
          "@type": {
            "type": "string"
          }
        },
        "required": [
          "@id",
          "@type"
        ]
      }
    }
  },
  "required": [
    "@graph"
  ]
}
      

Responses

Status code: 201
Response Headers
Response Body
            {
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@graph": [
    {
      "@id": "[event-id]",
      "@type": "WorkerRolesAssignedEvent",
      "atTime": "2018-01-10T16:56:15Z",
      "causedBy": "commands/[command-uuid]"
    },
    {
      "@id": "[worker-id]",
      "@type": "Worker"
    },
    {
      "@id": "YoungPeople",
      "@type": "ApplicationServiceGroup"
    },
    {
      "@id": "ClinicalManager",
      "@type": "Role"
    },
    {
      "@id": "Clinician",
      "@type": "Role"
    }
  ]
}
          
Status code: 400
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity is invalid - [actual information]"
    
    }
		
          
Status code: 401
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The requested resource requires authorization"
    
    }
		
          
Status code: 403
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "You are not authorized to access the resource"
    
    }
		
          
Status code: 404
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity was not found - [actual information]"
    
    }
		
          
Status code: 500
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "Server error - [actual information]"
    
    }
		
          

Emits

WorkerRolesAssignedEvent
Path: /subscriptions/[service-name]/WorkerRolesAssignedEvent
Method: POST
Body

            {
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@graph": [
    {
      "@id": "[event-id]",
      "@type": "WorkerRolesAssignedEvent",
      "atTime": "2018-01-10T16:56:15Z",
      "causedBy": "commands/[command-uuid]"
    },
    {
      "@id": "[worker-id]",
      "@type": "Worker"
    },
    {
      "@id": "YoungPeople",
      "@type": "ApplicationServiceGroup"
    },
    {
      "@id": "ClinicalManager",
      "@type": "Role"
    },
    {
      "@id": "Clinician",
      "@type": "Role"
    }
  ]
}
          

[#] [back to top]

UpdateServiceUserCredentials

A command to update service-user credentials

Path /credentials/service-users/[service-user-id] or /credentials/service-users/me
Method PUT
Headers
Authorization: JWT
Accepts: application/json+ld
Content-Type: application/json+ld
Query Parameters
Request Body
        {
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@type": "UsernamePasswordCredential",
  "password": "Strong password",
  "active": false,
  "privateReason": "They were rude to one of the Workers",
  "publicReason": "They did not follow our acceptable behaviour policies"
}
      
Constraints
http://vocabularies.xenzone.com/xcp-api/0.0.1/UpdateServiceUserCredentials.schema.json
        {
  "title": "UpdateServiceUserCredentials",
  "type": "object",
  "properties": {
    "@type": {
      "type": "string",
    },
    "password": {
      "type": "string",
      "minLength": 8,
      "pattern": "^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[$@$!%*?&])[A-Za-z\d$@$!%*?&]{8,}"
    },
    "active": {
      "type": "boolean",
      "default": true
    }
  },
  "required": [
    "@type",
    "password"
  ]
}
      

Responses

Status code: 201
Response Headers
Response Body
            {
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@graph": [
    {
      "@id": "[event-id]",
      "@type": "ServiceUserCredentialsUpdatedEvent",
      "atTime": "2018-01-10T16:56:15Z",
      "causedBy": "commands/[command-uuid]"
    }
  ]
}
          
Status code: 400
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity is invalid - [actual information]"
    
    }
		
          
Status code: 401
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The requested resource requires authorization"
    
    }
		
          
Status code: 403
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "You are not authorized to access the resource"
    
    }
		
          
Status code: 404
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity was not found - [actual information]"
    
    }
		
          
Status code: 500
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "Server error - [actual information]"
    
    }
		
          

Emits

ServiceUserCredentialsUpdateFailedEvent
Path: null
Method: null
Body

            {
  "@id": "[event-id]",
  "@type": "ServiceUserCredentialsUpdateFailedEvent",
  "atTime": "2018-01-10T16:56:15Z",
  "causedBy": "commands/[command-uuid]"
}
          
ServiceUserCredentialsUpdatedEvent
Path: /subscribers/[service-name]/ServiceUserCredentialsUpdatedEvent
Method: null
Body
            {
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@graph": [
    {
      "@id": "[event-id]",
      "@type": "ServiceUserCredentialsUpdatedEvent",
      "atTime": "2018-01-10T16:56:15Z",
      "causedBy": "commands/[command-uuid]"
    }
  ]
}
          

[#] [back to top]

UpdateWorkerCredentials

A command to update worker credentials

Path /credentials/workers/[worker-id] or /credentials/workers/me
Method PUT
Headers
Authorization: JWT
Accepts: application/json+ld
Content-Type: application/json+ld
Query Parameters
Request Body
        {
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@type": "UsernamePasswordCredential",
  "password": "Strong password",
  "active": true
}
      
Constraints
http://vocabularies.xenzone.com/xcp-api/0.0.1/UpdateWorkerCredentials.schema.json
        {
  "title": "UpdateWorkerCredentials",
  "type": "object",
  "properties": {
    "@type": {
      "type": "string",
    },
    "password": {
      "type": "string",
      "minLength": 8,
      "pattern": "^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[$@$!%*?&])[A-Za-z\d$@$!%*?&]{8,}"
    },
    "active": {
      "type": "boolean",
      "default": true
    }
  },
  "required": [
    "@type",
    "password"
  ]
}
      

Responses

Status code: 400
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity is invalid - [actual information]"
    
    }
		
          
Status code: 401
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The requested resource requires authorization"
    
    }
		
          
Status code: 403
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "You are not authorized to access the resource"
    
    }
		
          
Status code: 404
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity was not found - [actual information]"
    
    }
		
          
Status code: 500
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "Server error - [actual information]"
    
    }
		
          

Emits

WorkerCredentialsUpdatedEvent
Path: /subscribers/[service-name]/WorkerCredentialsUpdatedEvent
Method: null
Body

            {
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@graph": [
    {
      "@id": "[event-id]",
      "@type": "WorkerCredentialsUpdatedEvent",
      "atTime": "2018-01-10T16:56:15Z",
      "causedBy": "commands/[command-uuid]"
    }
  ]
}
          
WorkerCredentialsUpdateFailedEvent
Path: null
Method: null
Body
            
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "atTime": "2018-01-05T16:56:15+00:00"
}

          

[#] [back to top]

Clinical Service - Commercial

CreateContract

A command to create an application contract for a customer

Path /contracts
Method POST
Headers
Authorization: JWT
Accepts: application/json+ld
Content-Type: application/json+ld
Query Parameters
Request Body
        
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@type": "Contract",
  "name":"contract name",
  "customer": {
    "@type": "Customer",
    "@id": "000d1d88-5b43-487e-8ad5-df64794c9e1d"
  },
  "startDate": "2018-01-10T16:56:15Z",
  "endDate": "2018-01-11T16:56:15Z",
  "effectiveDate": "2018-01-10T16:56:15Z",
  "active": true,
  "coverage": {
    "@type": "Coverage",
    "applicationCoverage" : {
      "@type":"Application",
      "@id": "96593da2-29ec-4d40-9cf1-b8cdbb4a9764"
    },
    "monthlyCounsellingHours" : 12345,
    "monthlyIandPHours" : 12335,
    "monthlyDynamicModerationHours" : 12345,
    "minAge" : 11,
    "maxAge" : 18,
    "faceToFace" : true,
    "subLocation" : [
      { "@type": "SubLocation", "name": "Cambridgeshire"},
      { "@type": "SubLocation", "name": "Lancashire"}
    ]
  },
  "contactName": "Joe Bloggs"
}

      
Constraints
http://vocabularies.xenzone.com/xcp-api/0.0.1/CreateContract.schema.json
        
{
  "title": "CreateContract",
  "type": "object",
  "properties": {
    "@type": { "type": "string", "enum": ["Contract"], "default": "Contract" },
    "name" { "type":"string" },
    "customer": {
      "type": "object",
      "properties": {
        "@type": { "type": "string", "enum": ["Customer"], "default": "Customer" },
        "@id": { "type": "string" }
      },
      "required": ["@id"]
    },
    "startDate": { "type": "string", "minLength": 20, "maxLength": 20 },
    "endDate": { "type": "string", "minLength": 20, "maxLength": 20 },
    "effectiveDate": { "type": "string", "minLength": 20, "maxLength": 20 },
    "active": { "type": "boolean", "default": false },
    "coverage": {
      "type": "object",
      "properties": {
        "@type": { "type": "string" },
        "applicationCoverage": { 
          "type": "object",
          "properties" : {
            "@type": { "type": "string", "enum": ["Application"], "default": "Application" },
            "@id": { "type": "string" }
          },
          "required": ["@id"]
        },
        "monthlyCounsellingHours": { "type": "integer", "min": 0 },
        "monthlyIandPHours": { "type": "integer", "min": 0 },
        "monthlyDynamicModerationHours": { "type": "integer", "min": 0 },
        "minAge": { "type":"number", "min": 1 },
        "maxAge": { "type":"number", "min": 1, "max": 99 },
        "faceToFace": { "type": "boolean" },
        "subLocation" : {
          "type":"array",
          "items": { 
            "type": "object" , 
            "properties": {
              "@type": { "type": "string" },
              "name": { "type": "string" }
            }
          }
        }
      },
      "required": [
        "@type",
        "customer",
        "applicationCoverage",
        "monthlyCounsellingHours",
        "monthlyIandPHours",
        "monthlyDynamicModerationHours",
        "minAge",
        "maxAge",
        "faceToFace"
        "subLocation",
      ]
    },
    "contactName": { "type": "string", "minLength": 1 }
  },          
  "required": [
    "@type",
    "coverage",
    "name",
    "startDate",
    "endDate",
    "effectiveDate",
    "active",
    "contactName"
  ]
}
  
      

Responses

Status code: 201
Response Headers
Response Body
            
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@graph" : [
    {
      "@id": "1411ed16-928a-4110-8149-0244ecfc8403",
      "@type" : "ContractCreatedEvent",
      "causedBy": "commands/5677d224-22c2-4a8f-8b14-60488e762dbf",
      "atTime": "2018-01-10T16:56:15+00:00"
    },
    {
      "@id": "3fdeb8f0-2c82-428d-b685-8353604e34d4",
      "@type": "Contract",
      "name": "Contract name",
      "customer": {
        "@type": "Customer",
        "@id": "000d1d88-5b43-487e-8ad5-df64794c9e1d"
      },
      "startDate": "2018-01-10T16:56:15Z",
      "endDate": "2018-01-11T16:56:15Z",
      "effectiveDate": "2018-01-10T16:56:15Z",
      "active": true,
      "coverage": {
        "@type": "Coverage",
        "applicationCoverage" : {
          "@type": "Application",
          "@id": "96593da2-29ec-4d40-9cf1-b8cdbb4a9764",
        },
        "monthlyCounsellingHours" : 12345,
        "monthlyIandPHours" : 12335,
        "monthlyDynamicModerationHours" : 12345,
        "minAge" : 11,
        "maxAge" : 18,
        "faceToface" : true,
        "subLocation" : [
          { "@type": "SubLocation", "name": "Cambridgeshire" },
          { "@type": "SubLocation", "name": "Lancashire" }
        ],
        "contactName": "Joe Bloggs"
      }
    }
  ]
}

          
Status code: 400
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity is invalid - [actual information]"
    
    }
		
          
Status code: 401
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The requested resource requires authorization"
    
    }
		
          
Status code: 403
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "You are not authorized to access the resource"
    
    }
		
          
Status code: 500
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "Server error - [actual information]"
    
    }
		
          

Emits

ContractCreatedEvent
Path: null
Method: null
Body

            
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@graph" : [
    {
      "@id": "1411ed16-928a-4110-8149-0244ecfc8403",
      "@type" : "ContractCreatedEvent",
      "causedBy": "commands/5677d224-22c2-4a8f-8b14-60488e762dbf",
      "atTime": "2018-01-10T16:56:15+00:00"
    },
    {
      "@id": "3fdeb8f0-2c82-428d-b685-8353604e34d4",
      "@type": "Contract",
      "name": "Contract name",
      "customer": {
        "@type": "Customer",
        "@id": "000d1d88-5b43-487e-8ad5-df64794c9e1d"
      },
      "startDate": "2018-01-10T16:56:15Z",
      "endDate": "2018-01-11T16:56:15Z",
      "effectiveDate": "2018-01-10T16:56:15Z",
      "active": true,
      "coverage": {
        "@type": "Coverage",
        "applicationCoverage" : {
          "@type": "Application",
          "@id": "96593da2-29ec-4d40-9cf1-b8cdbb4a9764",
        },
        "monthlyCounsellingHours" : 12345,
        "monthlyIandPHours" : 12335,
        "monthlyDynamicModerationHours" : 12345,
        "minAge" : 11,
        "maxAge" : 18,
        "faceToface" : true,
        "subLocation" : [
          { "@type": "SubLocation", "name": "Cambridgeshire" },
          { "@type": "SubLocation", "name": "Lancashire" }
        ],
        "contactName": "Joe Bloggs"
      }
    }
  ]
}

          

[#] [back to top]

CreateCustomer

A command to create a customer

Path /customers
Method POST
Headers
Authorization: JWT
Accepts: application/json+ld
Content-Type: application/json+ld
Query Parameters
Request Body
        
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@type": { "@id": "University", "@type": "UniversityCustomer" },
  "name": "customer name",
  "contactName": "the name of a customer contact",
  "emailAddress": "customer email address e.g jack@jill.com",
  "fullAddress": "customers full physical address",
  "telephoneNumber":"123456",
  "organisationRegistration" : "companies house number"
}

      
Constraints
http://vocabularies.xenzone.com/xcp-api/0.0.1/CreateCustomer.schema.json
        
  {
    "title": "CreateCustomer",
    "type": "object",
    "properties": {
      "@type": {
        "type": "object",
        "properties": {
          "@id": {
              "type": "string",
              "enum": [
                "Consumer",
                "Intermediary",
                "LocalAuthority",
                "University"
              ]
          },
          "@type": {
            "type": "string",
            "enum": [
              "ConsumerCustomer",
              "IntermediaryCustomer",
              "LocalAuthorityCustomer",
              "UniversityCustomer"
            ]
          }
        },
        "required": ["@id", "@type"]
      },
      "name": { "type": "string" },
      "contactName": { "type": "string" }
      ,
      "emailAddress": { "type": "string", "format": "email" },
      "fullAddress": { "type": "string" },
      "telephoneNumber": { "type":"string", "format": "phone" },
      "organisationRegistration": { "type":"string" }
    },
    "required": ["@type", "name","contactName","emailAddress","fullAddress","telephoneNumber"]
}
  
      

Responses

Status code: 201
Response Headers
Response Body
            
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@graph" : [
    {"@type" : "CustomerCreatedEvent"},
    {
      "@id": "6de5bb4e-6f81-4f85-82cf-8bca85703fab",
      "@type": "UniversityCustomer",
      "name": "customer name",
      "contactName": "the name of a customer contact",
      "emailAddress": "customer email address",
      "fullAddress": "customers full physical address",
      "telephoneNumber":"customers telephone number",
      "organisationRegistration" : "companies house number"
    }
  ]
}

          
Status code: 400
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity is invalid - [actual information]"
    
    }
		
          
Status code: 401
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The requested resource requires authorization"
    
    }
		
          
Status code: 403
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "You are not authorized to access the resource"
    
    }
		
          
Status code: 500
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "Server error - [actual information]"
    
    }
		
          

Emits

CustomerCreatedEvent
Path: null
Method: null
Body

            
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@graph" : [
    {"@type" : "CustomerCreatedEvent"},
    {
      "@id": "6de5bb4e-6f81-4f85-82cf-8bca85703fab",
      "@type": "UniversityCustomer",
      "name": "customer name",
      "contactName": "the name of a customer contact",
      "emailAddress": "customer email address",
      "fullAddress": "customers full physical address",
      "telephoneNumber":"customers telephone number",
      "organisationRegistration" : "companies house number"
    }
  ]
}

          

[#] [back to top]

DeleteContract

A command to delete a contract

Path /contracts/[id]
Method DELETE
Headers
Authorization: JWT
Accepts: application/json+ld
Content-Type: application/json+ld
Query Parameters

Responses

Status code: 200
Response Headers
Response Body
            
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@graph" : [
    {
      "@id": "5b0c5ae6-10dc-47a5-9dc4-922d14dd0c2f",
      "@type" : "ContractDeletedEvent",
      "causedBy": "commands/beebb503-5be9-410f-a244-a5f374d6d4de",
      "atTime": "2018-01-10T13:38:23.000Z"
    },
    {
      "@context": "https://vocabularies.xenzone.com/context.jsonld",
      "@id": "5b0c5ae6-10dc-47a5-9dc4-922d14dd0c2f",
      "@type": "Contract",
      "name":"contract name",
      "customer": {
        "@type": "Customer",
        "@id": "000d1d88-5b43-487e-8ad5-df64794c9e1d"
      },
      "startDate": "2018-01-10T16:56:15Z",
      "endDate": "2018-01-11T16:56:15Z",
      "effectiveDate": "2018-01-10T16:56:15Z",
      "active": true,
      "coverage": {
        "@type": "Coverage",
        "applicationCoverage" : {
          "@type":"Application",
          "@id": "96593da2-29ec-4d40-9cf1-b8cdbb4a9764"
        },
        "monthlyCounsellingHours" : 12345,
        "monthlyIandPHours" : 12335,
        "monthlyDynamicModerationHours" : 12345,
        "minAge" : 11,
        "maxAge" : 18,
        "faceToFace" : true,
        "subLocation" : [
          { "@type": "SubLocation", "name": "Cambridgeshire" },
          { "@type": "SubLocation", "name": "Lancashire" }
        ]
      },
      "contactName": "Joe Bloggs"
    }
  ]
}

          
Status code: 400
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity is invalid - [actual information]"
    
    }
		
          
Status code: 401
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The requested resource requires authorization"
    
    }
		
          
Status code: 403
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "You are not authorized to access the resource"
    
    }
		
          
Status code: 500
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "Server error - [actual information]"
    
    }
		
          

Emits

ContractDeletedEvent
Path: null
Method: null
Body

            
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@graph" : [
    {
      "@id": "5b0c5ae6-10dc-47a5-9dc4-922d14dd0c2f",
      "@type" : "ContractDeletedEvent",
      "causedBy": "commands/beebb503-5be9-410f-a244-a5f374d6d4de",
      "atTime": "2018-01-10T13:38:23.000Z"
    },
    {
      "@context": "https://vocabularies.xenzone.com/context.jsonld",
      "@id": "5b0c5ae6-10dc-47a5-9dc4-922d14dd0c2f",
      "@type": "Contract",
      "name":"contract name",
      "customer": {
        "@type": "Customer",
        "@id": "000d1d88-5b43-487e-8ad5-df64794c9e1d"
      },
      "startDate": "2018-01-10T16:56:15Z",
      "endDate": "2018-01-11T16:56:15Z",
      "effectiveDate": "2018-01-10T16:56:15Z",
      "active": true,
      "coverage": {
        "@type": "Coverage",
        "applicationCoverage" : {
          "@type":"Application",
          "@id": "96593da2-29ec-4d40-9cf1-b8cdbb4a9764"
        },
        "monthlyCounsellingHours" : 12345,
        "monthlyIandPHours" : 12335,
        "monthlyDynamicModerationHours" : 12345,
        "minAge" : 11,
        "maxAge" : 18,
        "faceToFace" : true,
        "subLocation" : [
          { "@type": "SubLocation", "name": "Cambridgeshire" },
          { "@type": "SubLocation", "name": "Lancashire" }
        ]
      },
      "contactName": "Joe Bloggs"
    }
  ]
}

          

[#] [back to top]

GetApplications

A command to get applications

Path /applications
Method GET
Headers
Authorization: JWT
Accepts: application/json+ld
Content-Type: application/json+ld
Query Parameters

Responses

Status code: 200
Response Headers
Response Body
            
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@type": "Collection",
  "results": [
    {
      "@id": "763fb57f-4186-4d4e-92a1-30c087612c0a",
      "@type": "Application",
      "name": "Kooth",
      "applicationServiceGroup": {
        "@id": "asg/YoungPerson",
        "@type": "ApplicationServiceGroup"
      }
    }
  ]
}
          
Status code: 401
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The requested resource requires authorization"
    
    }
		
          
Status code: 403
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "You are not authorized to access the resource"
    
    }
		
          
Status code: 500
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "Server error - [actual information]"
    
    }
		
          

Emits

[#] [back to top]

GetContract

Get a contract

Path /contracts/[contract-id]
Method GET
Headers
Authorization: JWT
Accepts: application/json+ld
Content-Type: application/json+ld
Query Parameters

Responses

Status code: 200
Response Headers
Response Body
            
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@id": "3fdeb8f0-2c82-428d-b685-8353604e34d4",
  "@type": "Contract",
  "customer": {
    "@type": "Customer",
    "@id": "000d1d88-5b43-487e-8ad5-df64794c9e1d",
    "name": "Customer name"
  },
  "startDate": "2018-01-10T16:56:15Z",
  "endDate": "2018-01-11T16:56:15Z",
  "effectiveDate": "2018-01-10T16:56:15Z",
  "active": true,
  "coverage": {
    "@type": "Coverage",
    "applicationCoverage" : {
      "@type": "Application",
      "@id": "000d1d88-5b43-487e-8ad5-df64794c9e1d",
    },
    "monthlyCounsellingHours" : 12345,
    "monthlyIandPHours" : 12335,
    "monthlyDynamicModerationHours" : 12345,
    "minAge" : 11,
    "maxAge" : 18,
    "faceToface" : true,
    "subLocation" : [
      { "@type": "SubLocation", "name": "Cambridgeshire" },
      { "@type": "SubLocation", "name": "Lancashire" }
    ],
    "contactName": "Joe Bloggs"
  }
}

          
Status code: 400
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity is invalid - [actual information]"
    
    }
		
          
Status code: 401
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The requested resource requires authorization"
    
    }
		
          
Status code: 403
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "You are not authorized to access the resource"
    
    }
		
          
Status code: 500
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "Server error - [actual information]"
    
    }
		
          

Emits

[#] [back to top]

GetContracts

Get all contracts

Path /contracts/
Method GET
Headers
Authorization: JWT
Accepts: application/json+ld
Content-Type: application/json+ld
Query Parameters
applicationId: application id
applicationServiceGroupId: application service group id
customerId: the customer id to filter by
startDate: the minimum contract start date
endDate: the maximum contract end date
search: the search to filter by (will filter contract name and contact name)
active: Will filter whether the contract is active or not
perPage: number of results per page
page: page of results to fetch

Responses

Status code: 200
Response Headers
Response Body
            
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@type": "Collection",
  "results": [
    {
      "@id": "3fdeb8f0-2c82-428d-b685-8353604e34d4",
      "@type": "Contract",
      "customer": {
        "@type": "Customer",
        "@id": "000d1d88-5b43-487e-8ad5-df64794c9e1d",
        "name": "Customer name"
      },
      "startDate": "2018-01-10T16:56:15Z",
      "endDate": "2018-01-11T16:56:15Z",
      "effectiveDate": "2018-01-10T16:56:15Z",
      "active": true,
      "coverage": {
        "@type": "Coverage",
        "applicationCoverage" : {
          "@type": "Application",
          "@id": "000d1d88-5b43-487e-8ad5-df64794c9e1d",
        },
        "monthlyCounsellingHours" : 12345,
        "monthlyIandPHours" : 12335,
        "monthlyDynamicModerationHours" : 12345,
        "minAge" : 11,
        "maxAge" : 18,
        "faceToface" : true,
        "subLocation" : [
          { "@type": "SubLocation", "name": "Cambridgeshire" },
          { "@type": "SubLocation", "name": "Lancashire" }
        ],
        "contactName": "Joe Bloggs"
      }
    },
    {
      "@id": "3fdeb8f0-2c82-428d-b685-8353604e34d5",
      "@type": "Contract",
      "customer": {
        "@type": "Customer",
        "@id": "000d1d88-5b43-487e-8ad5-df64794c9e1d",
        "name": "Customer name 2"
      },
      "startDate": "2018-01-10T16:56:15Z",
      "endDate": "2018-01-11T16:56:15Z",
      "effectiveDate": "2018-01-10T16:56:15Z",
      "active": true,
      "coverage": {
        "@type": "Coverage",
        "applicationCoverage" : {
          "@type": "Application",
          "@id": "000d1d88-5b43-487e-8ad5-df64794c9e1d",
        },
        "monthlyCounsellingHours" : 12345,
        "monthlyIandPHours" : 12335,
        "monthlyDynamicModerationHours" : 12345,
        "minAge" : 11,
        "maxAge" : 18,
        "faceToface" : true,
        "subLocation" : [
          { "@type": "SubLocation", "name": "Cambridgeshire" },
          { "@type": "SubLocation", "name": "Lancashire" }
        ],
        "contactName": "Joe Bloggs"
      }
    }
  ],
  "pagination": 
  {
      "currentPage": 5,
      "perPage": 20,
      "total": 521
  }
}

          
Status code: 400
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity is invalid - [actual information]"
    
    }
		
          
Status code: 401
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The requested resource requires authorization"
    
    }
		
          
Status code: 403
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "You are not authorized to access the resource"
    
    }
		
          
Status code: 500
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "Server error - [actual information]"
    
    }
		
          

Emits

[#] [back to top]

GetCustomer

A command to create a customer

Path /customers/[customer-id]/
Method GET
Headers
Authorization: JWT
Accepts: application/json+ld
Content-Type: application/json+ld
Query Parameters

Responses

Status code: 200
Response Headers
Response Body
            
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@id": "6de5bb4e-6f81-4f85-82cf-8bca85703fab",
  "@type": "UniversityCustomer",
  "name": "customer name",
  "contactName": "the name of a customer contact",
  "emailAddress": "customer email address",
  "fullAddress": "customers full physical address",
  "telephoneNumber":"customers telephone number",
  "organisationRegistration" : "companies house number"
    
}

          
Status code: 400
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity is invalid - [actual information]"
    
    }
		
          
Status code: 401
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The requested resource requires authorization"
    
    }
		
          
Status code: 403
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "You are not authorized to access the resource"
    
    }
		
          
Status code: 500
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "Server error - [actual information]"
    
    }
		
          

Emits

CustomerCreatedEvent
Path: null
Method: null
Body

            
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@graph" : [
    {"@type" : "CustomerCreatedEvent"},
    {
      "@id": "6de5bb4e-6f81-4f85-82cf-8bca85703fab",
      "@type": "UniversityCustomer",
      "name": "customer name",
      "contactName": "the name of a customer contact",
      "emailAddress": "customer email address",
      "fullAddress": "customers full physical address",
      "telephoneNumber":"customers telephone number",
      "organisationRegistration" : "companies house number"
    }
  ]
}

          

[#] [back to top]

GetCustomers

Get customers, with search

Path /customers
Method GET
Headers
Authorization: JWT
Accepts: application/json+ld
Content-Type: application/json+ld
Query Parameters
name: the customer name

Responses

Status code: 200
Response Headers
Response Body
            
{

  
  {
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Collection",
    "results": [
      {"@type": "Customer", "name" : "customer name" "@id":"6de5bb4e-6f81-4f85-82cf-8bca85703fab"},
      {"@type": "Customer", "name" : "customer two" "@id":"6de5bb4e-6f81-4f85-82cf-8bca85703fac"}
    ],
    "pagination": 
    {
        "currentPage": 5,
        "perPage": 20,
        "total": 521
    }
  }
  
}



          
Status code: 400
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity is invalid - [actual information]"
    
    }
		
          
Status code: 401
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The requested resource requires authorization"
    
    }
		
          
Status code: 403
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "You are not authorized to access the resource"
    
    }
		
          
Status code: 500
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "Server error - [actual information]"
    
    }
		
          

Emits

[#] [back to top]

UpdateContract

A command to update a contract

Path /contracts/[id]
Method PUT
Headers
Authorization: JWT
Accepts: application/json+ld
Content-Type: application/json+ld
Query Parameters
Request Body
        
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@id": "5b0c5ae6-10dc-47a5-9dc4-922d14dd0c2f",
  "@type": "Contract",
  "name":"contract name",
  "customer": {
    "@type": "Customer",
    "@id": "000d1d88-5b43-487e-8ad5-df64794c9e1d"
  },
  "startDate": "2018-01-10T16:56:15Z",
  "endDate": "2018-01-11T16:56:15Z",
  "effectiveDate": "2018-01-10T16:56:15Z",
  "active": true,
  "coverage": {
    "@type": "Coverage",
    "applicationCoverage" : {
      "@type":"Application",
      "@id": "96593da2-29ec-4d40-9cf1-b8cdbb4a9764"
    },
    "monthlyCounsellingHours" : 12345,
    "monthlyIandPHours" : 12335,
    "monthlyDynamicModerationHours" : 12345,
    "minAge" : 11,
    "maxAge" : 18,
    "faceToFace" : true,
    "subLocation" : [
      { "@type": "SubLocation", "name": "Cambridgeshire" },
      { "@type": "SubLocation", "name": "Lancashire" }
    ]
  },
  "contactName": "Joe Bloggs"
}

      
Constraints
http://vocabularies.xenzone.com/xcp-api/0.0.1/UpdateContract.schema.json
        
{
  "title": "UpdateContract",
  "type": "object",
  "properties": {
    "@type": { "type": "string", "enum": ["Contract"], "default": "Contract" },
    "name" { "type":"string" },
    "customer": {
      "type": "object",
      "properties": {
        "@type": { "type": "string", "enum": ["Customer"], "default": "Customer" },
        "@id": { "type": "string" }
      },
      "required": ["@id"]
    },
    "startDate": { "type": "string", "minLength": 20, "maxLength": 20 },
    "endDate": { "type": "string", "minLength": 20, "maxLength": 20 },
    "effectiveDate": { "type": "string", "minLength": 20, "maxLength": 20 },
    "active": { "type": "boolean", "default": false },
    "coverage": {
      "type": "object",
      "properties": {
        "@type": { "type": "string" },
        "applicationCoverage": { 
          "type": "object",
          "properties" : {
            "@type": { "type": "string", "enum": ["Application"], "default": "Application" },
            "@id": { "type": "string" }
          },
          "required": ["@id"]
        },
        "monthlyCounsellingHours": { "type": "integer", "min": 0 },
        "monthlyIandPHours": { "type": "integer", "min": 0 },
        "monthlyDynamicModerationHours": { "type": "integer", "min": 0 },
        "minAge": { "type":"number", "min": 1 },
        "maxAge": { "type":"number", "min": 1, "max": 99 },
        "faceToFace": { "type": "boolean" },
        "subLocation" : {
          "type":"array",
          "items": { 
            "type": "object" , 
            "properties": {
              "@type": { "type": "string" },
              "name": { "type": "string" }
            }
          }
        }
      },
      "required": [
        "@type",
        "customer",
        "applicationCoverage",
        "monthlyCounsellingHours",
        "monthlyIandPHours",
        "monthlyDynamicModerationHours",
        "minAge",
        "maxAge",
        "faceToFace"
        "subLocation",
      ]
    },
    "contactName": { "type": "string", "minLength": 1 }
  },          
  "required": [
    "@type",
    "coverage",
    "name",
    "startDate",
    "endDate",
    "effectiveDate",
    "active",
    "contactName"
  ]
}
  
      

Responses

Status code: 200
Response Headers
Response Body
            
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@graph" : [
    {
      "@id": "5b0c5ae6-10dc-47a5-9dc4-922d14dd0c2f",
      "@type" : "ContractUpdatedEvent",
      "causedBy": "commands/beebb503-5be9-410f-a244-a5f374d6d4de",
      "atTime": "2018-01-10T13:38:23.000Z"
    },
    {
      "@context": "https://vocabularies.xenzone.com/context.jsonld",
      "@id": "5b0c5ae6-10dc-47a5-9dc4-922d14dd0c2f",
      "@type": "Contract",
      "name":"contract name",
      "customer": {
        "@type": "Customer",
        "@id": "000d1d88-5b43-487e-8ad5-df64794c9e1d"
      },
      "startDate": "2018-01-10T16:56:15Z",
      "endDate": "2018-01-11T16:56:15Z",
      "effectiveDate": "2018-01-10T16:56:15Z",
      "active": true,
      "coverage": {
        "@type": "Coverage",
        "applicationCoverage" : {
          "@type":"Application",
          "@id": "96593da2-29ec-4d40-9cf1-b8cdbb4a9764"
        },
        "monthlyCounsellingHours" : 12345,
        "monthlyIandPHours" : 12335,
        "monthlyDynamicModerationHours" : 12345,
        "minAge" : 11,
        "maxAge" : 18,
        "faceToFace" : true,
        "subLocation" : [
          { "@type": "SubLocation", "name": "Cambridgeshire" },
          { "@type": "SubLocation", "name": "Lancashire" }
        ]
      },
      "contactName": "Joe Bloggs"
    }
  ]
}

          
Status code: 400
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity is invalid - [actual information]"
    
    }
		
          
Status code: 401
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The requested resource requires authorization"
    
    }
		
          
Status code: 403
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "You are not authorized to access the resource"
    
    }
		
          
Status code: 500
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "Server error - [actual information]"
    
    }
		
          

Emits

ContractUpdatedEvent
Path: null
Method: null
Body

            
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@graph" : [
    {
      "@id": "5b0c5ae6-10dc-47a5-9dc4-922d14dd0c2f",
      "@type" : "ContractUpdatedEvent",
      "causedBy": "commands/beebb503-5be9-410f-a244-a5f374d6d4de",
      "atTime": "2018-01-10T13:38:23.000Z"
    },
    {
      "@context": "https://vocabularies.xenzone.com/context.jsonld",
      "@id": "5b0c5ae6-10dc-47a5-9dc4-922d14dd0c2f",
      "@type": "Contract",
      "name":"contract name",
      "customer": {
        "@type": "Customer",
        "@id": "000d1d88-5b43-487e-8ad5-df64794c9e1d"
      },
      "startDate": "2018-01-10T16:56:15Z",
      "endDate": "2018-01-11T16:56:15Z",
      "effectiveDate": "2018-01-10T16:56:15Z",
      "active": true,
      "coverage": {
        "@type": "Coverage",
        "applicationCoverage" : {
          "@type":"Application",
          "@id": "96593da2-29ec-4d40-9cf1-b8cdbb4a9764"
        },
        "monthlyCounsellingHours" : 12345,
        "monthlyIandPHours" : 12335,
        "monthlyDynamicModerationHours" : 12345,
        "minAge" : 11,
        "maxAge" : 18,
        "faceToFace" : true,
        "subLocation" : [
          { "@type": "SubLocation", "name": "Cambridgeshire" },
          { "@type": "SubLocation", "name": "Lancashire" }
        ]
      },
      "contactName": "Joe Bloggs"
    }
  ]
}

          

[#] [back to top]

UpdateCustomer

A command to update a customer

Path /customers/[id]
Method PUT
Headers
Authorization: JWT
Accepts: application/json+ld
Content-Type: application/json+ld
Query Parameters
Request Body
        
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@type": { "@id": "University", "@type": "UniversityCustomer" },
  "name": "customer name",
  "contactName": "the name of a customer contact",
  "emailAddress": "customer email address e.g jack@jill.com",
  "fullAddress": "customers full physical address",
  "telephoneNumber":"123456",
  "organisationRegistration" : "companies house number"
}

      
Constraints
http://vocabularies.xenzone.com/xcp-api/0.0.1/UpdateCustomer.schema.json
        
  {
    "title": "UpdateCustomer",
    "type": "object",
    "properties": {
      "@id": { "type": "string" },
      "@type": {
        "type": "object",
        "properties": {
          "@id": {
              "type": "string",
              "enum": [
                "Consumer",
                "Intermediary",
                "LocalAuthority",
                "University"
              ]
          },
          "@type": {
            "type": "string",
            "enum": [
              "ConsumerCustomer",
              "IntermediaryCustomer",
              "LocalAuthorityCustomer",
              "UniversityCustomer"
            ]
          }
        },
        "required": ["@id", "@type"]
      },
      "name": { "type": "string" },
      "contactName": { "type": "string" }
      ,
      "emailAddress": { "type": "string", "format": "email" },
      "fullAddress": { "type": "string" },
      "telephoneNumber": { "type":"string", "format": "phone" },
      "organisationRegistration": { "type":"string" }
    },
    "required": ["@type", "name","contactName","emailAddress","fullAddress","telephoneNumber"]
  
      

Responses

Status code: 200
Response Headers
Response Body
            
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@graph" : [
    {"@type" : "CustomerCreatedEvent"},
    {
      "@id": "6de5bb4e-6f81-4f85-82cf-8bca85703fab",
      "@type": "UniversityCustomer",
      "name": "customer name",
      "contactName": "the name of a customer contact",
      "emailAddress": "customer email address",
      "fullAddress": "customers full physical address",
      "telephoneNumber":"customers telephone number",
      "organisationRegistration" : "companies house number"
    }
  ]
}

          
Status code: 400
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity is invalid - [actual information]"
    
    }
		
          
Status code: 401
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The requested resource requires authorization"
    
    }
		
          
Status code: 403
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "You are not authorized to access the resource"
    
    }
		
          
Status code: 500
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "Server error - [actual information]"
    
    }
		
          

Emits

CustomerUpdatedEvent
Path: null
Method: null
Body

            
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@graph" : [
    {"@type" : "CustomerCreatedEvent"},
    {
      "@id": "6de5bb4e-6f81-4f85-82cf-8bca85703fab",
      "@type": "UniversityCustomer",
      "name": "customer name",
      "contactName": "the name of a customer contact",
      "emailAddress": "customer email address",
      "fullAddress": "customers full physical address",
      "telephoneNumber":"customers telephone number",
      "organisationRegistration" : "companies house number"
    }
  ]
}

          

[#] [back to top]

Clinical Service - Service Users

AnswerClinicalQuestionnaire

Updates answers for a clinical questionnaire

Path /clinical-questionnaires/[clinical-questionnaire-id]
Method POST
Headers
Query Parameters
Request Body
        
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "answers": [
    {
      "@type": "ClinicalAnswer",
      "questionId": "how-are-you",
      "answerId": "notbad"
    }
  ]
}

      
Constraints
http://vocabularies.xenzone.com/xcp-api/0.0.1/AnswerClinicalQuestionnaire.schema.json
        
{
  "type": "object",
  "properties": {
    "@context": {
      "type": "string",
      "examples": [
        "https://vocabularies.xenzone.com/context.jsonld"
      ]
    },
    "answers": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "questionId": {
            "type": "string",
            "examples": [
              "how-are-you"
            ]
          },
          "answerId": {
            "type": "string",
            "examples": [
              "notbad"
            ]
          }
        },
        "required": [
          "questionId",
          "answerId"
        ]
      }
    }
  },
  "required": [
    "@context",
    "answers"
  ]
}

  
      

Responses

Status code: 200
Response Headers
Response Body
            
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@graph": [
    {
      "@id": "[event-id]",
      "@type": "ClinicalQuestionnaireAnsweredEvent",
      "atTime": "2018-01-10T16:56:15Z",
      "causedBy": "commands/[command-uuid]"
    },
    {
      "@id": "[clinical-questionnaire-id]",
      "@type": "ClinicalQuestionnaireCoreYp",
      "answers": [
        {
          "@type": "ClinicalAnswer",
          "questionId": "how-are-you",
          "answerId": "notbad"
        },
        {
          "@type": "ClinicalAnswer",
          "questionId": "pet",
          "answerId": ""
        }
      ]
    }
  ]
}

          
Status code: 400
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity is invalid - [actual information]"
    
    }
		
          
Status code: 401
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The requested resource requires authorization"
    
    }
		
          
Status code: 403
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "You are not authorized to access the resource"
    
    }
		
          
Status code: 500
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "Server error - [actual information]"
    
    }
		
          

Emits

ClinicalQuestionnaireAnsweredEvent
Path: null
Method: null
Body

            
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@graph": [
    {
      "@id": "[event-id]",
      "@type": "ClinicalQuestionnaireAnsweredEvent",
      "atTime": "2018-01-10T16:56:15Z",
      "causedBy": "commands/[command-uuid]"
    },
    {
      "@id": "[clinical-questionnaire-id]",
      "@type": "ClinicalQuestionnaireCoreYp",
      "answers": [
        {
          "@type": "ClinicalAnswer",
          "questionId": "how-are-you",
          "answerId": "notbad"
        },
        {
          "@type": "ClinicalAnswer",
          "questionId": "pet",
          "answerId": ""
        }
      ]
    }
  ]
}

          

[#] [back to top]

CompleteClinicalQuestionnaire

Complete a pending clinical questionnaire

Path /clinical-questionnaires/[clinical-questionnaire-id]/complete
Method POST
Headers
Query Parameters

Responses

Status code: 201
Response Headers
Response Body
            
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@graph": [
    {
      "@id": "[event-id]",
      "@type": "ClinicalQuestionnaireCompletedEvent",
      "atTime": "2018-01-10T16:56:15Z",
      "causedBy": "commands/[command-uuid]"
    },
    {
      "@id": "[clinical-questionnaire-id]",
      "@type": "ClinicalQuestionnaireEos",
      "status": "completed"
    }
  ]
}

          
Status code: 400
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity is invalid - [actual information]"
    
    }
		
          
Status code: 401
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The requested resource requires authorization"
    
    }
		
          
Status code: 403
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "You are not authorized to access the resource"
    
    }
		
          
Status code: 500
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "Server error - [actual information]"
    
    }
		
          

Emits

ClinicalQuestionnaireCompletedEvent
Path: null
Method: null
Body

            
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@graph": [
    {
      "@id": "[event-id]",
      "@type": "ClinicalQuestionnaireCompletedEvent",
      "atTime": "2018-01-10T16:56:15Z",
      "causedBy": "commands/[command-uuid]"
    },
    {
      "@id": "[clinical-questionnaire-id]",
      "@type": "ClinicalQuestionnaireEos",
      "status": "completed"
    }
  ]
}

          

[#] [back to top]

CreateClinicalJournal

Create a new clinical journal

Path /service-users/:serviceUserId/clinical-journals
Method POST
Headers
Authorization: JWT
Accepts: application/json+ld
Content-Type: application/json+ld
Query Parameters
serviceUserId: Service user id creating the journal
applicationId: application id
Request Body
        
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@type": "ClinicalJournal",
  "reason": "a reason",
  "emoji": ":)"
}

      
Constraints
http://vocabularies.xenzone.com/xcp-api/0.0.1/CreateClinicalJournal.schema.json
        
{
  "$id": "http://example.com/example.json", 
  "type": "object", 
  "definitions": {},
  "$schema": "http://json-schema.org/draft-07/schema#", 
  "additionalProperties": false,
  "properties": {
    "@context": {
      "type": "string"
    },
    "@type": {
      "type": "string"
    },
    "reason": {
      "type": "string"
    }, 
    "emoji": {
      "type": "string"
    }
  }, 
  "required": [
    "@context", 
    "@type",
    "emoji"
  ]
}

  
      

Responses

Status code: 201
Response Headers
Response Body
            
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@graph": [
    {
      "@id": "d71c7f3c-8010-4784-a42f-cf01b00bbb40",
      "@type": "JournalCreatedEvent",
      "causedBy": "commands/eae05306-9134-4d5a-83bc-00ff35a0049d",
      "atTime": "2018-03-08T16:13:51.141Z"
    },
    {
      "@id": "[clinical-journal-id]",
      "@type": "ClinicalJournal",
    }
  ]
}

          
Status code: 400
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity is invalid - [actual information]"
    
    }
		
          
Status code: 401
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The requested resource requires authorization"
    
    }
		
          
Status code: 403
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "You are not authorized to access the resource"
    
    }
		
          
Status code: 500
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "Server error - [actual information]"
    
    }
		
          

Emits

ClinicalJournalCreatedEvent
Path: null
Method: null
Body

            
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@graph": [
    {
      "@id": "d71c7f3c-8010-4784-a42f-cf01b00bbb40",
      "@type": "JournalCreatedEvent",
      "causedBy": "commands/eae05306-9134-4d5a-83bc-00ff35a0049d",
      "atTime": "2018-03-08T16:13:51.141Z"
    },
    {
      "@id": "[clinical-journal-id]",
      "@type": "ClinicalJournal",
    }
  ]
}

          

[#] [back to top]

CreateClinicalNote

Create a new service user

Path /case-notes/service-users/[:serviceuserid]/clinical-notes/
Method POST
Headers
Query Parameters
Request Body
        
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@type" : "GeneralNote||FlaggedNote||ClinicalRiskNote||SeriousIncidentNote",
  "description" : "incident description",
  "createdOn": "2018-01-10T16:56:15Z",
  "createdBy": {
    "@type": "Worker",
    "@id": "AC0D751B-348A-4E15-8393-0A4372DD5464"
  }
}

      
Constraints
http://vocabularies.xenzone.com/xcp-api/0.0.1/CreateClinicalNote.schema.json
        
{
    "type": "object",
    "properties": {
        "@type": {
            "type" : "string"
        },
        "description": {
            "type": "string"
        },
        "createdBy": {
            "type": "object",
            "properties": {
                "@type": {
                    "type": "string"
                },
                "@id": {
                    "type": "string"
                }
            },
            required: [
                "@type",
                "@id"
            ]
        }
    },
    "required":[
        "@type",
        "description",
        "createdBy"
    ]
}

  
      

Responses

Status code: 201
Response Headers
Response Body
            
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@graph" : [
    {"@type":"ClinicalNoteCreatedEvent"},
    {"@type" : "GeneralNote||FlaggedNote||ClinicalRiskNote||SeriousIncidentNote",
    "@id" : "clinicalnote-id",
    "description" : "for non serious incidents",
    "incidentDescription" : "only user this if the note is a SeriousIncidentNote",
    "agreedActionDescription" : "only use this if the note is a SeriousIncidentNote",
    "dateTimeCreated" : date time,
    "createdBy" : {
      "@type" : "Worker",
      "@id" : "id",
      "name" : "worker name"
      }
    }
  ]
}

          
Status code: 400
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity is invalid - [actual information]"
    
    }
		
          
Status code: 401
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The requested resource requires authorization"
    
    }
		
          
Status code: 403
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "You are not authorized to access the resource"
    
    }
		
          
Status code: 500
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "Server error - [actual information]"
    
    }
		
          

Emits

ClinicalNoteCreatedEvent
Path: null
Method: null
Body

            
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@graph" : [
    {"@type":"ClinicalNoteCreatedEvent"},
    {"@type" : "GeneralNote||FlaggedNote||ClinicalRiskNote||SeriousIncidentNote",
    "@id" : "clinicalnote-id",
    "description" : "for non serious incidents",
    "incidentDescription" : "only user this if the note is a SeriousIncidentNote",
    "agreedActionDescription" : "only use this if the note is a SeriousIncidentNote",
    "dateTimeCreated" : date time,
    "createdBy" : {
      "@type" : "Worker",
      "@id" : "id",
      "name" : "worker name"
      }
    }
  ]
}

          

[#] [back to top]

CreateClinicalQuestionnaire

Create a new clinical questionnaire

Path /clinical-questionnaires
Method POST
Headers
Query Parameters
Request Body
        
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@type": "ClinicalQuestionnaireCoreYp||ClinicalQuestionnaireEos||ClinicalQuestionnaireCore10",
  "serviceUser": {
    "@id": "[service-user-id]",
    "@type": "ServiceUser"
  }
  "questionnaireContext": {
    "@type": "Message||Chat",
    "@id": "[message-id]||[chat-id]"
  }
}

      
Constraints
http://vocabularies.xenzone.com/xcp-api/0.0.1/CreateClinicalQuestionnaire.schema.json
        
{
  "title": "CreateClinicalQuestionnaire",
  "type": "object",
  "properties": {
    "@context": {
      "type": "string"
    },
    "@id": {
      "type": "string"
    },
    "serviceUser": {
      "@id": "[service-user-id]",
      "@type": "ServiceUser"
    }
    "questionnaireContext": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "@type": {
          "type": "string"
        },
        "@id": {
          "type": "string"
        }
      },
      "required": [
        "@type",
        "@id"
      ]
    }
  },
  "required": [
    "@context",
    "@id",
    "questionnaireContext"
  ]
}

  
      

Responses

Status code: 201
Response Headers
Response Body
            
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@graph": [
    {
      "@id": "[clinical-questionnaire-id]",
      "@type": "ClinicalQuestionnaireEos||ClinicalQuestionnaireCoreYp||ClinicalQuestionnaireCore10",
    }
  ]
}

          
Status code: 400
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity is invalid - [actual information]"
    
    }
		
          
Status code: 401
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The requested resource requires authorization"
    
    }
		
          
Status code: 403
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "You are not authorized to access the resource"
    
    }
		
          
Status code: 500
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "Server error - [actual information]"
    
    }
		
          

Emits

ClinicalQuestionnaireCreatedEvent
Path: null
Method: null
Body

            
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@graph": [
    {
      "@id": "[clinical-questionnaire-id]",
      "@type": "ClinicalQuestionnaireEos||ClinicalQuestionnaireCoreYp||ClinicalQuestionnaireCore10",
    }
  ]
}

          

[#] [back to top]

CreateGoal

Create a new goal

Path /goals
Method POST
Headers
Query Parameters
Request Body
        
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@type": "Goal",
  "serviceUserId": "serviceUsers/f9edff9c-9d54-4e5e-94e3-891d94e64af2",
  "score": 1,
  "title": "My goal",
  "applicationId": "applications/22ad004c-e4ed-4a06-9eea-583b4a54ebe5",
  "category": {
    "@id": "
        Anger |
        EmotionalExploration |
        EmotionalRegulation |
        EnjoyingSelf |
        FeelingHappier |
        Grief |
        GettingMoreHelpFromSignificantOthers |
        GettingProfessionalHelpInService |
        GettingProfessionalHelpOutsideOurService |
        ChallengingThoughts |
        ConfidenceSelfAcceptance |
        SelfExploration |
        SelfHelpSelfCare |
        SelfHelpSkillsForLife |
        Sexuality |
        GenderIdentity |
        Motivation |
        Bullying |
        FamilyRelationships |
        Friendships |
        Assertiveness |
        ChallengingOwnBehaviour |
        FittingIn |
        SpeakingUpCommunicatingBetter |
        ComingOut |
        SupportingOthers |
        CareerAspirational |
        EatingIssues |
        LearningDifficulties |
        ManagingDepressionOrLowMood |
        MedicationDrugs |
        OvercomingAnxiety |
        SchoolCollegeTraining |
        SelfHarm |
        SleepIssues |
        Smoking |
        SuicidalThoughts |
        KeepingSafe |
        ",
      "@type": "GoalCategory"
  }
}

      
Constraints
http://vocabularies.xenzone.com/xcp-api/0.0.1/CreateGoal.schema.json
        
{
  type: 'object',
  properties: {
    '@context': {
      type: 'string',
    },
    '@type': {
      type: 'string',
      enum: [
        'Goal',
      ],
    },
    'title': {
      type: 'string',
    },
    'serviceUserId': {
      type: 'string',
    },
    'applicationId': {
      type: 'string',
    },
    'score': {
      type: 'integer',
      minimum: 0,
      maximum: 10,
    },
    'category': {
      type: 'object',
      properties: {
        '@id': {
          type: 'string',
          enum: [
            'Anger',
            'EmotionalExploration',
            'EmotionalRegulation',
            'EnjoyingSelf',
            'FeelingHappier',
            'Grief',
            'GettingMoreHelpFromSignificantOthers',
            'GettingProfessionalHelpInService',
            'GettingProfessionalHelpOutsideOurService',
            'ChallengingThoughts',
            'ConfidenceSelfAcceptance',
            'SelfExploration',
            'SelfHelpSelfCare',
            'SelfHelpSkillsForLife',
            'Sexuality',
            'GenderIdentity',
            'Motivation',
            'Bullying',
            'FamilyRelationships',
            'Friendships',
            'Assertiveness',
            'ChallengingOwnBehaviour',
            'FittingIn',
            'SpeakingUpCommunicatingBetter',
            'ComingOut',
            'SupportingOthers',
            'CareerAspirational',
            'EatingIssues',
            'LearningDifficulties',
            'ManagingDepressionOrLowMood',
            'MedicationDrugs',
            'OvercomingAnxiety',
            'SchoolCollegeTraining',
            'SelfHarm',
            'SleepIssues',
            'Smoking',
            'SuicidalThoughts',
            'KeepingSafe',
          ],
        },
        '@type': {
          type: 'string',
          enum: [
            'GoalCategory',
          ],
        },
      },
    },
  },
  required: [
    '@context',
    '@type',
    'serviceUserId',
    'applicationId',
  ],
}
  
      

Responses

Status code: 201
Response Headers
Response Body
            
{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@graph": [
        {
            "@id": "788f11e3-8072-45fe-a703-828b68da622c",
            "@type": "GoalCreatedEvent",
            "causedBy": "commands/c316f150-36a3-4315-92ba-0cc779893a7f",
            "atTime": "2018-03-12T23:12:22.456Z"
        },
        {
            "@id": "31e840c2-ef70-466c-9820-01a313aec20a",
            "@type": "Goal"
        }
    ]
}

          
Status code: 400
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity is invalid - [actual information]"
    
    }
		
          
Status code: 401
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The requested resource requires authorization"
    
    }
		
          
Status code: 403
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "You are not authorized to access the resource"
    
    }
		
          
Status code: 500
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "Server error - [actual information]"
    
    }
		
          

Emits

GoalCreatedEvent
Path: null
Method: null
Body

            
{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@graph": [
        {
            "@id": "788f11e3-8072-45fe-a703-828b68da622c",
            "@type": "GoalCreatedEvent",
            "causedBy": "commands/c316f150-36a3-4315-92ba-0cc779893a7f",
            "atTime": "2018-03-12T23:12:22.456Z"
        },
        {
            "@id": "31e840c2-ef70-466c-9820-01a313aec20a",
            "@type": "Goal"
        }
    ]
}

          

[#] [back to top]

CreateRiskStatus

Create a new risk status for a service user

Path /risk-status/[:serviceuserid]
Method POST
Headers
Authorization: JWT
Accepts: application/json+ld
Content-Type: application/json+ld
Query Parameters
Request Body
        
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@type": "RiskStatus",
  "reason": "reason",
  "status": "RED|AMBER|GREEN"
}

      
Constraints
http://vocabularies.xenzone.com/xcp-api/0.0.1/CreateRiskStatus.schema.json
        
    {
      "type": "object",
      "properties": {
        "@type": {
          "type": "string"
        },
        "status": {
          "type": "string"
        },
        "reason": {
          "type": "string"
        }
      },
      "required": ["@type", "status", "reason"]
    }
  
      

Responses

Status code: 201
Response Headers
Response Body
            
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@graph" : [
    {
        "@type":"RiskStatusCreatedEvent"
    },
    {
      "@context": "https://vocabularies.xenzone.com/context.jsonld",
      "@id": "riskId",
      "@type": "RiskStatus",
      "worker": {
          "@type": "Worker",
          "@id": "workerId"
      },
      "reason": "reason",
      "status": "RED|AMBER|GREEN",
      "date": "dd-MMM-YY",
      "time": "hh:mm"
    }
  ]
}

          
Status code: 400
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity is invalid - [actual information]"
    
    }
		
          
Status code: 401
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The requested resource requires authorization"
    
    }
		
          
Status code: 403
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "You are not authorized to access the resource"
    
    }
		
          

Emits

RiskStatusCreatedEvent
Path: null
Method: null
Body

            
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@graph" : [
    {
        "@type":"RiskStatusCreatedEvent"
    },
    {
      "@context": "https://vocabularies.xenzone.com/context.jsonld",
      "@id": "riskId",
      "@type": "RiskStatus",
      "worker": {
          "@type": "Worker",
          "@id": "workerId"
      },
      "reason": "reason",
      "status": "RED|AMBER|GREEN",
      "date": "dd-MMM-YY",
      "time": "hh:mm"
    }
  ]
}

          

[#] [back to top]

CreateSafeguarding

Create a new safeguarding note for a service user

Path /safeguardings/[:serviceuserid]
Method POST
Headers
Authorization: JWT
Accepts: application/json+ld
Content-Type: application/json+ld
Query Parameters
Request Body
        
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@type": "Safeguarding",
  "areaReferredTo": "Area",
  "reason": "Neglect|Sexual|Physical|Emotional|Bullying|Suicidal-intent|Self-harm",
  "referredTo": "Internal monitoring|Social care|Police|CAMHS|Other",
  "referralContact": "Name contact agency",
  "referralContactPhone": "+442081234567",
  "outcomes": "outcomes"
}

      
Constraints
http://vocabularies.xenzone.com/xcp-api/0.0.1/CreateSafeguarding.schema.json
        
{  
   "type":"object",
   "properties":{  
      "@type":{  
         "type":"string",
         "enum":[  
            "Safeguarding"
         ],
         "default":"Safeguarding"
      },
      "areaReferredTo":{  
         "type":"string",
         "pattern":"^[a-zA-Zs]+",
         "maxLength":250
      },
      "reason":{  
         "type":"string",
         "enum":[  
            "Neglect",
            "Sexual",
            "Physical",
            "Emotional",
            "Bullying",
            "Suicidal-intent",
            "Self-harm"
         ],
         "default":"Self-harm"
      },
      "referredTo":{  
         "type":"string",
         "enum":[  
            "Internal monitoring",
            "Social care",
            "Police",
            "CAMHS",
            "Other"
         ],
         "default":"Other"
      },
      "referralContact":{  
         "type":"string",
         "pattern":"^[a-zA-Zs]+",
         "maxLength":250
      },
      "referralContactPhone":{  
         "type":"string",
         "pattern":"^\+[1-9]\d{1,14}$"
      },
      "outcomes":{  
         "type":"string",
         "maxLength":250
      }
   },
   "required":[  
      "@type",
      "areaReferredTo",
      "reason",
      "referredTo",
      "referralContact",
      "referralContactPhone",
      "outcomes"
   ]
}
  
      

Responses

Status code: 201
Response Headers
Response Body
            
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@graph" : [
    {
        "@type":"SafeguardingCreatedEvent"
    },
    {
      "@id": "safeguardingId",
      "@type": "Safeguarding",
      "referrer": {
          "@id": "workerId"
          "@type": "Worker",
          "name": "Worker name"
      },
      "areaReferredTo": "Area",
      "reason": "reason",
      "referredTo": "Internal monitoring|Social care|Police|CAMHS|Other",
      "referralContact": "Name contact agency",
      "referralContactPhone": "+442081234567",
      "outcomes": "outcomes",
      "createdAt": "2018-01-10T16:56:15Z",
      "modifiedAt": "2018-01-10T16:56:15Z"
    }
  ]
}

          
Status code: 400
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity is invalid - [actual information]"
    
    }
		
          
Status code: 401
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The requested resource requires authorization"
    
    }
		
          
Status code: 403
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "You are not authorized to access the resource"
    
    }
		
          

Emits

SafeguardingCreatedEvent
Path: null
Method: null
Body

            
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@graph" : [
    {
        "@type":"SafeguardingCreatedEvent"
    },
    {
      "@id": "safeguardingId",
      "@type": "Safeguarding",
      "referrer": {
          "@id": "workerId"
          "@type": "Worker",
          "name": "Worker name"
      },
      "areaReferredTo": "Area",
      "reason": "reason",
      "referredTo": "Internal monitoring|Social care|Police|CAMHS|Other",
      "referralContact": "Name contact agency",
      "referralContactPhone": "+442081234567",
      "outcomes": "outcomes",
      "createdAt": "2018-01-10T16:56:15Z",
      "modifiedAt": "2018-01-10T16:56:15Z"
    }
  ]
}

          

[#] [back to top]

CreateSafetyPlan

Create a new safety plan for a service user

Path /safety-plan/[:serviceuserid]
Method POST
Headers
Authorization: JWT
Accepts: application/json+ld
Content-Type: application/json+ld
Query Parameters
Request Body
        
{
    "@context": "//vocabularies.xenzone.com/context.jsonld",
    "@type": "SafetyPlan",
    "status": "Empty",
    "questionnaire": [
        {
            "@id": "questionId",
            "question": "Question",
            "answer": "Answer"
        }
    ]
}

      
Constraints
http://vocabularies.xenzone.com/xcp-api/0.0.1/CreateSafetyPlan.schema.json
        
    {
        "type": "object",
        "properties": {
            "@type": {
                "type": "string"
            },
            "questionnaire": {
                "type": "array",
                "answers": {
                    "type": "object",
                    "properties": {
                        "type": "object",
                        "properties": {
                            "@id": {
                                "type": "string"
                            },
                            "question": {
                                "type": "string"
                            },
                            "answer": {
                                "type": "string"
                            }
                        },
                        "required": ["@id", "question", "answer"]
                    }
                }
            }
        },
        "required": ["@type", "questionnaire"]
    }
  
      

Responses

Status code: 201
Response Headers
Response Body
            
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@graph" : [
    {
        "@type":"SafetyPlanCreatedEvent"
    },
    {
        "@type": "SafetyPlan",
        "status": "Created",
        "questionnaire": [
            {
                "@id": "questionId",
                "question": "Question",
                "answer": "Answer"
            }
        ]
    }
  ]
}

          
Status code: 400
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity is invalid - [actual information]"
    
    }
		
          
Status code: 401
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The requested resource requires authorization"
    
    }
		
          
Status code: 403
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "You are not authorized to access the resource"
    
    }
		
          

Emits

SafetyPlanCreatedEvent
Path: null
Method: null
Body

            
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@graph" : [
    {
        "@type":"SafetyPlanCreatedEvent"
    },
    {
        "@type": "SafetyPlan",
        "status": "Created",
        "questionnaire": [
            {
                "@id": "questionId",
                "question": "Question",
                "answer": "Answer"
            }
        ]
    }
  ]
}

          

[#] [back to top]

CreateServiceUser

Create a new service user

Path /service-users
Method POST
Headers
Query Parameters
Request Body
        {
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@type": "ServiceUser",
  "applicationServiceGroup": {
    "@id": "[asg-id]",
    "@type": "ApplicationServiceGroup"
  },
  "customer": {
    "@type": "Customer",
    "@id": "[customer-id]"
  }
}
      
Constraints
http://vocabularies.xenzone.com/xcp-api/0.0.1/CreateServiceUser.schema.json
        
{
  "title": "CreateServiceUser",
  "type": "object",
  "properties": {
    "@type": {
      "type": "string"
    },
    "applicationServiceGroup": {
      "type": "object",
      "properties": {
        "@id": {
          "type": "string"
        },
        "@type": {
          "type": "string"
        }
      },
      "required": [
        "@id",
        "@type"
      ]
    },
    "customer": {
      "type": "object",
      "properties": {
        "@id": {
          "type": "string"
        },
        "@type": {
          "type": "string"
        }
      },
      "required": [
        "@id",
        "@type"
      ]
    }
  },
  "required": [
    "@type",
    "applicationServiceGroup",
    "customer"
  ]
}
      

Responses

Status code: 201
Response Headers
Response Body
            
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@graph": [
    {
      "@id": "[event-id]",
      "@type": "ServiceUserCreatedEvent",
      "atTime": "2018-01-10T16:56:15Z",
      "causedBy": "commands/[command-uuid]"
    },
    {
      "@id": "[service-user-id]",
      "@type": "ServiceUser",
      "applicationServiceGroup": {
        "@id": "[asg-id]",
        "@type": "ApplicationServiceGroup"
      },
      "customer": {
        "@id": "[customer-id]",
        "@type": "Customer",
      }
    }
  ]
}


          
Status code: 400
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity is invalid - [actual information]"
    
    }
		
          
Status code: 401
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The requested resource requires authorization"
    
    }
		
          
Status code: 403
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "You are not authorized to access the resource"
    
    }
		
          
Status code: 500
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "Server error - [actual information]"
    
    }
		
          

Emits

ServiceUserCreatedEvent
Path: null
Method: null
Body

            
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@graph": [
    {
      "@id": "[event-id]",
      "@type": "ServiceUserCreatedEvent",
      "atTime": "2018-01-10T16:56:15Z",
      "causedBy": "commands/[command-uuid]"
    },
    {
      "@id": "[service-user-id]",
      "@type": "ServiceUser",
      "applicationServiceGroup": {
        "@id": "[asg-id]",
        "@type": "ApplicationServiceGroup"
      },
      "customer": {
        "@id": "[customer-id]",
        "@type": "Customer",
      }
    }
  ]
}


          

[#] [back to top]

DeclineClinicalQuestionnaire

Decline a pending clinical questionnaire

Path /clinical-questionnaires/[clinical-questionnaire-id]/decline
Method POST
Headers
Query Parameters

Responses

Status code: 201
Response Headers
Response Body
            
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@graph": [
    {
      "@id": "[event-id]",
      "@type": "ClinicalQuestionnaireDeclinedEvent",
      "atTime": "2018-01-10T16:56:15Z",
      "causedBy": "commands/[command-uuid]"
    },
    {
      "@id": "[clinical-questionnaire-id]",
      "@type": "ClinicalQuestionnaireEos",
      "status": "declined"
    }
  ]
}

          
Status code: 400
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity is invalid - [actual information]"
    
    }
		
          
Status code: 401
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The requested resource requires authorization"
    
    }
		
          
Status code: 403
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "You are not authorized to access the resource"
    
    }
		
          
Status code: 500
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "Server error - [actual information]"
    
    }
		
          

Emits

ClinicalQuestionnaireDeclinedEvent
Path: null
Method: null
Body

            
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@graph": [
    {
      "@id": "[event-id]",
      "@type": "ClinicalQuestionnaireDeclinedEvent",
      "atTime": "2018-01-10T16:56:15Z",
      "causedBy": "commands/[command-uuid]"
    },
    {
      "@id": "[clinical-questionnaire-id]",
      "@type": "ClinicalQuestionnaireEos",
      "status": "declined"
    }
  ]
}

          

[#] [back to top]

GetClinicalJournals

Get clinical journals

Path /service-users/:serviceUserId/clinical-journals
Method GET
Headers
Authorization: JWT
Accepts: application/json+ld
Content-Type: application/json+ld
Query Parameters
serviceUserId: Service user id to get journals for (required)
applicationId: application id

Responses

Status code: 200
Response Headers
Response Body
            
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "results": [
    {
      "@id": "[clinical-journal-id]",
      "@type": "ClinicalJournal",
      "serviceUser": {
        "@id": "f9edff9c-9d54-4e5e-94e3-891d94e64af2",
        "@type": "ServiceUser"
      }
      "application": {
        "@id": "22ad004c-e4ed-4a06-9eea-583b4a54ebe5",
        "@type": "Application"
      }
      "emoji": ":)",
      "dateTimeCreated": "2018-03-02T15:12:31.516Z",
      "reason": "Because I want",
    },
    {
      "@id": "[clinical-journal-id]",
      "@type": "ClinicalJournal",
      "serviceUser": {
        "@id": "f9edff9c-9d54-4e5e-94e3-891d94e64af2",
        "@type": "ServiceUser"
      }
      "application": {
        "@id": "22ad004c-e4ed-4a06-9eea-583b4a54ebe5",
        "@type": "Application"
      }
      "emoji": ":D",
      "dateTimeCreated": "2018-03-02T15:12:31.516Z",
      "reason": "Because I want",
    },
    {
      "@id": "[clinical-journal-id]",
      "@type": "ClinicalJournal",
      "serviceUser": {
        "@id": "f9edff9c-9d54-4e5e-94e3-891d94e64af2",
        "@type": "ServiceUser"
      }
      "application": {
        "@id": "22ad004c-e4ed-4a06-9eea-583b4a54ebe5",
        "@type": "Application"
      }
      "emoji": ":P",
      "dateTimeCreated": "2018-03-02T15:12:31.516Z",
      "reason": "Because I want",
    }
  ]
}

          
Status code: 400
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity is invalid - [actual information]"
    
    }
		
          
Status code: 401
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The requested resource requires authorization"
    
    }
		
          
Status code: 403
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "You are not authorized to access the resource"
    
    }
		
          
Status code: 500
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "Server error - [actual information]"
    
    }
		
          

Emits

[#] [back to top]

GetClinicalNotes

Get clinical notes

Path /case-notes/service-users/[:serviceuserid]/clinical-notes/
Method GET
Headers
Query Parameters
search: filter results matching the search term
type: GeneralNote||FlaggedNote||ClinicalRiskNote||SeriousIncidentNote

Responses

Status code: 200
Response Headers
Response Body
            
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@type": "Collection",
  "results": [
    {
      "@type": "GeneralNote", 
      "@id":"[id]", 
      "description": "blah blah blah"
    },
    {
      "@type": "SeriousIncidentNote", 
      "@id":"[id]", 
      "incidentDescription": "blah blah blah",
      "agreedActionDescription" : "only use this if the note is a SeriousIncidentNote"
    }

  ],
  "pagination": 
  {
      "currentPage": 5,
      "perPage": 20,
      "total": 521
  }
}

          
Status code: 400
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity is invalid - [actual information]"
    
    }
		
          
Status code: 401
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The requested resource requires authorization"
    
    }
		
          
Status code: 403
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "You are not authorized to access the resource"
    
    }
		
          
Status code: 500
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "Server error - [actual information]"
    
    }
		
          

Emits

[#] [back to top]

GetClinicalQuestionnaireTemplates

Get clinical notes

Path /clinical-questionnaires/templates
Method GET
Headers
Query Parameters

Responses

Status code: 200
Response Headers
Response Body
            
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@type": "Collection",
  "results": [{
    "@id": "templates/ClinicalQuestionnaireCoreYp",
    "@type": "ClinicalQuestionnaireTemplate",
    "clinicalQuestions": [{
      "@type": "ClinicalQuestion",
      "@id": "how-are-you",
      "text": "How are you?",
      "possibleClinicalAnswers": [
        {
          "@id": "well",
          "@type": "ClinicalAnswer",
          "text": "Well",
          "score": 2
        },
        {
          "@id": "notbad",
          "@type": "ClinicalAnswer",
          "text": "Not too bad, yourself?",
          "score": 0
        }
      ]
    },
    {
      "@id": "like-apis",
      "@type": "ClinicalQuestion",
      "text": "Do you like APIs?",
      "possibleClinicalAnswers": [
        {
          "@id": "losers",
          "@type": "ClinicalAnswer",
          "text": "Backend is for losers!",
          "score": 2
        },
        {
          "@id": "lovethem",
          "@type": "ClinicalAnswer",
          "text": "Love them!",
          "score": 2
        },
        {
          "@id": "onlyif",
          "@type": "ClinicalAnswer",
          "text": "Only if they have 100000 libraries",
          "score": 10
        }
      ]
    }]
  },
  {
    "@id": "templates/ClinicalQuestionnaireEos",
    "@type": "ClinicalQuestionnaireTemplate",
    "clinicalQuestions": [
      {
        "@type": "ClinicalQuestion",
        "@id": "pet",
        "text": "What kind of pet do you have?",
        "possibleClinicalAnswers": [
          {
            "@id": "unicorn",
            "@type": "ClinicalAnswer",
            "text": "A magic unicorn"
          },
          {
            "@id": "trex",
            "@type": "ClinicalAnswer",
            "text": "A T-rex?"
          },
          {
            "@id": "fox",
            "@type": "ClinicalAnswer",
            "text": "A fox?"
          }
        ]
      },
      {
        "@id": "like-apis",
        "@type": "ClinicalQuestion",
        "text": "Do you like APIs?",
        "possibleClinicalAnswers": [
          {
            "@id": "losers",
            "@type": "ClinicalAnswer",
            "text": "Backend is for losers!",
          },
          {
            "@id": "lovethem",
            "@type": "ClinicalAnswer",
            "text": "Love them!",
          },
          {
            "@id": "onlyif",
            "@type": "ClinicalAnswer",
            "text": "Only if they have 100000 libraries",
          }
        ]
      }
    ]
  }]
}  

          
Status code: 401
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The requested resource requires authorization"
    
    }
		
          
Status code: 403
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "You are not authorized to access the resource"
    
    }
		
          
Status code: 500
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "Server error - [actual information]"
    
    }
		
          

Emits

[#] [back to top]

GetClinicalQuestionnaires

Get clinical questionnaires, with options

Path /clinical-questionnaires
Method GET
Headers
Authorization: JWT
Accepts: application/json+ld
Content-Type: application/json+ld
Query Parameters
serviceUserId: Service user id to get questionnaires for (required)
contextType: the questionnaire context type (message||chat)
contextId: The id of the message || chat

Responses

Status code: 200
Response Headers
Response Body
            
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "results": [
    {
      "@id": "[clinical-questionnaire-id]",
      "@type": "ClinicalQuestionnaireEos",
      "status": "declined",
      "dateTimeCreated": "2018-03-02T15:12:31.516Z",
      "contextType": "Message|Chat",
      "contextId": "[chat-id]|[message-id]",
      "answers": [
        {
          "@type": "ClinicalAnswer",
          "questionId": "how-are-you",
          "answerId": "notbad"
        },
        {
          "@type": "ClinicalAnswer",
          "questionId": "pet",
          "answerId": "unicorn"
        },
        {
          "@type": "ClinicalAnswer",
          "questionId": "last-question",
          "answerId": ""
        }
      ]
    },
    {
      "@id": "[clinical-questionnaire-id]",
      "@type": "ClinicalQuestionnaireCoreYp",
      "status": "pending",
      "score": "10",
      "dateTimeCreated": "2018-03-02T15:12:31.516Z",
      "contextType": "Message|Chat",
      "contextId": "[chat-id]|[message-id]",
      "answers": [
        {
          "@type": "ClinicalAnswer",
          "questionId": "how-are-you",
          "answerId": "",
          "score": 10
        },
      ]
    },
    {
      "@id": "[clinical-questionnaire-id]",
      "@type": "ClinicalQuestionnaireEos",
      "status": "completed",
      "dateTimeCreated": "2018-03-02T15:12:31.516Z",
      "contextType": "Message|Chat",
      "contextId": "[chat-id]|[message-id]",
      "answers": [
        {
          "@type": "ClinicalAnswer",
          "questionId": "are-you-in-the-matrix",
          "answerId": "morfeus-is-my-dealer"
        },
      ]
    }
  ]
}

          
Status code: 400
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity is invalid - [actual information]"
    
    }
		
          
Status code: 401
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The requested resource requires authorization"
    
    }
		
          
Status code: 403
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "You are not authorized to access the resource"
    
    }
		
          
Status code: 500
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "Server error - [actual information]"
    
    }
		
          

Emits

[#] [back to top]

GetGoals

Get goals, with options

Path /goals
Method GET
Headers
Authorization: JWT
Accepts: application/json+ld
Content-Type: application/json+ld
Query Parameters
serviceUserId: Service user id to get goals for
applicationId: application id
status: Status list to search for
reviewedStatus: Reviewed Status list to search for

Responses

Status code: 200
Response Headers
Response Body
            
{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "results": [
        {
 
            "serviceUser": {
              "@id": "f9edff9c-9d54-4e5e-94e3-891d94e64af2",
              "@type": "ServiceUser"
            }
            "application": {
              "@id": "22ad004c-e4ed-4a06-9eea-583b4a54ebe5",
              "@type": "Application",
              "name": "Kooth"
            }
            "title": null,
            "category": {
                      "@id": "Sexuality",
                      "@type": "GoalCategory"
                    },
            "@id": "31e840c2-ef70-466c-9820-01a313aec20a",
            "dateTimeCreated": "2018-03-12T23:12:22.423Z",
            "status": {
                      "@id": "Active",
                      "@type": "GoalStatus"
                    },
            "score": 0
        },
        {
            "serviceUser": {
              "@id": "f9edff9c-9d54-4e5e-94e3-891d94e64af2",
              "@type": "ServiceUser"
            }
            "application": {
              "@id": "22ad004c-e4ed-4a06-9eea-583b4a54ebe5",
              "@type": "Application",
              "name": "Kooth"
            }
            "title": null,
            "category": {
                      "@id": "Sexuality",
                      "@type": "GoalCategory"
                    },
            "@id": "d7cbd7d8-75ee-4637-9196-bf8345bba088",
            "dateTimeCreated": "2018-03-12T23:16:16.377Z",
            "status": {
                      "@id": "Active",
                      "@type": "GoalStatus"
                    },
            "score": 0
        },
        {
            "serviceUser": {
              "@id": "f9edff9c-9d54-4e5e-94e3-891d94e64af2",
              "@type": "ServiceUser"
            }
            "application": {
              "@id": "22ad004c-e4ed-4a06-9eea-583b4a54ebe5",
              "@type": "Application",
              "name": "Kooth"
            }
            "title": null,
            "category": {
                      "@id": "Sexuality",
                      "@type": "GoalCategory"
                    },
            "@id": "a285fb84-525b-4796-9256-a3d47c74fc07",
            "dateTimeCreated": "2018-03-12T23:16:34.382Z",
            "status": {
                      "@id": "Active",
                      "@type": "GoalStatus"
                    },
            "score": 1
        },
        {
            "serviceUser": {
              "@id": "f9edff9c-9d54-4e5e-94e3-891d94e64af2",
              "@type": "ServiceUser"
            }
            "application": {
              "@id": "22ad004c-e4ed-4a06-9eea-583b4a54ebe5",
              "@type": "Application",
              "name": "Kooth"
            }
            "title": null,
            "category": {
                      "@id": "Sexuality",
                      "@type": "GoalCategory"
                    },
            "@id": "f6b519b2-08c9-4890-92c7-63c509aa9f7f",
            "dateTimeCreated": "2018-03-12T23:16:44.996Z",
            "status": {
                      "@id": "Active",
                      "@type": "GoalStatus"
                    },
            "score": 1
        }
    ]
}

          
Status code: 400
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity is invalid - [actual information]"
    
    }
		
          
Status code: 401
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The requested resource requires authorization"
    
    }
		
          
Status code: 403
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "You are not authorized to access the resource"
    
    }
		
          
Status code: 500
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "Server error - [actual information]"
    
    }
		
          

Emits

[#] [back to top]

GetGoalsServiceUser

Get goals service user command

Path /service-users/:userId/goals
Method GET
Headers
Authorization: JWT
Accepts: application/json+ld
Content-Type: application/json+ld
Query Parameters

Responses

Status code: 200
Response Headers
Response Body
            
{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "results": [
        {
 
            "serviceUser": {
              "@id": "f9edff9c-9d54-4e5e-94e3-891d94e64af2",
              "@type": "ServiceUser"
            }
            "application": {
              "@id": "22ad004c-e4ed-4a06-9eea-583b4a54ebe5",
              "@type": "Application",
              "name": "Kooth"
            }
            "title": null,
            "category": {
                      "@id": "Sexuality",
                      "@type": "GoalCategory"
                    },
            "@id": "31e840c2-ef70-466c-9820-01a313aec20a",
            "dateTimeCreated": "2018-03-12T23:12:22.423Z",
            "status": {
                      "@id": "Active",
                      "@type": "GoalStatus"
                    },
            "score": 0
        },
        {
            "serviceUser": {
              "@id": "f9edff9c-9d54-4e5e-94e3-891d94e64af2",
              "@type": "ServiceUser"
            }
            "application": {
              "@id": "22ad004c-e4ed-4a06-9eea-583b4a54ebe5",
              "@type": "Application",
              "name": "Kooth"
            }
            "title": null,
            "category": {
                      "@id": "Sexuality",
                      "@type": "GoalCategory"
                    },
            "@id": "d7cbd7d8-75ee-4637-9196-bf8345bba088",
            "dateTimeCreated": "2018-03-12T23:16:16.377Z",
            "status": {
                      "@id": "Active",
                      "@type": "GoalStatus"
                    },
            "score": 0
        },
        {
            "serviceUser": {
              "@id": "f9edff9c-9d54-4e5e-94e3-891d94e64af2",
              "@type": "ServiceUser"
            }
            "application": {
              "@id": "22ad004c-e4ed-4a06-9eea-583b4a54ebe5",
              "@type": "Application",
              "name": "Kooth"
            }
            "title": null,
            "category": {
                      "@id": "Sexuality",
                      "@type": "GoalCategory"
                    },
            "@id": "a285fb84-525b-4796-9256-a3d47c74fc07",
            "dateTimeCreated": "2018-03-12T23:16:34.382Z",
            "status": {
                      "@id": "Active",
                      "@type": "GoalStatus"
                    },
            "score": 1
        },
        {
            "serviceUser": {
              "@id": "f9edff9c-9d54-4e5e-94e3-891d94e64af2",
              "@type": "ServiceUser"
            }
            "application": {
              "@id": "22ad004c-e4ed-4a06-9eea-583b4a54ebe5",
              "@type": "Application",
              "name": "Kooth"
            }
            "title": null,
            "category": {
                      "@id": "Sexuality",
                      "@type": "GoalCategory"
                    },
            "@id": "f6b519b2-08c9-4890-92c7-63c509aa9f7f",
            "dateTimeCreated": "2018-03-12T23:16:44.996Z",
            "status": {
                      "@id": "Active",
                      "@type": "GoalStatus"
                    },
            "score": 1
        }
    ]
}

          
Status code: 400
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity is invalid - [actual information]"
    
    }
		
          
Status code: 401
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The requested resource requires authorization"
    
    }
		
          
Status code: 403
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "You are not authorized to access the resource"
    
    }
		
          
Status code: 500
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "Server error - [actual information]"
    
    }
		
          

Emits

[#] [back to top]

GetRiskStatus

Get the risk statuses of a service user

Path /risk-status/[:serviceuserid]
Method GET
Headers
Authorization: JWT
Content-Type: application/json+ld
Query Parameters
page: page of results to fetch
perPage: number of results per page

Responses

Status code: 200
Response Headers
Response Body
            
{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Collection",
    "results": [
        {
            "@id": "riskId",
            "@type": "RiskStatus",
            "worker": {
                "@type": "Worker",
                "@id": "workerId"
            },
            "status": "RED|AMBER|GREEN",
            "reason": "reason",
            "date": "dd-MMM-YY",
            "time": "hh:mm"
        }
    ],
    "pagination": {
        "currentPage": 1,
        "perPage": 10,
        "total": 1
    }
}

          
Status code: 400
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity is invalid - [actual information]"
    
    }
		
          
Status code: 401
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The requested resource requires authorization"
    
    }
		
          
Status code: 403
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "You are not authorized to access the resource"
    
    }
		
          
Status code: 500
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "Server error - [actual information]"
    
    }
		
          

Emits

[#] [back to top]

GetSafeguardings

Get the safeguarding notes of a service user

Path /safeguardings/[:serviceuserid]
Method GET
Headers
Authorization: JWT
Content-Type: application/json+ld
Query Parameters
page: page of results to fetch
perPage: number of results per page

Responses

Status code: 200
Response Headers
Response Body
            
{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Collection",
    "results": [
        {
          "@id": "safeguardingId",
          "@type": "Safeguarding",
          "referrer": {
              "@type": "Worker",
              "@id": "workerId",
              "name": "Worker name"
          },
          "areaReferredTo": "Area",
          "reason": "reason",
          "referredTo": "Internal monitoring|Social care|Police|CAMHS|Other",
          "referralContact": "Name contact agency",
          "referralContactPhone": "+442081234567",
          "outcomes": "outcomes",
          "createdAt": "2018-01-10T16:56:15Z",
          "modifiedAt": "2018-01-10T16:56:15Z"
        }
    ],
    "pagination": {
        "currentPage": 1,
        "perPage": 10,
        "total": 1
    }
}

          
Status code: 400
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity is invalid - [actual information]"
    
    }
		
          
Status code: 401
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The requested resource requires authorization"
    
    }
		
          
Status code: 403
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "You are not authorized to access the resource"
    
    }
		
          
Status code: 500
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "Server error - [actual information]"
    
    }
		
          

Emits

[#] [back to top]

GetSafetyPlan

Get the safety plan of a service user

Path /safety-plan/[:serviceuserid]
Method GET
Headers
Authorization: JWT
Content-Type: application/json+ld
Query Parameters

Responses

Status code: 200
Response Headers
Response Body
            
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@type": "SafetyPlan",
  "status": "Empty|Created",
  "questionnaire": [
      {
          "@id": "questionId",
          "question": "Question",
          "answer": "Answer"
      }
  ]
}

          
Status code: 400
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity is invalid - [actual information]"
    
    }
		
          
Status code: 401
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The requested resource requires authorization"
    
    }
		
          
Status code: 403
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "You are not authorized to access the resource"
    
    }
		
          
Status code: 500
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "Server error - [actual information]"
    
    }
		
          

Emits

[#] [back to top]

GetServiceUser

Gets a service user with personal profile.

Path /service-users/[id]
Method GET
Headers
Query Parameters

Responses

Status code: 200
Response Headers
Response Body
            {
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@id": "[service-user-id]",
  "@type": "ServiceUser",
  "applicationServiceGroup": {
    "@id": "[asg-id]",
    "@type": "ApplicationServiceGroup",
  },
  "customer": {
    "@id": "[customer-id]",
    "@type": 'Customer',
  },
  "profile": {
    "@type": "ServiceUserPersonalProfile",
    "@id": "[personal-profile-id]",
    "avatar": "https://www.myavatar.com/1",
    "nickname": "Joe",
    "nameTitle": "Mr",
    "firstName": "Joseph",
    "lastName": "Bloggs",
    "birthDate": "1966-04-21",
    "religion": {
      "@type": "Religion",
      "@id": "Buddhist",
    },
    "gender": {
      "@type": "Gender",
      "@id": "Male",
    },
    "disability": {
      "@type": "Disability",
      "@id": "Sight",
    },
    "ethnicity": {
      "@type": "Ethnicity",
      "@id": "Chinese",
    },
    "telephoneNumber": "+4402071234567",
    "fullAddress": "135 Park Avenue, London, N5 T46",
    "emailAddress": "test@xenzone.com",
    "contacts": [
      {
        "@type": "Contact",
        "school": "The London Academy",
        "role": "Teacher",
        "firstName": "Jane",
        "lastName": "Doe",
        "telephoneNumber": "+4402071234568",
      }
    ],
    "description": "This is a profile note",
    "heardAboutFrom": "My friend Paco el Flaco",
    "tags": [
      { "@type": "Vulnerability", "@id": "Neet" },
      { "@type": "Vulnerability", "@id": "YoungCarer" }
    ]
  }
}
          
Status code: 400
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity is invalid - [actual information]"
    
    }
		
          
Status code: 401
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The requested resource requires authorization"
    
    }
		
          
Status code: 403
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "You are not authorized to access the resource"
    
    }
		
          
Status code: 500
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "Server error - [actual information]"
    
    }
		
          

Emits

[#] [back to top]

GetServiceUserNextOfKin

Get Service User next of kin

Path /service-users/[id]/next-of-kin/[1-or-2]/
Method GET
Headers
Query Parameters

Responses

Status code: 200
Response Headers
Response Body
            
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@type" : "Father||Mother||Sibling||GrandParent||Guardian||OtherNextOfKin",
  "@id" : "/service-users/[id]/next-of-kin/[1-or-2]/",
  "nameTitle" : "Dr, Mrs etc",
  "firstName" : "firstname",
  "lastName" : "surname",
  "telephoneNumber" : "telephone number",
  "fullAddress" : "full address",
  "emailAddress" : "jack@jill.com"
}

          
Status code: 400
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity is invalid - [actual information]"
    
    }
		
          
Status code: 401
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The requested resource requires authorization"
    
    }
		
          
Status code: 403
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "You are not authorized to access the resource"
    
    }
		
          
Status code: 500
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "Server error - [actual information]"
    
    }
		
          

Emits

[#] [back to top]

GetServiceUsers

Gets a list of service users with personal profiles. Query params to filter results.

Path /service-users/
Method GET
Headers
Query Parameters
page: page of results to fetch
perPage: number of results per page
applicationServiceGroupId: the asg
customerId: the customer id
withProfile: Will only return service users that have profile
search: Will only return service users that have nickname, first name or last name matching this pattern

Responses

Status code: 200
Response Headers
Response Body
            
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@type": "Collection",
  "results": [
    {
      "@id": "[service-user-id]",
      "@type": "ServiceUser",
      "applicationServiceGroup": {
        "@id": "[asg-id]",
        "@type": "ApplicationServiceGroup",
      },
      "customer": {
        "@id": "[customer-id]",
        "@type": 'Customer',
      },
      "profile": {},
    },
    {
      "@id": "[service-user-id]",
      "@type": "ServiceUser",
      "applicationServiceGroup": {
        "@id": "[asg-id]",
        "@type": "ApplicationServiceGroup",
      },
      "customer": {
        "@id": "[customer-id]",
        "@type": 'Customer',
      },
      "profile": {
        "@type": "ServiceUserPersonalProfile",
        "avatar": {
          "@type": "Avatar",
          "@id": "[avatar-id]",
        },
        "nickname": "Joe",
        "nameTitle": "Mr",
        "firstName": "Joseph",
        "lastName": "Bloggs",
        "birthDate": "1966-04-21",
        "religion": {
          "@type": "Religion",
          "@id": "Buddhist",
        },
        "gender": {
          "@type": "Gender",
          "@id": "Male",
        },
        "disability": {
          "@type": "Disability",
          "@id": "Sight",
        },
        "ethnicity": {
          "@type": "Ethnicity",
          "@id": "Chinese",
        },
        "telephoneNumber": "+4402071234567",
        "fullAddress": "135 Park Avenue, London, N5 T46",
        "emailAddress": "test@xenzone.com",
        "contacts": [
          {
            "@type": "Contact",
            "school": "The London Academy",
            "role": "Teacher",
            "firstName": "Jane",
            "lastName": "Doe",
            "telephoneNumber": "+4402071234568",
          }
        ],
        "description": "This is a profile note",
        "heardAboutFrom": "My friend Paco el Flaco",
        "tags": [
          { "@type": "Vulnerability", "@id": "Neet" },
          { "@type": "Vulnerability", "@id": "YoungCarer" }
        ]
      },
    },
  ],
  "pagination": 
  {
      "currentPage": 5,
      "perPage": 20,
      "total": 521
  }
}

          
Status code: 400
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity is invalid - [actual information]"
    
    }
		
          
Status code: 401
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The requested resource requires authorization"
    
    }
		
          
Status code: 403
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "You are not authorized to access the resource"
    
    }
		
          
Status code: 500
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "Server error - [actual information]"
    
    }
		
          

Emits

[#] [back to top]

UpdateGoal

Updates a goal

Path /goals/[goal-id]
Method PUT
Headers
Query Parameters
Request Body
        
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@type": "Goal",
  "status": {
    "@id": "Active",
    "@type": "GoalStatus"
  },
  "category": {
    "@id": "EmotionalExploration",
    "@type": "GoalCategory"
  },
  "reviewedStatus": {
    "@id": "Active",
    "@type": "ReviewedStatus"
  },
  "title": "another title",
  "score": 3
}

      
Constraints
http://vocabularies.xenzone.com/xcp-api/0.0.1/UpdateGoal.schema.json
        
{
  type: 'object',
  properties: {
    '@context': {
      type: 'string',
    },
    'title': {
      type: 'string',
    },
    'category': {
      type: 'object',
      properties: {
        '@id': {
          type: 'string',
          enum: [
            'Anger',
            'EmotionalExploration',
            'EmotionalRegulation',
            'EnjoyingSelf',
            'FeelingHappier',
            'Grief',
            'GettingMoreHelpFromSignificantOthers',
            'GettingProfessionalHelpInService',
            'GettingProfessionalHelpOutsideOurService',
            'ChallengingThoughts',
            'ConfidenceSelfAcceptance',
            'SelfExploration',
            'SelfHelpSelfCare',
            'SelfHelpSkillsForLife',
            'Sexuality',
            'GenderIdentity',
            'Motivation',
            'Bullying',
            'FamilyRelationships',
            'Friendships',
            'Assertiveness',
            'ChallengingOwnBehaviour',
            'FittingIn',
            'SpeakingUpCommunicatingBetter',
            'ComingOut',
            'SupportingOthers',
            'CareerAspirational',
            'EatingIssues',
            'LearningDifficulties',
            'ManagingDepressionOrLowMood',
            'MedicationDrugs',
            'OvercomingAnxiety',
            'SchoolCollegeTraining',
            'SelfHarm',
            'SleepIssues',
            'Smoking',
            'SuicidalThoughts',
            'KeepingSafe',
          ],
        },
        '@type': {
          type: 'string',
          enum: [
            'GoalCategory',
          ],
        },
      },
    },
    '@type': {
      type: 'string',
      enum: [
        'Goal',
      ],
    },
    'status': {
      type: 'object',
      properties: {
        '@id': {
          type: 'string',
          enum: [
            'Active',
            'Archived',
            'Complete',
          ],
        },
        '@type': {
          type: 'string',
          enum: [
            'GoalStatus',
          ],
        },
      },
    },
    'reviewedStatus': {
      type: 'object',
      properties: {
        '@id': {
          type: 'string',
          enum: [
            'Approved',
            'Rejected',
            'RequiresReview',
          ],
        },
        '@type': {
          type: 'string',
          enum: [
            'ReviewedStatus',
          ],
        },
      },
    },
    'score': {
      type: 'integer',
      minimum: 0,
      maximum: 10,
    },
  },
  anyOf: [
    { required: ['status'] },
    { required: ['reviewedStatus'] },
    { required: ['score'] },
  ],
  required: [
    '@context',
    '@type',
  ],
}

  
      

Responses

Status code: 200
Response Headers
Response Body
            
{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@graph": [
        {
            "@id": "9a5487eb-3a6f-4c21-ba46-ef22379e5a67",
            "@type": "GoalUpdatedEvent",
            "causedBy": "commands/22781121-b641-4d11-94b8-a922af146bc2",
            "atTime": "2018-03-12T23:25:11.583Z"
        }
    ]
}

          
Status code: 400
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity is invalid - [actual information]"
    
    }
		
          
Status code: 401
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The requested resource requires authorization"
    
    }
		
          
Status code: 403
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "You are not authorized to access the resource"
    
    }
		
          
Status code: 500
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "Server error - [actual information]"
    
    }
		
          

Emits

GoalUpdatedEvent
Path: null
Method: null
Body

            
{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@graph": [
        {
            "@id": "9a5487eb-3a6f-4c21-ba46-ef22379e5a67",
            "@type": "GoalUpdatedEvent",
            "causedBy": "commands/22781121-b641-4d11-94b8-a922af146bc2",
            "atTime": "2018-03-12T23:25:11.583Z"
        }
    ]
}

          

[#] [back to top]

UpdateGoalServiceUser

Updates a goal (service user command)

Path /service-users/:userId/goals/[goal-id]
Method PUT
Headers
Query Parameters
Request Body
        
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@type": "Goal",
  "score": 3,
  "status": {
    "@id": "Active",
    "@type": "GoalStatus"
  },
}

      
Constraints
http://vocabularies.xenzone.com/xcp-api/0.0.1/UpdateGoalServiceUser.schema.json
        
{
  type: 'object',
  properties: {
    '@context': {
      type: 'string',
    },
    '@type': {
      type: 'string',
      enum: [
        'Goal',
      ],
    },
    'score': {
      type: 'integer',
      minimum: 0,
      maximum: 10,
    },
    'status': {
      type: 'object',
      properties: {
        '@id': {
          type: 'string',
          enum: [
            'Active',
            'Archived',
            'Complete',
          ],
        },
        '@type': {
          type: 'string',
          enum: [
            'GoalStatus',
          ],
        },
      },
    },
  },
  anyOf: [
    { required: ['status'] },
    { required: ['score'] },
  ],
  required: [
    '@context',
    '@type',
  ],
}

  
      

Responses

Status code: 200
Response Headers
Response Body
            
{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@graph": [
        {
            "@id": "9a5487eb-3a6f-4c21-ba46-ef22379e5a67",
            "@type": "GoalUpdatedEvent",
            "causedBy": "commands/22781121-b641-4d11-94b8-a922af146bc2",
            "atTime": "2018-03-12T23:25:11.583Z"
        }
    ]
}

          
Status code: 400
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity is invalid - [actual information]"
    
    }
		
          
Status code: 401
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The requested resource requires authorization"
    
    }
		
          
Status code: 403
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "You are not authorized to access the resource"
    
    }
		
          
Status code: 500
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "Server error - [actual information]"
    
    }
		
          

Emits

GoalUpdatedEvent
Path: null
Method: null
Body

            
{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@graph": [
        {
            "@id": "9a5487eb-3a6f-4c21-ba46-ef22379e5a67",
            "@type": "GoalUpdatedEvent",
            "causedBy": "commands/22781121-b641-4d11-94b8-a922af146bc2",
            "atTime": "2018-03-12T23:25:11.583Z"
        }
    ]
}

          

[#] [back to top]

UpdateSafeguarding

Update a new safeguarding note for a service user

Path /safeguardings/[:serviceuserid]
Method PUT
Headers
Authorization: JWT
Accepts: application/json+ld
Content-Type: application/json+ld
Query Parameters
Request Body
        
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@id": "safeguardingId",
  "@type": "Safeguarding",
  "areaReferredTo": "Area",
  "reason": "Neglect|Sexual|Physical|Emotional|Bullying|Suicidal-intent|Self-harm",
  "referredTo": "Internal monitoring|Social care|Police|CAMHS|Other",
  "referralContact": "Name contact agency",
  "referralContactPhone": "+442081234567",
  "outcomes": "outcomes"
}

      
Constraints
http://vocabularies.xenzone.com/xcp-api/0.0.1/UpdateSafeguarding.schema.json
        
{  
   "type":"object",
   "properties":{  
      "@id":{  
         "type":"string"
      },
      "@type":{  
         "type":"string",
         "enum":[  
            "Safeguarding"
         ],
         "default":"Safeguarding"
      },
      "areaReferredTo":{  
         "type":"string",
         "pattern":"^[a-zA-Zs]+",
         "maxLength":250
      },
      "reason":{  
         "type":"string",
         "enum":[  
            "Neglect",
            "Sexual",
            "Physical",
            "Emotional",
            "Bullying",
            "Suicidal-intent",
            "Self-harm"
         ],
         "default":"Self-harm"
      },
      "referredTo":{  
         "type":"string",
         "enum":[  
            "Internal monitoring",
            "Social care",
            "Police",
            "CAMHS",
            "Other"
         ],
         "default":"Other"
      },
      "referralContact":{  
         "type":"string",
         "pattern":"^[a-zA-Zs]+",
         "maxLength":250
      },
      "referralContactPhone":{  
         "type":"string",
         "pattern":"^\+[1-9]\d{1,14}$"
      },
      "outcomes":{  
         "type":"string",
         "maxLength":250
      }
   },
   "required":[  
      "@id",
      "@type",
      "areaReferredTo",
      "reason",
      "referredTo",
      "referralContact",
      "referralContactPhone",
      "outcomes"
   ]
}
  
      

Responses

Status code: 200
Response Headers
Response Body
            
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@graph" : [
    {
        "@type":"SafeguardingUpdatedEvent"
    },
    {
      "@id": "safeguardingId",
      "@type": "Safeguarding",
      "referrer": {
          "@id": "workerId"
          "@type": "Worker",
          "name": "Worker name"
      },
      "areaReferredTo": "Area",
      "reason": "reason",
      "referredTo": "Internal monitoring|Social care|Police|CAMHS|Other",
      "referralContact": "Name contact agency",
      "referralContactPhone": "+442081234567",
      "outcomes": "outcomes",
      "createdAt": "2018-01-10T16:56:15Z",
      "modifiedAt": "2018-01-10T16:56:15Z"
    }
  ]
}

          
Status code: 400
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity is invalid - [actual information]"
    
    }
		
          
Status code: 401
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The requested resource requires authorization"
    
    }
		
          
Status code: 403
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "You are not authorized to access the resource"
    
    }
		
          

Emits

SafeguardingUpdatedEvent
Path: null
Method: null
Body

            
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@graph" : [
    {
        "@type":"SafeguardingUpdatedEvent"
    },
    {
      "@id": "safeguardingId",
      "@type": "Safeguarding",
      "referrer": {
          "@id": "workerId"
          "@type": "Worker",
          "name": "Worker name"
      },
      "areaReferredTo": "Area",
      "reason": "reason",
      "referredTo": "Internal monitoring|Social care|Police|CAMHS|Other",
      "referralContact": "Name contact agency",
      "referralContactPhone": "+442081234567",
      "outcomes": "outcomes",
      "createdAt": "2018-01-10T16:56:15Z",
      "modifiedAt": "2018-01-10T16:56:15Z"
    }
  ]
}

          

[#] [back to top]

UpdateSafetyPlan

Update a new safety plan for a service user

Path /safety-plan/[:serviceuserid]
Method POST
Headers
Authorization: JWT
Accepts: application/json+ld
Content-Type: application/json+ld
Query Parameters
Request Body
        
{
    "@context": "//vocabularies.xenzone.com/context.jsonld",
    "@type": "SafetyPlan",
    "status": "Created",
    "questionnaire": [
        {
            "@id": "questionId",
            "question": "Question",
            "answer": "Answer"
        }
    ]
}

      
Constraints
http://vocabularies.xenzone.com/xcp-api/0.0.1/UpdateSafetyPlan.schema.json
        
    {
        "type": "object",
        "properties": {
            "@type": {
                "type": "string"
            },
            "questionnaire": {
                "type": "array",
                "answers": {
                    "type": "object",
                    "properties": {
                        "type": "object",
                        "properties": {
                            "@id": {
                                "type": "string"
                            },
                            "question": {
                                "type": "string"
                            },
                            "answer": {
                                "type": "string"
                            }
                        },
                        "required": ["@id", "question", "answer"]
                    }
                }
            }
        },
        "required": ["@type", "questionnaire"]
    }
  
      

Responses

Status code: 200
Response Headers
Response Body
            
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@graph" : [
    {
        "@type":"SafetyPlanUpdatedEvent"
    },
    {
        "@type": "SafetyPlan",
        "status": "Created",
        "questionnaire": [
            {
                "@id": "questionId",
                "question": "Question",
                "answer": "Answer"
            }
        ]
    }
  ]
}

          
Status code: 400
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity is invalid - [actual information]"
    
    }
		
          
Status code: 401
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The requested resource requires authorization"
    
    }
		
          
Status code: 403
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "You are not authorized to access the resource"
    
    }
		
          

Emits

SafetyPlanUpdatedEvent
Path: null
Method: null
Body

            
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@graph" : [
    {
        "@type":"SafetyPlanUpdatedEvent"
    },
    {
        "@type": "SafetyPlan",
        "status": "Created",
        "questionnaire": [
            {
                "@id": "questionId",
                "question": "Question",
                "answer": "Answer"
            }
        ]
    }
  ]
}

          

[#] [back to top]

UpdateServiceUser

Update an existing service user

Path /service-users/[id]/
Method PUT
Headers
Query Parameters
Request Body
        {
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@type": "ServiceUser",
  "applicationServiceGroup": {
   "@id": "[asg-id]",
   "@type": "ApplicationServiceGroup"
  },
  "customer": {
   "@type": "Customer",
   "@id": "[customer-id]"
  }
}
      
Constraints
http://vocabularies.xenzone.com/xcp-api/0.0.1/UpdateServiceUser.schema.json
        
{
  "title": "UpdateServiceUser",
  "type": "object",
  "properties": {
    "@type": {
      "type": "string"
    },
    "applicationServiceGroup": {
      "type": "object",
      "properties": {
        "@id": {
          "type": "string"
        },
        "@type": {
          "type": "string"
        }
      },
      "required": [
        "@id",
        "@type"
      ]
    },
    "customer": {
      "type": "object",
      "properties": {
        "@id": {
          "type": "string"
        },
        "@type": {
          "type": "string"
        }
      },
      "required": [
        "@id",
        "@type"
      ]
    }
  },
  "required": [
    "@type",
    "applicationServiceGroup",
    "customer"
  ]
}
      

Responses

Status code: 200
Response Headers
Response Body
            {
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@graph": [
    {
      "@id": "[event-id]",
      "@type": "ServiceUserUpdatedEvent",
      "atTime": "2018-01-10T16:56:15Z",
      "causedBy": "commands/[command-uuid]"
    },
    {
      "@id": "[service-user-id]",
      "@type": "ServiceUser",
      "applicationServiceGroup": {
        "@id": "[asg-id]",
        "@type": "ApplicationServiceGroup"
      },
      "customer": {
        "@id": "[customer-id]",
        "@type": "Customer",
      }
    }
  ]
}
          
Status code: 400
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity is invalid - [actual information]"
    
    }
		
          
Status code: 401
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The requested resource requires authorization"
    
    }
		
          
Status code: 403
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "You are not authorized to access the resource"
    
    }
		
          
Status code: 500
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "Server error - [actual information]"
    
    }
		
          

Emits

ServiceUserUpdatedEvent
Path: null
Method: null
Body

            {
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@graph": [
    {
      "@id": "[event-id]",
      "@type": "ServiceUserUpdatedEvent",
      "atTime": "2018-01-10T16:56:15Z",
      "causedBy": "commands/[command-uuid]"
    },
    {
      "@id": "[service-user-id]",
      "@type": "ServiceUser",
      "applicationServiceGroup": {
        "@id": "[asg-id]",
        "@type": "ApplicationServiceGroup"
      },
      "customer": {
        "@id": "[customer-id]",
        "@type": "Customer",
      }
    }
  ]
}
          

[#] [back to top]

UpdateServiceUserNextOfKin

Create or update a new service user personal profile

Path /service-users/[id]/next-of-kin/[1-or-2]/
Method PUT
Headers
Query Parameters
Request Body
        
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@type" : "Father||Mother||Sibling||GrandParent||Guardian||OtherNextOfKin",
  "nameTitle" : "Dr, Mrs etc",
  "firstName" : "firstname",
  "lastName" : "surname",
  "telephoneNumber" : "telephone number",
  "fullAddress" : "full address",
  "emailAddress" : "jack@jill.com"
}

      
Constraints
http://vocabularies.xenzone.com/xcp-api/0.0.1/UpdateServiceUserNextOfKin.schema.json
        
{
    "title": "UpdateServiceUserNextOfKin",
    "type": "object",
    "properties": {
      "@type": {
        "type" : "string",
        "default" : "OtherNextOfKin"
      },
      
      "firstName": {
        "type" : "string"
      },
      "lastName": {
        "type" : "string"
      },
      "telephoneNumber": {
        "type" : "string"
      },
      "fullAddress": {
        "type" : "string"
      },
      "emailAddress": {
        "type" : "email"
      }

    },
    "required":["@type"]
}

  
      

Responses

Status code: 200
Response Headers
Response Body
            
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@graph" : [
    {"@type":"ServiceUserNextOfKinUpdatedEvent"},
    {"@type" : "Father||Mother||Sibling||GrandParent||Guardian||Carer||OtherNextOfKin",
    "@id" : "/service-users/[id]/next-of-kin/[1-or-2]/",
    "nameTitle" : "Dr, Mrs etc",
    "firstName" : "firstname",
    "lastName" : "surname",
    "telephoneNumber" : "telephone number",
    "fullAddress" : "full address",
    "emailAddress" : "jack@jill.com"}
  ]
}

          
Status code: 200
Response Headers
Response Body
            
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@graph" : [
    {"@type":"ServiceUserNextOfKinUpdatedEvent"},
    {"@type" : "Father||Mother||Sibling||GrandParent||Guardian||OtherNextOfKin",
    "@id" : "/service-users/[id]/next-of-kin/[1-or-2]/",
    "nameTitle" : "Dr, Mrs etc",
    "firstName" : "firstname",
    "lastName" : "surname",
    "telephoneNumber" : "telephone number",
    "fullAddress" : "full address",
    "emailAddress" : "jack@jill.com"}
  ]
}

          
Status code: 201
Response Headers
Response Body
            
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@graph" : [
    {"@type":"ServiceUserNextOfKinUpdatedEvent"},
    {"@type" : "Father||Mother||Sibling||GrandParent||Guardian||Carer||OtherNextOfKin",
    "@id" : "/service-users/[id]/next-of-kin/[1-or-2]/",
    "nameTitle" : "Dr, Mrs etc",
    "firstName" : "firstname",
    "lastName" : "surname",
    "telephoneNumber" : "telephone number",
    "fullAddress" : "full address",
    "emailAddress" : "jack@jill.com"}
  ]
}

          
Status code: 201
Response Headers
Response Body
            
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@graph" : [
    {"@type":"ServiceUserNextOfKinUpdatedEvent"},
    {"@type" : "Father||Mother||Sibling||GrandParent||Guardian||OtherNextOfKin",
    "@id" : "/service-users/[id]/next-of-kin/[1-or-2]/",
    "nameTitle" : "Dr, Mrs etc",
    "firstName" : "firstname",
    "lastName" : "surname",
    "telephoneNumber" : "telephone number",
    "fullAddress" : "full address",
    "emailAddress" : "jack@jill.com"}
  ]
}

          
Status code: 400
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity is invalid - [actual information]"
    
    }
		
          
Status code: 401
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The requested resource requires authorization"
    
    }
		
          
Status code: 403
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "You are not authorized to access the resource"
    
    }
		
          
Status code: 500
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "Server error - [actual information]"
    
    }
		
          

Emits

ServiceUserNextOfKinUpdatedEvent
Path: null
Method: null
Body

            
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@graph" : [
    {"@type":"ServiceUserNextOfKinUpdatedEvent"},
    {"@type" : "Father||Mother||Sibling||GrandParent||Guardian||Carer||OtherNextOfKin",
    "@id" : "/service-users/[id]/next-of-kin/[1-or-2]/",
    "nameTitle" : "Dr, Mrs etc",
    "firstName" : "firstname",
    "lastName" : "surname",
    "telephoneNumber" : "telephone number",
    "fullAddress" : "full address",
    "emailAddress" : "jack@jill.com"}
  ]
}

          
ServiceUserNextOfKinUpdatedEvent
Path: null
Method: null
Body
            
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@graph" : [
    {"@type":"ServiceUserNextOfKinUpdatedEvent"},
    {"@type" : "Father||Mother||Sibling||GrandParent||Guardian||OtherNextOfKin",
    "@id" : "/service-users/[id]/next-of-kin/[1-or-2]/",
    "nameTitle" : "Dr, Mrs etc",
    "firstName" : "firstname",
    "lastName" : "surname",
    "telephoneNumber" : "telephone number",
    "fullAddress" : "full address",
    "emailAddress" : "jack@jill.com"}
  ]
}

          

[#] [back to top]

UpdateServiceUserPersonalProfile

Update an existing service user personal profile

Path /service-users/[id]/personal-profile/
Method PUT
Headers
Query Parameters
Request Body
        
  {
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "ServiceUserPersonalProfile",
    "avatar": {
      "@type": "Avatar",
      "@id": "[avatar-id]",
    },
    "nickname": "Joe",
    "nameTitle": "Mr",
    "firstName": "Joseph",
    "lastName": "Bloggs",
    "birthDate": "1966-04-21",
    "religion": {
      "@type": "Religion",
      "@id": "Buddhist",
    },
    "gender": {
      "@type": "Gender",
      "@id": "Male",
    },
    "disability": {
      "@type": "Disability",
      "@id": "Sight",
    },
    "ethnicity": {
      "@type": "Ethnicity",
      "@id": "Chinese",
    },
    "telephoneNumber": "+4402071234567",
    "fullAddress": "135 Park Avenue, London, N5 T46",
    "emailAddress": "test@xenzone.com",
    "contacts": [
      {
        "@type": "Contact",
        "school": "The London Academy",
        "role": "Teacher",
        "firstName": "Jane",
        "lastName": "Doe",
        "telephoneNumber": "+4402071234568",
      }
    ],
    "description": "This is a profile note",
    "heardAboutFrom": "My friend Paco el Flaco",
    "tags": [
      { "@type": "Vulnerability", "@id": "Neet" },
      { "@type": "Vulnerability", "@id": "YoungCarer" }
    ]
  }
  
  
      
Constraints
http://vocabularies.xenzone.com/xcp-api/0.0.1/UpdateServiceUserPersonalProfile.schema.json
        
{
  "title": "UpdateServiceUserPersonalProfile",
  "type": "object",
  "properties": {
    "@type": {
      "type": "string"
    },
    "avatar": {
      "type": "string"
    },
    "nickname": {
      "type": "string"
    },
    "nameTitle": {
      "type": "string"
    },
    "firstName": {
      "type": "string"
    },
    "lastName": {
      "type": "string"
    },
    "birthDate": { // should allow either YYYY-MM-DD or YYYY-MM (ISO8601 format)
      "anyOf": [        
        {
          "type": "string",
          "format": "date" // YYYY-MM-DD
        },        
        {
          "type": "string",
          "pattern": "([12][0-9]{3})-(0[1-9]|1[0-2])" // YYYY-MM
        }
      ]
    },
    "religion": {
      "type": "object",
      "properties": {
        "@type": {
          "type": "string"
        },
        "@id": {
          "type": "string",
          "enum": [
            "BahaI",
            "Buddhist",
            "Christian",
            "Hindu",
            "Jain",
            "Jewish",
            "Muslim",
            "Pagan",
            "Sikh",
            "Zoroastrian",
            "Other",
            "None",
            "DeclinesToDisclose",
            "Unknown",
          ]
        }
      },
      "required": [
        "@type",
        "@id"
      ]
    },
    "gender": {
      "type": "object",
      "properties": {
        "@type": {
          "type": "string"
        },
        "@id": {
          "type": "string",
          "enum": 
          [
            "Male",
            "Female",
            "Agender",
            "GenderFluid"
          ]
        }
      },
      "required": [
        "@type",
        "@id"
      ]
    },
    "disability": {
      "type": "object",
      "properties": 
      {
        "@type": {
          "type": "string"
        },
        "@id": {
          "type": "string",
          "enum": [
            "BehaviourAndEmotional",
            "Hearing",
            "ManualDexterity",
            "MemoryOrAbilityToConcentrateLearnOrUnderstandLearningDisability",
            "MobilityAndGrossMotor",
            "PerceptionOfPhysicalDanger",
            "PersonalSelfCareAndContinence",
            "ProgressiveConditionsAndPhysicalHealthSuchAsHivCancerMultipleSclerosisFitsEtc",
            "Sight",
            "Speech",
            "Other",
            "NoDisability",
            "NotStated",
          ]
        }
      },
      "required": [
        "@type",
        "@id"
      ]
    },
    "ethnicity": {
      "type": "object",
      "properties": {
        "@type": {
          "type": "string"
        },
        "@id": {
          "type": "string",
          "enum": [
            "WhiteAndBlackCaribbean",
            "WhiteAndBlackAfrican",
            "WhiteAndAsian",
            "AnyOtherMixedBackground",
            "British",
            "Irish",
            "AnyOtherWhiteBackground",
            "Indian",
            "Pakistani",
            "Bangladeshi",
            "AnyOtherAsianBackground",
            "Chinese",
            "AnyOtherEthnicGroup",
            "NotStated",
            "Caribbean",
            "African",
            "AnyOtherBlackBackground",
          ]
        }
      },
      "required": [
        "@type",
        "@id"
      ]
    },
    "telephoneNumber": {
      "pattern": "^\+[1-9]\d{1,14}$",
      "type": "string"
    },
    "fullAddress": {
      "type": "string"
    },
    "emailAddress": {
      "type": "string",
      "format": "email"
    },
    "contacts": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string"
          },
          "school": {
            "type": "string"
          },
          "role": {
            "type": "string"
          },
          "firstName": {
            "type": "string"
          },
          "lastName": {
            "type": "string"
          },
          "telephoneNumber": {
            "type": "string",
            "pattern": "^\+[1-9]\d{1,14}$"
          }
        },
        "required": [
          "@type"
        ]
      }
    },
    "description": {
      "type": "string"
    },
    "heardAboutFrom": {
      "type": "string"
    },
    "tags": {
      type: "array",
      uniqueItems: true,
      additionalProperties: false,
      minItems: 1,
      items: {
        anyOf: [
          {
            type: "object",
            required: ["@type", "@id"],
            additionalProperties: false,
            properties: {
              "@type": {
                type: "string",
                enum: [
                  "Vulnerability",
                ],
              },
              "@id": {
                type: "string",
                enum: [
                  "Send",
                  "SexualOrientation",
                  "Pregnancy",
                  "ReligionFaith",
                  "ArrangedMarriage",
                  "VulnerablyAccommodated",
                  "Neet",
                  "YoungCarer",
                  "ChildLookedAfter",
                  "YoungOffender",
                  "SubstanceMisuse",
                  "VictimOfCrime",
                  "EnglishAsSecondLanguage",
                ]
              }
            }
          }
        ]
      }
    }
  },
  "required": [
    "@type",
    "birthDate",
    "nickname"
  ]
}
      

Responses

Status code: 200
Response Headers
Response Body
            
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@graph": [
    {
      "@id": "[event-id]",
      "@type": "ServiceUserPersonalProfileUpdatedEvent",
      "atTime": "2018-01-10T16:56:15Z",
      "causedBy": "commands/[command-uuid]"
    },
    {
      "@type": "ServiceUserPersonalProfile",
      "@id": "[personal-profile-id]",
      "avatar": {
        "@type": "Avatar",
        "@id": "[avatar-id]",
      },
      "nickname": "Joe",
      "nameTitle": "Mr",
      "firstName": "Joseph",
      "lastName": "Bloggs",
      "birthDate": "1966-04-21",
      "religion": {
        "@type": "Religion",
        "@id": "Buddhist",
      },
      "gender": {
        "@type": "Gender",
        "@id": "Male",
      },
      "disability": {
        "@type": "Disability",
        "@id": "Sight",
      },
      "ethnicity": {
        "@type": "Ethnicity",
        "@id": "Chinese",
      },
      "telephoneNumber": "+4402071234567",
      "fullAddress": "135 Park Avenue, London, N5 T46",
      "emailAddress": "test@xenzone.com",
      "contacts": [
        {
          "@type": "Contact",
          "school": "The London Academy",
          "role": "Teacher",
          "firstName": "Jane",
          "lastName": "Doe",
          "telephoneNumber": "+4402071234568",
        }
      ],
      "description": "This is a profile note",
      "heardAboutFrom": "My friend Paco el Flaco",
      "tags": [
        { "@type": "Vulnerability", "@id": "Neet" },
        { "@type": "Vulnerability", "@id": "YoungCarer" }
      ]
    },
    {
      "@type": "ServiceUser",
      "@id": "[service-user-id]",
      "applicationServiceGroup": {
        "@id": "[asg-id]",
        "@type": "ApplicationServiceGroup"
      },
      "customer": {
        "@type": "Customer",
        "@id": "[customer-id]"
      }
    }
  ]
}
          
Status code: 400
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity is invalid - [actual information]"
    
    }
		
          
Status code: 401
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The requested resource requires authorization"
    
    }
		
          
Status code: 403
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "You are not authorized to access the resource"
    
    }
		
          
Status code: 404
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity was not found - [actual information]"
    
    }
		
          
Status code: 500
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "Server error - [actual information]"
    
    }
		
          

Emits

ServiceUserPersonalProfileUpdatedEvent
Path: null
Method: null
Body

            
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@graph": [
    {
      "@id": "[event-id]",
      "@type": "ServiceUserPersonalProfileUpdatedEvent",
      "atTime": "2018-01-10T16:56:15Z",
      "causedBy": "commands/[command-uuid]"
    },
    {
      "@type": "ServiceUserPersonalProfile",
      "@id": "[personal-profile-id]",
      "avatar": {
        "@type": "Avatar",
        "@id": "[avatar-id]",
      },
      "nickname": "Joe",
      "nameTitle": "Mr",
      "firstName": "Joseph",
      "lastName": "Bloggs",
      "birthDate": "1966-04-21",
      "religion": {
        "@type": "Religion",
        "@id": "Buddhist",
      },
      "gender": {
        "@type": "Gender",
        "@id": "Male",
      },
      "disability": {
        "@type": "Disability",
        "@id": "Sight",
      },
      "ethnicity": {
        "@type": "Ethnicity",
        "@id": "Chinese",
      },
      "telephoneNumber": "+4402071234567",
      "fullAddress": "135 Park Avenue, London, N5 T46",
      "emailAddress": "test@xenzone.com",
      "contacts": [
        {
          "@type": "Contact",
          "school": "The London Academy",
          "role": "Teacher",
          "firstName": "Jane",
          "lastName": "Doe",
          "telephoneNumber": "+4402071234568",
        }
      ],
      "description": "This is a profile note",
      "heardAboutFrom": "My friend Paco el Flaco",
      "tags": [
        { "@type": "Vulnerability", "@id": "Neet" },
        { "@type": "Vulnerability", "@id": "YoungCarer" }
      ]
    },
    {
      "@type": "ServiceUser",
      "@id": "[service-user-id]",
      "applicationServiceGroup": {
        "@id": "[asg-id]",
        "@type": "ApplicationServiceGroup"
      },
      "customer": {
        "@type": "Customer",
        "@id": "[customer-id]"
      }
    }
  ]
}
          

[#] [back to top]

Clinical Service - Worker

AddAppointmentParticipant

A command to add a participant to an appointment

Path /appointments/[appointment-id]/participants
Method PUT
Headers
Authorization: JWT
Accepts: application/json+ld
Content-Type: application/json+ld
Query Parameters
Request Body
        
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@type": "Participant",
  "user": { "@id": "6de5bb4e-6f81-4f85-82cf-7bca85703fac", "@type": "Worker" }
}

      
Constraints
http://vocabularies.xenzone.com/xcp-api/0.0.1/AddAppointmentParticipant.schema.json
        
{
  "title": "AddAppointmentParticipant",
  "type": "object",
  "properties": {
    "@type": {
      "type": "string"
    },
    "user": {
      "type": "object",
      "properties": {
        "@id": {
          "type": "string",
          "minLength": 1
        },
        "@type": {
          "type": "string",
          "enum": [
            "Worker",
            "ServiceUser"
          ]
        }
      },
      "required": [
        "@id",
        "@type"
      ]
    },
    "host": {
      "type": "boolean",
      "default": "false"
    }
  },
  "required": [
    "@type",
    "user"
  ]
}
  
      

Responses

Status code: 200
Response Headers
Response Body
            
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@graph" : [
    {"@type" : "AddAppointmentParticipantEvent"},
    {
      "@context": "https://vocabularies.xenzone.com/context.jsonld",
      "@type": "Participant",
      "user": { "@id": "6de5bb4e-6f81-4f85-82cf-7bca85703fac", "@type": "Worker" },
      "host": false
    }
  ]
}

          
Status code: 400
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity is invalid - [actual information]"
    
    }
		
          
Status code: 401
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The requested resource requires authorization"
    
    }
		
          
Status code: 403
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "You are not authorized to access the resource"
    
    }
		
          
Status code: 500
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "Server error - [actual information]"
    
    }
		
          

Emits

AddAppointmentParticipantEvent
Path: null
Method: null
Body

            
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@graph" : [
    {"@type" : "AddAppointmentParticipantEvent"},
    {
      "@context": "https://vocabularies.xenzone.com/context.jsonld",
      "@type": "Participant",
      "user": { "@id": "6de5bb4e-6f81-4f85-82cf-7bca85703fac", "@type": "Worker" },
      "host": false
    }
  ]
}

          

[#] [back to top]

AssignWorkerToImpromptuChat

A command to assigned a worker to an impromptu chat

Path /impromptu-chats/[impromptu-chat-id]/workers
Method PUT
Headers
Authorization: JWT
Accepts: application/json+ld
Content-Type: application/json+ld
Query Parameters
Request Body
        
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@id": "6de5bb4e-6f81-4f85-82cf-7bca85703fac",
  "@type": "Worker"
}

      
Constraints
http://vocabularies.xenzone.com/xcp-api/0.0.1/AssignWorkerToImpromptuChat.schema.json
        
{
  "title": "AssignWorkerToImpromptuChat",
  "type": "object",
  "properties": {
    "@id": {
      "type": "string",
      "minLength": 1
    },
    "@type": {
      "type": "string",
      "enum": [
        "Worker"
      ]
    }
  },
  "required": [
    "@id",
    "@type"
  ]
}
  
      

Responses

Status code: 200
Response Headers
Response Body
            
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@graph" : [
    {"@type" : "AssignWorkerToImpromptuChatEvent"},
    {
      "@context": "https://vocabularies.xenzone.com/context.jsonld",
      "@id": "6de5bb4e-6f81-4f85-82cf-7bca85703fac",
      "@type": "Worker"
    }
  ]
}

          
Status code: 400
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity is invalid - [actual information]"
    
    }
		
          
Status code: 401
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The requested resource requires authorization"
    
    }
		
          
Status code: 403
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "You are not authorized to access the resource"
    
    }
		
          
Status code: 404
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity was not found - [actual information]"
    
    }
		
          
Status code: 500
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "Server error - [actual information]"
    
    }
		
          

Emits

AssignWorkerToImpromptuChatEvent
Path: null
Method: null
Body

            
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@graph" : [
    {"@type" : "AssignWorkerToImpromptuChatEvent"},
    {
      "@context": "https://vocabularies.xenzone.com/context.jsonld",
      "@id": "6de5bb4e-6f81-4f85-82cf-7bca85703fac",
      "@type": "Worker"
    }
  ]
}

          

[#] [back to top]

CreateAppointment

A command to create a new appointment.

Path /appointments
Method POST
Headers
Authorization: JWT
Accepts: application/json+ld
Content-Type: application/json+ld
Query Parameters
Request Body
        
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@type": "Appointment",
  "startTime": "2018-01-01T12:00:00.000Z",
  "endTime": "2018-01-01T12:30:00.000Z",
  "participants": [
    {
      "@type": "Participant",
      "user": {
        "@id": "6de5bb4e-6f81-4f85-82cf-7bca85703fac",
        "@type": "Worker"
      },
      "host": true
    },
    {
      "@type": "Participant",
      "user": {
        "@id": "6de5bb4e-6f81-4f85-82cf-7bca85703fad",
        "@type": "ServiceUser"
      }
    }
  ],
  "description": "A description",
  "applicationServiceGroup": {
    "@id": "asg/YoungPeople",
    "@type": 'ApplicationServiceGroup'
  },
  "application": {
    "@id": "20fc60c1-d232-48a4-96ed-85b03fddc0a4",
    "@type": "Application"
  }
}
    
      
Constraints
http://vocabularies.xenzone.com/xcp-api/0.0.1/CreateAppointment.schema.json
        
{
  "title": "CreateAppointment",
  "type": "object",
  "properties": {
    "@type": {
        "type": "string"
    },
    "startTime": {
        "type": "string",
        "format": "date-time"
    },
    "endTime": {
        "type": "string",
        "format": "date-time"
    },
    "participants": {
      "type": "array",
      "minItems": 2,
      "items": {
        "type": "object",
        "properties": {
          "@type": {
              "type": "string"
          },
          "user": {
            "type": "object",
            "properties": {
              "@id": { "type": "string", "minLength": 1 },
              "@type": { "type": "string", "enum": ["Worker", "ServiceUser"] }
            },
            "required": ["@id", "@type"]
          },
          "host": {
            "type": "boolean",
            "default": false
          }
        },
        "required": ["@type", "user"]
      }
    },
    "description": {
      type: "string",
      minLength: 1,
    },
    "applicationServiceGroup": {
      type: "object",
      properties: {
        "@id": { type: "string" },
        "@type": { type: "string", enum: ["ApplicationServiceGroup"] },
      },
      required: ["@id", "@type"],
    },
    "application": {
      type: "object",
      properties: {
        "@id": { type: "string", minLength: 1 },
        "@type": { type: "string", enum: ["Application"] },
      },
      required: ["@id", "@type"],
    },
  },
  "required": ["@type", "startTime", "endTime", "participants"]
}
  
      

Responses

Status code: 201
Response Headers
Response Body
            
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@graph": [
    {
      "@type": "CreateAppointmentEvent"
    },
    {
      "@id": "6de5bb4e-6f81-4f85-82cf-7bca85703fab",
      "@type": "Appointment",
      "startTime": "2018-01-01T12:00:00.000Z",
      "endTime": "2018-01-01T12:30:00.000Z",
      "participants": [
        {
          "@type": "Participant",
          "user": {
            "@id": "6de5bb4e-6f81-4f85-82cf-7bca85703fac",
            "@type": "Worker"
          },
          "host": true
        },
        {
          "@type": "Participant",
          "user": {
            "@id": "6de5bb4e-6f81-4f85-82cf-7bca85703fad",
            "@type": "ServiceUser"
          },
          "host": false
        }
      ],
      "status": {
        "@id": "Pending",
        "@type": "Status"
      },
      "description": "A description",
      "applicationServiceGroup": {
        "@id": "asg/YoungPeople",
        "@type": 'ApplicationServiceGroup'
      },
      "application": {
        "@id": "20fc60c1-d232-48a4-96ed-85b03fddc0a4",
        "@type": "Application"
      }
    }
  ]
}

          
Status code: 400
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity is invalid - [actual information]"
    
    }
		
          
Status code: 401
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The requested resource requires authorization"
    
    }
		
          
Status code: 403
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "You are not authorized to access the resource"
    
    }
		
          
Status code: 409
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity conflicts with an pre-existing entity - [actual information]"
    
    }
		
          
Status code: 500
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "Server error - [actual information]"
    
    }
		
          

Emits

CreateAppointmentEvent
Path: null
Method: null
Body

            
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@graph": [
    {
      "@type": "CreateAppointmentEvent"
    },
    {
      "@id": "6de5bb4e-6f81-4f85-82cf-7bca85703fab",
      "@type": "Appointment",
      "startTime": "2018-01-01T12:00:00.000Z",
      "endTime": "2018-01-01T12:30:00.000Z",
      "participants": [
        {
          "@type": "Participant",
          "user": {
            "@id": "6de5bb4e-6f81-4f85-82cf-7bca85703fac",
            "@type": "Worker"
          },
          "host": true
        },
        {
          "@type": "Participant",
          "user": {
            "@id": "6de5bb4e-6f81-4f85-82cf-7bca85703fad",
            "@type": "ServiceUser"
          },
          "host": false
        }
      ],
      "status": {
        "@id": "Pending",
        "@type": "Status"
      },
      "description": "A description",
      "applicationServiceGroup": {
        "@id": "asg/YoungPeople",
        "@type": 'ApplicationServiceGroup'
      },
      "application": {
        "@id": "20fc60c1-d232-48a4-96ed-85b03fddc0a4",
        "@type": "Application"
      }
    }
  ]
}

          

[#] [back to top]

CreateImpromptuChat

A command to create a new impromptu chat.

Path /impromptu-chats
Method POST
Headers
Authorization: JWT
Accepts: application/json+ld
Content-Type: application/json+ld
Query Parameters
Request Body
        
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@type": "ImpromptuChat",
  "serviceUser": {
    "@id": "6de5bb4e-6f81-4f85-82cf-7bca85703fac",
    "@type": "ServiceUser"
  },
  "assignedWorker": {
    "@id": "6de5bb4e-6f81-4f85-82cf-7bca85703fad",
    "@type": "Worker"
  },
  "applicationServiceGroup": {
    "@id": "asg/YoungPeople",
    "@type": 'ApplicationServiceGroup'
  },
  "application": {
    "@id": "20fc60c1-d232-48a4-96ed-85b03fddc0a4",
    "@type": "Application"
  }
}
    
      
Constraints
http://vocabularies.xenzone.com/xcp-api/0.0.1/CreateImpromptuChat.schema.json
        
{
  "title": "CreateImpromptuChat",
  "type": "object",
  "properties": {
    "@type": {
      "type": "string"
    },
    "serviceUser": {
      "type": "object",
      "properties": {
        "@id": { "type": "string", "minLength": 1 },
        "@type": { "type": "string", "enum": ["ServiceUser"] }
      },
      "required": ["@id", "@type"]
    },
    "assignedWorker": {
      "type": "object",
      "properties": {
        "@id": { "type": "string", "minLength": 1 },
        "@type": { "type": "string", "enum": ["Worker"] }
      },
      "required": ["@id", "@type"]
    },
    "applicationServiceGroup": {
      "type": "object",
      "properties": {
        "@id": { "type": "string" },
        "@type": { "type": "string", "enum": ["ApplicationServiceGroup"] }
      },
      "required": ["@id", "@type"]
    },
    "application": {
      "type": "object",
      "properties": {
        "@id": { "type": "string", "minLength": 1 },
        "@type": { "type": "string", "enum": ["Application"] }
      },
      "required": ["@id"]
    }
  },
  "required": ["@type", "serviceUser"]
}
  
      

Responses

Status code: 201
Response Headers
Response Body
            
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@graph": [
    {
      "@type": "CreateImpromptuChatEvent"
    },
    {
      "@id": "6de5bb4e-6f81-4f85-82cf-7bca85703fab",
      "@type": "ImpromptuChat",
      "dateTimeCreated": "2018-01-01T12:00:00.000Z",
      "serviceUser": {
        "@id": "6de5bb4e-6f81-4f85-82cf-7bca85703fac",
        "@type": "ServiceUser"
      },
      "assignedWorker": {
        "@id": "6de5bb4e-6f81-4f85-82cf-7bca85703fad",
        "@type": "Worker"
      },
      "applicationServiceGroup": {
        "@id": "asg/YoungPeople",
        "@type": 'ApplicationServiceGroup'
      },
      "application": {
        "@id": "20fc60c1-d232-48a4-96ed-85b03fddc0a4",
        "@type": "Application"
      }
    }
  ]
}

          
Status code: 400
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity is invalid - [actual information]"
    
    }
		
          
Status code: 401
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The requested resource requires authorization"
    
    }
		
          
Status code: 403
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "You are not authorized to access the resource"
    
    }
		
          
Status code: 409
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity conflicts with an pre-existing entity - [actual information]"
    
    }
		
          
Status code: 500
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "Server error - [actual information]"
    
    }
		
          

Emits

CreateImpromptuChatEvent
Path: null
Method: null
Body

            
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@graph": [
    {
      "@type": "CreateImpromptuChatEvent"
    },
    {
      "@id": "6de5bb4e-6f81-4f85-82cf-7bca85703fab",
      "@type": "ImpromptuChat",
      "dateTimeCreated": "2018-01-01T12:00:00.000Z",
      "serviceUser": {
        "@id": "6de5bb4e-6f81-4f85-82cf-7bca85703fac",
        "@type": "ServiceUser"
      },
      "assignedWorker": {
        "@id": "6de5bb4e-6f81-4f85-82cf-7bca85703fad",
        "@type": "Worker"
      },
      "applicationServiceGroup": {
        "@id": "asg/YoungPeople",
        "@type": 'ApplicationServiceGroup'
      },
      "application": {
        "@id": "20fc60c1-d232-48a4-96ed-85b03fddc0a4",
        "@type": "Application"
      }
    }
  ]
}

          

[#] [back to top]

CreateWorker

A command to create a new worker. This is without roles

Path /workers
Method POST
Headers
Authorization: JWT
Accepts: application/json+ld
Content-Type: application/json+ld
Query Parameters
Request Body
        {
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@type": "Worker",
  "emailAddress" : "john.smith@smithy.com"
}
      
Constraints
http://vocabularies.xenzone.com/xcp-api/0.0.1/CreateWorker.schema.json
        {
  "type": "object",
  "properties": {
    "@type": {
      "type": "string",
    },
    "emailAddress": {
      "type": "string",
    }
  },
  "required": [
    "@type",
    "emailAddress"
  ]
}
      

Responses

Status code: 201
Response Headers
Response Body
            {
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@graph": [
    {
      "@id": "[event-id]",
      "@type": "WorkerCreatedEvent",
      "atTime": "2018-01-10T16:56:15Z",
      "causedBy": "commands/[command-uuid]"
    },
    {
      "@id": "[worker-id]",
      "@type": "Worker",
      "emailAddress": "john.smith@smithy.com"
    }
  ]
}
          
Status code: 400
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity is invalid - [actual information]"
    
    }
		
          
Status code: 401
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The requested resource requires authorization"
    
    }
		
          
Status code: 403
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "You are not authorized to access the resource"
    
    }
		
          
Status code: 409
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity conflicts with an pre-existing entity - [actual information]"
    
    }
		
          
Status code: 500
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "Server error - [actual information]"
    
    }
		
          

Emits

EmailPreparedEvent
Path: /subscribers/[service-name]/EmailPrepared
Method: POST
Body

            {
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@graph": [
    {
      "@id": "[event-id]",
      "@type": "EmailPreparedEvent",
      "atTime": "2018-01-10T16:56:15Z",
      "causedBy": "commands/[command-uuid]"
    },
    {
      "@type": "Email",
      "subject": "Welcome to XCP",
      "body": [
        {
          "@type": "HtmlBody",
          "content": "Lorem Ipsum"
        },
        {
          "@type": "TextBody",
          "content": "Lorem Ipsum"
        }
      ],
      "from": {
        "emailAddress": "platform@xenzone.com",
        "name": "XenZone Platform"
      },
      "to": [
        {
          "emailAddress": "t.cooper@example.com"
        },
        {
          "name": "j.smith@example.com"
        }
      ]
    }
  ]
}
          
WorkerCreatedEvent
Path: /subscribers/[service-name]/WorkerCreatedEvent
Method: null
Body
            {
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@graph": [
    {
      "@id": "[event-id]",
      "@type": "WorkerCreatedEvent",
      "atTime": "2018-01-10T16:56:15Z",
      "causedBy": "commands/[command-uuid]"
    },
    {
      "@id": "[worker-id]",
      "@type": "Worker",
      "emailAddress": "john.smith@smithy.com"
    }
  ]
}
          

[#] [back to top]

CreateWorkerPersonalProfile

A command to create a worker personal profile

Path /workers/[worker-id]/personal-profile/ or /workers/me/personal-profile/
Method POST
Headers
Authorization: JWT
Accepts: application/json+ld
Content-Type: application/json+ld
Query Parameters
Request Body
        {
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@type": "WorkerPersonalProfile",
  "firstName": "first name",
  "lastName": "last name",
  "aboutMe": "about me",
  "therapiesOffered": "therapies offered by the worker",
  "preferredProfessionalBodies": "membership of professional bodies",
  "qualifications": "qualifications, training etc",
  "whenImAvailable": "when I am available",
  "gender": {
    "@id": "service-users/genders/Male",
    "@type": "Gender"
  }
}
      
Constraints
http://vocabularies.xenzone.com/xcp-api/0.0.1/CreateWorkerPersonalProfile.schema.json
        {
  "title": "CreateWorkerPersonalProfile",
  "type": "object",
  "properties": {
    "@type": {
       "type": "string",
    },
    "firstName": {
      "type": "string",
      "maxLength": 20,
    },
    "lastName": {
      "type": "string",
      "maxLength": 20,
    },
    "aboutMe": {
      "type": "string",
      "maxLength": 1000,
    },
    "therapiesOffered": {
      "type": "string",
      "maxLength": 750,
    },
    "preferredProfessionalBodies": {
      "type": "string",
      "maxLength": 300,
    },
    "qualifications": {
      "type": "string",
      "maxLength": 1000,
    },
    "whenImAvailable": {
      "type": "string",
      "maxLength": 300,
    },
    "gender": {
      "type": "object",
      "properties": {
        "@type": {
          "type": "string",
        },
        "@id": {
          "type": "string",
          "enum": [
            "service-users/genders/Male",
            "service-users/genders/Female",
            "service-users/genders/Agender",
            "service-users/genders/Gender fluid",
          ],
        },
      },
    },
  },
  "required": [
    "@type",
    "firstName",
    "lastName",
    "aboutMe",
    "preferredProfessionalBodies",
    "qualifications",
    "gender",
  ]
}
      

Responses

Status code: 201
Response Headers
Response Body
            {
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@graph": [
    {
      "@id": "[event-id]",
      "@type": "WorkerPersonalProfileCreatedEvent",
      "atTime": "2018-01-10T16:56:15Z",
      "causedBy": "commands/[command-uuid]"
    },
    {
      "@id": "[personal-profile-id]",
      "@type": "WorkerPersonalProfile",
      "firstName": "first name",
      "lastName": "last name",
      "aboutMe": "about me",
      "therapiesOffered": "therapies offered by the worker",
      "preferredProfessionalBodies": "membership of professional bodies",
      "qualifications": "qualifications, training etc",
      "whenImAvailable": "when I am available",
      "gender": {
        "@id": "service-users/genders/Male",
        "@type": "Gender"
      }
    }
  ]
}
          
Status code: 400
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity is invalid - [actual information]"
    
    }
		
          
Status code: 401
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The requested resource requires authorization"
    
    }
		
          
Status code: 403
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "You are not authorized to access the resource"
    
    }
		
          
Status code: 409
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity conflicts with an pre-existing entity - [actual information]"
    
    }
		
          
Status code: 500
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "Server error - [actual information]"
    
    }
		
          

Emits

WorkerPersonalProfileCreatedEvent
Path: /subscribers/[service-name]/WorkerPersonalProfileCreatedEvent
Method: null
Body

            {
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@graph": [
    {
      "@id": "[event-id]",
      "@type": "WorkerPersonalProfileCreatedEvent",
      "atTime": "2018-01-10T16:56:15Z",
      "causedBy": "commands/[command-uuid]"
    },
    {
      "@id": "[personal-profile-id]",
      "@type": "WorkerPersonalProfile",
      "firstName": "first name",
      "lastName": "last name",
      "aboutMe": "about me",
      "therapiesOffered": "therapies offered by the worker",
      "preferredProfessionalBodies": "membership of professional bodies",
      "qualifications": "qualifications, training etc",
      "whenImAvailable": "when I am available",
      "gender": {
        "@id": "service-users/genders/Male",
        "@type": "Gender"
      }
    }
  ]
}
          

[#] [back to top]

DeleteAppointment

Delete an appointment

Path /appointments/[appointment-id]
Method DELETE
Headers
Authorization: JWT
Accepts: application/json+ld
Content-Type: application/json+ld
Query Parameters

Responses

Status code: 200
Response Headers
Response Body
            
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@graph": [
    {
      "@type": "DeleteAppointmentEvent"
    },
    {
      "@id": "6de5bb4e-6f81-4f85-82cf-7bca85703fab",
      "@type": "Appointment",
      "startTime": "2018-01-01T12:00:00.000Z",
      "endTime": "2018-01-01T12:30:00.000Z",
      "participants": [
        {
          "@type": "Participant",
          "user": {
            "@id": "6de5bb4e-6f81-4f85-82cf-7bca85703fac",
            "@type": "Worker"
          },
          "host": true
        },
        {
          "@type": "Participant",
          "user": {
            "@id": "6de5bb4e-6f81-4f85-82cf-7bca85703fad",
            "@type": "ServiceUser"
          },
          "host": false
        }
      ],
      "status": {
        "@id": "Pending",
        "@type": "Status"
      },
      "description": "A description",
      "applicationServiceGroup": {
        "@id": "asg/YoungPeople",
        "@type": 'ApplicationServiceGroup'
      },
      "application": {
        "@id": "20fc60c1-d232-48a4-96ed-85b03fddc0a4",
        "@type": "Application"
      }
    }
  ]
}

          
Status code: 401
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The requested resource requires authorization"
    
    }
		
          
Status code: 403
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "You are not authorized to access the resource"
    
    }
		
          
Status code: 404
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity was not found - [actual information]"
    
    }
		
          
Status code: 500
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "Server error - [actual information]"
    
    }
		
          

Emits

DeleteAppointmentEvent
Path: null
Method: null
Body

            
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@graph": [
    {
      "@type": "DeleteAppointmentEvent"
    },
    {
      "@id": "6de5bb4e-6f81-4f85-82cf-7bca85703fab",
      "@type": "Appointment",
      "startTime": "2018-01-01T12:00:00.000Z",
      "endTime": "2018-01-01T12:30:00.000Z",
      "participants": [
        {
          "@type": "Participant",
          "user": {
            "@id": "6de5bb4e-6f81-4f85-82cf-7bca85703fac",
            "@type": "Worker"
          },
          "host": true
        },
        {
          "@type": "Participant",
          "user": {
            "@id": "6de5bb4e-6f81-4f85-82cf-7bca85703fad",
            "@type": "ServiceUser"
          },
          "host": false
        }
      ],
      "status": {
        "@id": "Pending",
        "@type": "Status"
      },
      "description": "A description",
      "applicationServiceGroup": {
        "@id": "asg/YoungPeople",
        "@type": 'ApplicationServiceGroup'
      },
      "application": {
        "@id": "20fc60c1-d232-48a4-96ed-85b03fddc0a4",
        "@type": "Application"
      }
    }
  ]
}

          

[#] [back to top]

DeleteImpromptuChat

Delete an impromptu chat

Path /impromptu-chats/[impromptu-chat-id]
Method DELETE
Headers
Authorization: JWT
Accepts: application/json+ld
Content-Type: application/json+ld
Query Parameters

Responses

Status code: 200
Response Headers
Response Body
            
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@graph": [
    {
      "@type": "DeleteImpromptuChatEvent"
    },
    {
      "@id": "6de5bb4e-6f81-4f85-82cf-7bca85703fab",
      "@type": "ImpromptuChat",
      "dateTimeCreated": "2018-01-01T12:00:00.000Z",
      "serviceUser": {
        "@id": "6de5bb4e-6f81-4f85-82cf-7bca85703fac",
        "@type": "ServiceUser"
      },
      "assignedWorker": {
        "@id": "6de5bb4e-6f81-4f85-82cf-7bca85703fad",
        "@type": "Worker"
      },
      "applicationServiceGroup": {
        "@id": "asg/YoungPeople",
        "@type": 'ApplicationServiceGroup'
      },
      "application": {
        "@id": "20fc60c1-d232-48a4-96ed-85b03fddc0a4",
        "@type": "Application"
      }
    }
  ]
}

          
Status code: 401
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The requested resource requires authorization"
    
    }
		
          
Status code: 403
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "You are not authorized to access the resource"
    
    }
		
          
Status code: 404
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity was not found - [actual information]"
    
    }
		
          
Status code: 500
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "Server error - [actual information]"
    
    }
		
          

Emits

DeleteImpromptuChatEvent
Path: null
Method: null
Body

            
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@graph": [
    {
      "@type": "DeleteImpromptuChatEvent"
    },
    {
      "@id": "6de5bb4e-6f81-4f85-82cf-7bca85703fab",
      "@type": "ImpromptuChat",
      "dateTimeCreated": "2018-01-01T12:00:00.000Z",
      "serviceUser": {
        "@id": "6de5bb4e-6f81-4f85-82cf-7bca85703fac",
        "@type": "ServiceUser"
      },
      "assignedWorker": {
        "@id": "6de5bb4e-6f81-4f85-82cf-7bca85703fad",
        "@type": "Worker"
      },
      "applicationServiceGroup": {
        "@id": "asg/YoungPeople",
        "@type": 'ApplicationServiceGroup'
      },
      "application": {
        "@id": "20fc60c1-d232-48a4-96ed-85b03fddc0a4",
        "@type": "Application"
      }
    }
  ]
}

          

[#] [back to top]

GetAppointment

Get an appointment

Path /appointments/[appointment-id]
Method GET
Headers
Authorization: JWT
Accepts: application/json+ld
Content-Type: application/json+ld
Query Parameters

Responses

Status code: 200
Response Headers
Response Body
            
{
  "@id": "6de5bb4e-6f81-4f85-82cf-7bca85703fab",
  "@type": "Appointment",
  "startTime": "2018-01-01T12:00:00.000Z",
  "endTime": "2018-01-01T12:30:00.000Z",
  "participants": [
    {
      "@type": "Participant",
      "user": {
        "@id": "6de5bb4e-6f81-4f85-82cf-7bca85703fac",
        "@type": "Worker"
      },
      "host": true
    },
    {
      "@type": "Participant",
      "user": {
        "@id": "6de5bb4e-6f81-4f85-82cf-7bca85703fad",
        "@type": "ServiceUser"
      },
      "host": false
    }
  ],
  "status": {
    "@id": "Pending",
    "@type": "Status"
  },
  "description": "A description",
  "applicationServiceGroup": {
    "@id": "asg/YoungPeople",
    "@type": 'ApplicationServiceGroup'
  },
  "application": {
    "@id": "20fc60c1-d232-48a4-96ed-85b03fddc0a4",
    "@type": "Application"
  }
}

          
Status code: 400
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity is invalid - [actual information]"
    
    }
		
          
Status code: 401
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The requested resource requires authorization"
    
    }
		
          
Status code: 403
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "You are not authorized to access the resource"
    
    }
		
          
Status code: 500
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "Server error - [actual information]"
    
    }
		
          

Emits

[#] [back to top]

GetAppointments

Get all appointments

Path /appointments
Method GET
Headers
Authorization: JWT
Accepts: application/json+ld
Content-Type: application/json+ld
Query Parameters
applicationServiceGroupId: application service group id
applicationId: application id
participantId: the participant id to filter by
startTime: the minimum appointment start time
endTime: the maximum appointment end time
status: the status to filter appointments by
perPage: number of results per page
page: page of results to fetch

Responses

Status code: 200
Response Headers
Response Body
            
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@type": "Collection",
  "results": [
    {
      "@id": "6de5bb4e-6f81-4f85-82cf-7bca85703fab",
      "@type": "Appointment",
      "startTime": "2018-01-01T12:00:00.000Z",
      "endTime": "2018-01-01T12:30:00.000Z",
      "participants": [
        {
          "@type": "Participant",
          "user": {
            "@id": "6de5bb4e-6f81-4f85-82cf-7bca85703fac",
            "@type": "Worker"
          },
          "host": true
        },
        {
          "@type": "Participant",
          "user": {
            "@id": "6de5bb4e-6f81-4f85-82cf-7bca85703fad",
            "@type": "ServiceUser"
          },
          "host": false
        }
      ],
      "status": {
        "@id": "Pending",
        "@type": "Status"
      },
      "description": "A description",
      "applicationServiceGroup": {
        "@id": "asg/YoungPeople",
        "@type": 'ApplicationServiceGroup'
      },
      "application": {
        "@id": "20fc60c1-d232-48a4-96ed-85b03fddc0a4",
        "@type": "Application"
      }
    }
  ],
  "pagination":
  {
      "currentPage": 1,
      "perPage": 10,
      "total": 1
  }
}

          
Status code: 400
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity is invalid - [actual information]"
    
    }
		
          
Status code: 401
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The requested resource requires authorization"
    
    }
		
          
Status code: 403
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "You are not authorized to access the resource"
    
    }
		
          
Status code: 500
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "Server error - [actual information]"
    
    }
		
          

Emits

[#] [back to top]

GetImpromptuChat

Get an impromptu chat

Path /impromptu-chats/[impromptu-chat-id]
Method GET
Headers
Authorization: JWT
Accepts: application/json+ld
Content-Type: application/json+ld
Query Parameters

Responses

Status code: 200
Response Headers
Response Body
            
{
  "@id": "6de5bb4e-6f81-4f85-82cf-7bca85703fab",
  "@type": "ImpromptuChat",
  "dateTimeCreated": "2018-01-01T12:00:00.000Z",
  "serviceUser": {
    "@id": "6de5bb4e-6f81-4f85-82cf-7bca85703fac",
    "@type": "ServiceUser"
  },
  "assignedWorker": {
    "@id": "6de5bb4e-6f81-4f85-82cf-7bca85703fad",
    "@type": "Worker"
  },
  "applicationServiceGroup": {
    "@id": "asg/YoungPeople",
    "@type": 'ApplicationServiceGroup'
  },
  "application": {
    "@id": "20fc60c1-d232-48a4-96ed-85b03fddc0a4",
    "@type": "Application"
  }
}

          
Status code: 400
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity is invalid - [actual information]"
    
    }
		
          
Status code: 401
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The requested resource requires authorization"
    
    }
		
          
Status code: 403
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "You are not authorized to access the resource"
    
    }
		
          
Status code: 500
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "Server error - [actual information]"
    
    }
		
          

Emits

[#] [back to top]

GetImpromptuChats

Get all impromptu chats

Path /impromptu-chats or /service-users/me/impromptu-chats
Method GET
Headers
Authorization: JWT
Accepts: application/json+ld
Content-Type: application/json+ld
Query Parameters
applicationServiceGroupId: application service group id
applicationId: application id
assignedWorkerId: the ID of the assigned worker
serviceUserId: the ID of the service user
isAssigned: whether returned chats are assigned to a worker
perPage: number of results per page
page: page of results to fetch

Responses

Status code: 200
Response Headers
Response Body
            
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@type": "Collection",
  "results": [
    {
      "@id": "6de5bb4e-6f81-4f85-82cf-7bca85703fab",
      "@type": "ImpromptuChat",
      "dateTimeCreated": "2018-01-01T12:00:00.000Z",
      "serviceUser": {
        "@id": "6de5bb4e-6f81-4f85-82cf-7bca85703fac",
        "@type": "ServiceUser"
      },
      "assignedWorker": {
        "@id": "6de5bb4e-6f81-4f85-82cf-7bca85703fad",
        "@type": "Worker"
      },
      "applicationServiceGroup": {
        "@id": "asg/YoungPeople",
        "@type": 'ApplicationServiceGroup'
      },
      "application": {
        "@id": "20fc60c1-d232-48a4-96ed-85b03fddc0a4",
        "@type": "Application"
      }
    }
  ],
  "pagination":
  {
      "currentPage": 1,
      "perPage": 10,
      "total": 1
  }
}

          
Status code: 400
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity is invalid - [actual information]"
    
    }
		
          
Status code: 401
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The requested resource requires authorization"
    
    }
		
          
Status code: 403
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "You are not authorized to access the resource"
    
    }
		
          
Status code: 500
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "Server error - [actual information]"
    
    }
		
          

Emits

[#] [back to top]

GetMyAppointments

Get all appointments for the authorised user

Path /workers/me/appointments
Method GET
Headers
Authorization: JWT
Accepts: application/json+ld
Content-Type: application/json+ld
Query Parameters
applicationServiceGroupId: application service group id
applicationId: application id
startTime: the minimum appointment start time
endTime: the maximum appointment end time
status: the status to filter appointments by
perPage: number of results per page
page: page of results to fetch

Responses

Status code: 200
Response Headers
Response Body
            
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@type": "Collection",
  "results": [
    {
      "@id": "6de5bb4e-6f81-4f85-82cf-7bca85703fab",
      "@type": "Appointment",
      "startTime": "2018-01-01T12:00:00.000Z",
      "endTime": "2018-01-01T12:30:00.000Z",
      "participants": [
        {
          "@type": "Participant",
          "user": {
            "@id": "6de5bb4e-6f81-4f85-82cf-7bca85703fac",
            "@type": "Worker"
          },
          "host": true
        },
        {
          "@type": "Participant",
          "user": {
            "@id": "6de5bb4e-6f81-4f85-82cf-7bca85703fad",
            "@type": "ServiceUser"
          },
          "host": false
        }
      ],
      "status": {
        "@id": "Pending",
        "@type": "Status"
      },
      "description": "A description",
      "applicationServiceGroup": {
        "@id": "asg/YoungPeople",
        "@type": 'ApplicationServiceGroup'
      },
      "application": {
        "@id": "20fc60c1-d232-48a4-96ed-85b03fddc0a4",
        "@type": "Application"
      }
    }
  ],
  "pagination":
  {
      "currentPage": 1,
      "perPage": 10,
      "total": 1
  }
}

          
Status code: 400
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity is invalid - [actual information]"
    
    }
		
          
Status code: 401
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The requested resource requires authorization"
    
    }
		
          
Status code: 403
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "You are not authorized to access the resource"
    
    }
		
          
Status code: 500
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "Server error - [actual information]"
    
    }
		
          

Emits

[#] [back to top]

GetWorker

A command to get worker

Path /workers/[workerid]
Method GET
Headers
Authorization: JWT
Accepts: application/json+ld
Content-Type: application/json+ld
Query Parameters
Request Body
         
      

Responses

Status code: 200
Response Headers
Response Body
            {
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@id": "[worker-id]"
  "@type": "Worker",
  "emailAddress" : "john.smith@smithy.com",
  "profile": {
    "@id": "[personal-profile-id]",
    "@type": "WorkerPersonalProfile",
    "firstName": "first name",
    "lastName": "last name",
    "aboutMe": "about me",
    "therapiesOffered": "therapies offered by the worker",
    "preferredProfessionalBodies": "membership of professional bodies",
    "qualifications": "qualifications, training etc",
    "whenImAvailable": "when i am available",
    "gender": {
      "@id": "service-users/genders/Male",
      "@type": "Gender"
    }
  }
}
          
Status code: 400
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity is invalid - [actual information]"
    
    }
		
          
Status code: 401
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The requested resource requires authorization"
    
    }
		
          
Status code: 403
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "You are not authorized to access the resource"
    
    }
		
          
Status code: 500
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "Server error - [actual information]"
    
    }
		
          

Emits

[#] [back to top]

GetWorkers

A command to get workers

Path /workers
Method GET
Headers
Authorization: JWT
Accepts: application/json+ld
Content-Type: application/json+ld
Query Parameters
search: filter results matching the search term

Responses

Status code: 200
Response Headers
Response Body
            {
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@type": "Collection",
  "results": [
    {
      "@id": "[worker-id]",
      "@type": "Worker",
      "emailAddress": "john.smith@smithy.com",
      "profile": {
        "@id": "[personal-profile-id]",
        "@type": "WorkerPersonalProfile",
        "firstName": "first name",
        "lastName": "last name",
        "aboutMe": "about me",
        "therapiesOffered": "therapies offered by the worker",
        "preferredProfessionalBodies": "membership of professional bodies",
        "qualifications": "qualifications, training etc",
        "whenImAvailable": "when i am available",
        "gender": {
          "@id": "service-users/genders/Male",
          "@type": "Gender"
        }
      }
    }
  ],
  "pagination": {
    "currentPage": 5,
    "perPage": 20,
    "total": 521
  }
}
          
Status code: 400
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity is invalid - [actual information]"
    
    }
		
          
Status code: 401
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The requested resource requires authorization"
    
    }
		
          
Status code: 403
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "You are not authorized to access the resource"
    
    }
		
          
Status code: 500
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "Server error - [actual information]"
    
    }
		
          

Emits

[#] [back to top]

RemoveAppointmentParticipant

A command to remove a participant from an appointment

Path /appointments/[appointment-id]/participants/[participant-id]
Method DELETE
Headers
Authorization: JWT
Accepts: application/json+ld
Content-Type: application/json+ld
Query Parameters

Responses

Status code: 200
Response Headers
Response Body
            
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@graph" : [
    {"@type" : "RemoveAppointmentParticipantEvent"},
    {
      "@context": "https://vocabularies.xenzone.com/context.jsonld",
      "@type": "Participant",
      "user": { "@id": "6de5bb4e-6f81-4f85-82cf-7bca85703fac", "@type": "Worker" },
      "host": false
    }
  ]
}

          
Status code: 400
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity is invalid - [actual information]"
    
    }
		
          
Status code: 401
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The requested resource requires authorization"
    
    }
		
          
Status code: 403
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "You are not authorized to access the resource"
    
    }
		
          
Status code: 500
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "Server error - [actual information]"
    
    }
		
          

Emits

RemoveAppointmentParticipantEvent
Path: null
Method: null
Body

            
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@graph" : [
    {"@type" : "RemoveAppointmentParticipantEvent"},
    {
      "@context": "https://vocabularies.xenzone.com/context.jsonld",
      "@type": "Participant",
      "user": { "@id": "6de5bb4e-6f81-4f85-82cf-7bca85703fac", "@type": "Worker" },
      "host": false
    }
  ]
}

          

[#] [back to top]

RemoveWorkerFromImpromptuChat

A command to remove a worker from an impromptu chat

Path /impromptu-chats/[impromptu-chat-id]/workers/[worker-id]
Method DELETE
Headers
Authorization: JWT
Accepts: application/json+ld
Content-Type: application/json+ld
Query Parameters

Responses

Status code: 200
Response Headers
Response Body
            
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@graph" : [
    {"@type" : "RemoveWorkerFromImpromptuChatEvent"},
    {
      "@context": "https://vocabularies.xenzone.com/context.jsonld",
      "@id": "6de5bb4e-6f81-4f85-82cf-7bca85703fac",
      "@type": "Worker"
    }
  ]
}

          
Status code: 400
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity is invalid - [actual information]"
    
    }
		
          
Status code: 401
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The requested resource requires authorization"
    
    }
		
          
Status code: 403
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "You are not authorized to access the resource"
    
    }
		
          
Status code: 404
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity was not found - [actual information]"
    
    }
		
          
Status code: 409
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity conflicts with an pre-existing entity - [actual information]"
    
    }
		
          
Status code: 500
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "Server error - [actual information]"
    
    }
		
          

Emits

RemoveWorkerFromImpromptuChatEvent
Path: null
Method: null
Body

            
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@graph" : [
    {"@type" : "RemoveWorkerFromImpromptuChatEvent"},
    {
      "@context": "https://vocabularies.xenzone.com/context.jsonld",
      "@id": "6de5bb4e-6f81-4f85-82cf-7bca85703fac",
      "@type": "Worker"
    }
  ]
}

          

[#] [back to top]

UpdateAppointment

A command to update an appointment.

Path /appointments/[appointment-id]
Method PATCH
Headers
Authorization: JWT
Accepts: application/json+ld
Content-Type: application/json+ld
Query Parameters
Request Body
        
    {
      @context: "https://vocabularies.xenzone.com/context.jsonld",
      @type: "Appointment",
      startTime: "2018-01-01T12:00:00.000Z",
      endTime: "2018-01-01T12:30:00.000Z",
      status: { "@id": "Pending", "@type": "Status" },
      description: "A description"
    }
    
      
Constraints
http://vocabularies.xenzone.com/xcp-api/0.0.1/UpdateAppointment.schema.json
        
  {
    "title": "UpdateAppointment",
    "type": "object",
    "properties": {
      "@type": {
          "type": "string"
      },
      "startTime": {
          "type": "string",
          "format": "date-time"
      },
      "endTime": {
          "type": "string",
          "format": "date-time"
      },
      "status": {
        "type": "object",
        "properties": {
          "@type": {
            "type": "string"
          },
          "@id": {
            "type": "string",
            "enum": [
              "Pending",
              "Complete",
              "DNA",
              "Cancelled"
            ]
          }
        }
      },
      "description": {
        type: "string",
        minLength: 1,
      },
    },
    "required": ["@type"]
  }
  
      

Responses

Status code: 200
Response Headers
Response Body
            
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@graph": [
    {
      "@type": "UpdateAppointmentEvent"
    },
    {
      "@id": "6de5bb4e-6f81-4f85-82cf-7bca85703fab",
      "@type": "Appointment",
      "startTime": "2018-01-01T14:00:00.000Z",
      "endTime": "2018-01-01T15:00:00.000Z",
      "participants": [
        {
          "@type": "Participant",
          "user": {
            "@id": "6de5bb4e-6f81-4f85-82cf-7bca85703fac",
            "@type": "Worker"
          },
          "host": true
        },
        {
          "@type": "Participant",
          "user": {
            "@id": "6de5bb4e-6f81-4f85-82cf-7bca85703fad",
            "@type": "ServiceUser"
          },
          "host": false
        }
      ],
      "status": {
        "@id": "Complete",
        "@type": "Status"
      },
      "description": "A description",
      "applicationServiceGroup": {
        "@id": "asg/YoungPeople",
        "@type": 'ApplicationServiceGroup'
      },
      "application": {
        "@id": "20fc60c1-d232-48a4-96ed-85b03fddc0a4",
        "@type": "Application"
      }
    }
  ]
}

          
Status code: 400
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity is invalid - [actual information]"
    
    }
		
          
Status code: 401
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The requested resource requires authorization"
    
    }
		
          
Status code: 403
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "You are not authorized to access the resource"
    
    }
		
          
Status code: 409
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity conflicts with an pre-existing entity - [actual information]"
    
    }
		
          
Status code: 500
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "Server error - [actual information]"
    
    }
		
          

Emits

UpdateAppointmentEvent
Path: null
Method: null
Body

            
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@graph": [
    {
      "@type": "UpdateAppointmentEvent"
    },
    {
      "@id": "6de5bb4e-6f81-4f85-82cf-7bca85703fab",
      "@type": "Appointment",
      "startTime": "2018-01-01T14:00:00.000Z",
      "endTime": "2018-01-01T15:00:00.000Z",
      "participants": [
        {
          "@type": "Participant",
          "user": {
            "@id": "6de5bb4e-6f81-4f85-82cf-7bca85703fac",
            "@type": "Worker"
          },
          "host": true
        },
        {
          "@type": "Participant",
          "user": {
            "@id": "6de5bb4e-6f81-4f85-82cf-7bca85703fad",
            "@type": "ServiceUser"
          },
          "host": false
        }
      ],
      "status": {
        "@id": "Complete",
        "@type": "Status"
      },
      "description": "A description",
      "applicationServiceGroup": {
        "@id": "asg/YoungPeople",
        "@type": 'ApplicationServiceGroup'
      },
      "application": {
        "@id": "20fc60c1-d232-48a4-96ed-85b03fddc0a4",
        "@type": "Application"
      }
    }
  ]
}

          

[#] [back to top]

UpdateWorkerPersonalProfile

A command to update a workers personal profile

Path /workers/[worker-id]/personal-profile/ or /workers/me/personal-profile/
Method PUT
Headers
Authorization: JWT
Accepts: application/json+ld
Content-Type: application/json+ld
Query Parameters
Request Body
        {
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@type": "WorkerPersonalProfile",
  "firstName": "first name",
  "lastName": "last name",
  "aboutMe": "about me",
  "therapiesOffered": "therapies offered by the worker",
  "preferredProfessionalBodies": "membership of professional bodies",
  "qualifications": "qualifications, training etc",
  "whenImAvailable": "when I am available",
  "gender": {
    "@id": "service-users/genders/Male",
    "@type": "Gender"
  }
}
      
Constraints
http://vocabularies.xenzone.com/xcp-api/0.0.1/UpdateWorkerPersonalProfile.schema.json
        {
  "title": "CreateWorkerPersonalProfile",
  "type": "object",
  "properties": {
    "@type": {
       "type": "string",
    },
    "firstName": {
      "type": "string",
      "maxLength": 20,
    },
    "lastName": {
      "type": "string",
      "maxLength": 20,
    },
    "aboutMe": {
      "type": "string",
      "maxLength": 1000,
    },
    "therapiesOffered": {
      "type": "string",
      "maxLength": 750,
    },
    "preferredProfessionalBodies": {
      "type": "string",
      "maxLength": 300,
    },
    "qualifications": {
      "type": "string",
      "maxLength": 1000,
    },
    "whenImAvailable": {
      "type": "string",
      "maxLength": 300,
    },
    "gender": {
      "type": "object",
      "properties": {
        "@type": {
          "type": "string",
        },
        "@id": {
          "type": "string",
          "enum": [
            "service-users/genders/Male",
            "service-users/genders/Female",
            "service-users/genders/Agender",
            "service-users/genders/Gender fluid",
          ],
        },
      },
    },
  },
  "required": [
    "@type",
    "firstName",
    "lastName",
    "aboutMe",
    "preferredProfessionalBodies",
    "qualifications",
    "gender",
  ]
}
      

Responses

Status code: 201
Response Headers
Response Body
            {
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@graph": [
    {
      "@id": "[event-id]",
      "@type": "WorkerPersonalProfileUpdatedEvent",
      "atTime": "2018-01-10T16:56:15Z",
      "causedBy": "commands/[command-uuid]"
    },
    {
      "@id": "[personal-profile-id]",
      "@type": "WorkerPersonalProfile",
      "firstName": "first name",
      "lastName": "last name",
      "aboutMe": "about me",
      "therapiesOffered": "therapies offered by the worker",
      "preferredProfessionalBodies": "membership of professional bodies",
      "qualifications": "qualifications, training etc",
      "whenImAvailable": "when I am available",
      "gender": {
        "@id": "service-users/genders/Male",
        "@type": "Gender"
      }
    }
  ]
}
          
Status code: 400
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity is invalid - [actual information]"
    
    }
		
          
Status code: 401
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The requested resource requires authorization"
    
    }
		
          
Status code: 403
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "You are not authorized to access the resource"
    
    }
		
          
Status code: 500
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "Server error - [actual information]"
    
    }
		
          

Emits

WorkerPersonalProfileUpdatedEvent
Path: /subscribers/[service-name]/WorkerPersonalProfileUpdatedEvent
Method: null
Body

            {
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@graph": [
    {
      "@id": "[event-id]",
      "@type": "WorkerPersonalProfileUpdatedEvent",
      "atTime": "2018-01-10T16:56:15Z",
      "causedBy": "commands/[command-uuid]"
    },
    {
      "@id": "[personal-profile-id]",
      "@type": "WorkerPersonalProfile",
      "firstName": "first name",
      "lastName": "last name",
      "aboutMe": "about me",
      "therapiesOffered": "therapies offered by the worker",
      "preferredProfessionalBodies": "membership of professional bodies",
      "qualifications": "qualifications, training etc",
      "whenImAvailable": "when I am available",
      "gender": {
        "@id": "service-users/genders/Male",
        "@type": "Gender"
      }
    }
  ]
}
          

[#] [back to top]

Content Service

CreateCategory

Creates a new category

Path /content/categories
Method POST
Headers
Authorization: JWT
Accepts: application/json+ld
Content-Type: application/json+ld
Query Parameters
Request Body
        
{
  "@type": "Category",
  "application": {
    "@id": "20fc60c1-d232-48a4-96ed-85b03fddc0a4",
    "@type": "Application"
  },
  "name": "Category A"
}

      
Constraints
http://vocabularies.xenzone.com/xcp-api/0.0.1/CreateCategory.schema.json
        
{
  "type": "object",
  "properties": {
    "@type": { "type": "string", "enum": ["Category"], default: "Category" },
    "application": {
      "type": "object",
      "properties: {
        "@id": { "type": "string", "minLength": 1 },
        "@type" { "type": "string", "enum": ["Application"], "default": "Application" }
      },
      "required": ["@id"]
    }
    "name": { "type": "string", "minLength": 1 }
  },
  "required": ["application", "name"]
}

      

Responses

Status code: 201
Response Headers
Response Body
            
{
  "@context": 'https://vocabularies.xenzone.com/context.jsonld',
  "@graph": [{
    "@id": "[event-id]",
    "@type": "ContentCategoryCreatedEvent",
    "atTime": "2018-01-10T16:56:15Z",
    "causedBy": "commands/[command-id]"
  }, {
    "@id": "330b65b8-0b71-44e4-a65f-4e6e984907b6",
    "@type": "Category",
    "application": {
      "@id": "20fc60c1-d232-48a4-96ed-85b03fddc0a4",
      "@type": "Application"
    },
    "name": "Category A",
    "contentCount": 0,
    "userCount": 0,
    "usefulCount": 0,
    "followCount": 0
  }]
}

          
Status code: 400
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity is invalid - [actual information]"
    
    }
		
          
Status code: 401
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The requested resource requires authorization"
    
    }
		
          
Status code: 403
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "You are not authorized to access the resource"
    
    }
		
          
Status code: 500
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "Server error - [actual information]"
    
    }
		
          

Emits

[#] [back to top]

CreateContentResource

Creates a new content resource

Path /content/resources
Method POST
Headers
Authorization: JWT
Accepts: application/json+ld
Content-Type: application/json+ld
Query Parameters
applicationServiceGroupId: application service group id
Request Body
        
{
  "@type": "Comment"
  "application": {
    "@id": "20fc60c1-d232-48a4-96ed-85b03fddc0a4",
    "@type": "Application"
  },
  "topic": {
    "@id": "f5dcceae-8bbd-4b87-ae59-d9ac9697ed5c",
    "@type": "Topic"
  },
  "category": {
    "@id": "bb965149-bae9-4535-9dbe-c751229643d5",
    "@type": "Category"
  },
  "replyTo": {
    "@id": "bb965149-bae9-4535-9dbe-c751229643d5",
    "@type": "Comment"
  },
  "title": "The title of the comment",
  "content": "The content of the comment",
  "publishStatus": { "@id": "Unpublished", "@type": "PublishStatus" },
  "minAge": 0,
  "maxAge": 999,
  "thumbnail": {
    "@id": "[file-path]",
    "@type": "Thumbnail"
  },
}

      
Constraints
http://vocabularies.xenzone.com/xcp-api/0.0.1/CreateContentResource.schema.json
        
{
  "type": "object",
  "properties": {
    "@type": {
      "type": "string",
      "enum": [
        "Article",
        "Discussion",
        "LiveDiscussion",
        "QAndADiscussion",
        "Comment"
      ]
    },
    "application": {
      "type": "object",
      "properties": {
        "@id": {
          "type": "string",
          "minLength": 1
        },
        "@type": {
          "type": "string",
          "enum": [
            "Application"
          ],
          "default": "Application"
        }
      },
      "required": [
        "@id"
      ]
    },
    "category": {
      "type": "object",
      "properties": {
        "@id": {
          "type": "string",
          "minLength": 1
        },
        "@type": {
          "type": "string",
          "enum": [
            "Category"
          ],
          "default": "Category"
        }
      },
      "required": [
        "@id"
      ]
    },
    "topic": {
      "type": "object",
      "properties": {
        "@id": {
          "type": "string",
          "minLength": 1
        },
        "@type": {
          "type": "string",
          "enum": [
            "Topic"
          ],
          "default": "Topic"
        }
      },
      "required": [
        "@id"
      ]
    },
    "author": {
      "type": "object",
      "properties": {
        "@id": {
          "type": "string",
          "minLength": 1
        },
        "@type": {
          "type": "string",
          "enum": [
            "ServiceUser",
            "Worker"
          ]
        }
      },
      "required": [
        "@id",
        "@type"
      ]
    },
    "title": {
      "type": "string",
      "minLength": 1
    },
    "content": {
      "type": "string",
      "minLength": 1
    },
    "publishStatus": {
      "type": "object",
      "properties": {
        "@id": {
          "type": "string",
          "enum": [
            "Unpublished",
            "Published"
          ],
          "default": "Unpublished"
        },
        "@type": {
          "type": "string",
          "enum": [
            "PublishStatus"
          ],
          "default": "PublishStatus"
        }
      },
      "required": [
        "@id"
      ]
    },
    "minAge": {
      "type": "integer",
      "minimum": 0,
      "maximum": 999
    },
    "maxAge": {
      "type": "integer",
      "minimum": 0,
      "maximum": 999
    },
    "startTime": {
      "type": "string"
    },
    "endTime": {
      "type": "string"
    },
    "replyTo": {
      "type": "object",
      "properties": {
        "@id": {
          "type": "string",
          "minLength": 1
        },
        "@type": {
          "type": "string",
          "enum": [
            "Article",
            "Discussion",
            "LiveDiscussion",
            "QAndADiscussion",
            "Comment"
          ]
        }
      },
      "required": [
        "@id",
        "@type"
      ]
    }
  },
  "thumbnail": {
    "type": "object",
    "properties": {
      "@id": {
        "type": "string",
        "minLength": 1
      },
      "@type": {
        "type": "string",
        "enum": [
          "Thumbnail"
        ],
        "default": "Thumbnail"
      }
    },
    "required": [
      "@id"
    ]
  },
  "required": [
    "@type",
    "application",
    "author",
    "content"
  ]
}

      

Responses

Status code: 201
Response Headers
Response Body
            
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@graph": [
    {
      "@id": "13328e94-afd8-4135-b467-409256f2778f",
      "@type": "ContentResourceCreatedEvent",
      "causedBy": "commands/75a892ba-1ed3-4bb3-afe2-1df5f1141b35",
      "atTime": "2018-01-01T00:00:00.000Z"
    }, {
      "@id": "330b65b8-0b71-44e4-a65f-4e6e984907b6",
      "@type": "Comment",
      "application": {
        "@id": "20fc60c1-d232-48a4-96ed-85b03fddc0a4",
        "@type": "Application"
      },
      "topic": {
        "@id": "f5dcceae-8bbd-4b87-ae59-d9ac9697ed5c",
        "@type": "Topic"
      },
      "category": {
        "@id": "bb965149-bae9-4535-9dbe-c751229643d5",
        "@type": "Category"
      },
      "replyTo": {
        "@id": "f5dcceae-8bbd-4b87-ae59-d9ac9697ed5c",
        "@type": "Comment"
      },
      "author": {
        "@id": "e453f1a8-623a-4ea0-be09-544d4671aacc",
        "@type": "ServiceUser"
      },
      "thumbnail": {
        "@id": "[file-path]",
        "@type": "Thumbnail"
      },
      "title": "Title of the comment",
      "content": "The content of the comment",
      "publishStatus": { "@id": "Unpublished", "@type": "PublishStatus" },
      "moderationStatus": { "@id": "PendingModeration", "@type": "ModerationStatus" },
      "minAge": 0,
      "maxAge": 999,
      "dateTimeCreated": "2018-01-01T00:00:00.000Z",
      "contentCount": 0,
      "userCount": 0,
      "usefulCount": 0,
      "followCount": 0
    }
  ]
}

          
Status code: 400
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity is invalid - [actual information]"
    
    }
		
          
Status code: 401
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The requested resource requires authorization"
    
    }
		
          
Status code: 403
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "You are not authorized to access the resource"
    
    }
		
          
Status code: 500
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "Server error - [actual information]"
    
    }
		
          

Emits

ContentResourceCreatedEvent
Path: null
Method: null
Body

            
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@graph": [
    {
      "@id": "13328e94-afd8-4135-b467-409256f2778f",
      "@type": "ContentResourceCreatedEvent",
      "causedBy": "commands/75a892ba-1ed3-4bb3-afe2-1df5f1141b35",
      "atTime": "2018-01-01T00:00:00.000Z"
    }, {
      "@id": "330b65b8-0b71-44e4-a65f-4e6e984907b6",
      "@type": "Comment",
      "application": {
        "@id": "20fc60c1-d232-48a4-96ed-85b03fddc0a4",
        "@type": "Application"
      },
      "topic": {
        "@id": "f5dcceae-8bbd-4b87-ae59-d9ac9697ed5c",
        "@type": "Topic"
      },
      "category": {
        "@id": "bb965149-bae9-4535-9dbe-c751229643d5",
        "@type": "Category"
      },
      "replyTo": {
        "@id": "f5dcceae-8bbd-4b87-ae59-d9ac9697ed5c",
        "@type": "Comment"
      },
      "author": {
        "@id": "e453f1a8-623a-4ea0-be09-544d4671aacc",
        "@type": "ServiceUser"
      },
      "thumbnail": {
        "@id": "[file-path]",
        "@type": "Thumbnail"
      },
      "title": "Title of the comment",
      "content": "The content of the comment",
      "publishStatus": { "@id": "Unpublished", "@type": "PublishStatus" },
      "moderationStatus": { "@id": "PendingModeration", "@type": "ModerationStatus" },
      "minAge": 0,
      "maxAge": 999,
      "dateTimeCreated": "2018-01-01T00:00:00.000Z",
      "contentCount": 0,
      "userCount": 0,
      "usefulCount": 0,
      "followCount": 0
    }
  ]
}

          

[#] [back to top]

CreateFollow

Creates a follow to content

Path /content/follows
Method POST
Headers
Authorization: JWT
Accepts: application/json+ld
Content-Type: application/json+ld
Query Parameters
Request Body
        
{
  "@type": "Follow",
  "resource": {
    "@id": "20fc60c1-d232-48a4-96ed-85b03fddc0a4",
    "@type": "Topic"
  }
  "follower": {
    "@id": "20fc60c1-d232-48a4-96ed-85b03fddc0a4"
    "@tye": "Worker",
  }
}

      
Constraints
http://vocabularies.xenzone.com/xcp-api/0.0.1/CreateFollow.schema.json
        
{
  "type": "object",
  "properties": {
    "@type": { "type": "enum", ["Follow"], "default": "Follow" },
    "resource": {
      "type": "object",
      "properties": {
        "@id": { "type": "string", "minLength": 1 },
        "@type": {
          "type": "string",
          "enum": [
            "Category",
            "Topic",
            "Article",
            "Discussion",
            "LiveDiscussion",
            "Comment"
          ]
        }
      },
      "required": ["@id", "@type"]
    },
    "follower": {
      "type": "object",
      "properties": {
        "@id": { "type": "string", "minLength": 1 },
        "@type": { "type": "string", "enum": ["ServiceUser", "Worker"]
      },
      "required": ["@id", "@type"],
    }
  },
  "required": ["@type", "@resourceType", "follower"]
}

      

Responses

Status code: 200
Response Headers
Response Body
            
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@graph": [
    {
      "@id": "13328e94-afd8-4135-b467-409256f2778f",
      "@type": "FollowCreatedEvent",
      "causedBy": "commands/75a892ba-1ed3-4bb3-afe2-1df5f1141b35",
      "atTime": "2018-01-01T00:00:00.000Z"
    }, {
      "@type": "Follow",
      "resource": {
        "@id": "20fc60c1-d232-48a4-96ed-85b03fddc0a4",
        "@type": "Topic"
      }
      "follower": {
        "@id": "20fc60c1-d232-48a4-96ed-85b03fddc0a4",
        "@type": "Worker"
      }
    }
  ]
}

          
Status code: 400
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity is invalid - [actual information]"
    
    }
		
          
Status code: 401
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The requested resource requires authorization"
    
    }
		
          
Status code: 403
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "You are not authorized to access the resource"
    
    }
		
          
Status code: 500
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "Server error - [actual information]"
    
    }
		
          

Emits

CreateFollowResponse
Path: null
Method: null
Body

            
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@graph": [
    {
      "@id": "13328e94-afd8-4135-b467-409256f2778f",
      "@type": "FollowCreatedEvent",
      "causedBy": "commands/75a892ba-1ed3-4bb3-afe2-1df5f1141b35",
      "atTime": "2018-01-01T00:00:00.000Z"
    }, {
      "@type": "Follow",
      "resource": {
        "@id": "20fc60c1-d232-48a4-96ed-85b03fddc0a4",
        "@type": "Topic"
      }
      "follower": {
        "@id": "20fc60c1-d232-48a4-96ed-85b03fddc0a4",
        "@type": "Worker"
      }
    }
  ]
}

          

[#] [back to top]

CreateTopic

Creates a new topic

Path /content/topics
Method POST
Headers
Authorization: JWT
Accepts: application/json+ld
Content-Type: application/json+ld
Query Parameters
Request Body
        
{
  "@type": "Topic",
  "application": {
    "@id": "20fc60c1-d232-48a4-96ed-85b03fddc0a4",
    "@type": "Application"
  },
  "category": {
    "@id": "bb965149-bae9-4535-9dbe-c751229643d5",
    "@type": "Category"
  },
  "name": "Topic Name"
}

      
Constraints
http://vocabularies.xenzone.com/xcp-api/0.0.1/CreateTopic.schema.json
        
{
  "type": "object",
  "properties": {
    "@type": { "type": "string", "enum": ["Topic"], "default": "Topic" },
    "application": {
      "type": "object",
      "properties": {
        "@id": { "type": "string", "minLength": 1 },
        "@type": { "type": "string", "enum": ["Application"], "default": "Application" }
      }
      "required": ["@id"]
    },
    "category": {
      "type": "object",
      "properties": {
        "@id": { "type": "string", "minLength": 1 },
        "@type": { "type": "string", "enum": ["Category"], "default": "Category" }
      },
      "required": ["@id"]
    },
    "name": { "type": "string", "minLength": 1 }
  },
  "required": ["application", "category", "name"]
}

      

Responses

Status code: 201
Response Headers
Response Body
            
{
  "@context": 'https://vocabularies.xenzone.com/context.jsonld',
  "@graph": [{
    "@id": "[event-id]",
    "@type": "ContentTopicCreatedEvent",
    "atTime": "2018-01-10T16:56:15Z",
    "causedBy": "commands/[command-id]"
  }, {
    "@id": "f9edff9c-9d54-4e5e-94e3-891d94e64af2",
    "@type": "Topic"
    "application": {
      "@id": "20fc60c1-d232-48a4-96ed-85b03fddc0a4",
      "@type": "Application"
    },
    "category": {
      "@id": "e401fd9b-ef4a-49a0-a27b-aeecdf6c4df3",
      "@type": "Category"
    },
    "name": "Topic Name",
    "contentCount": 0,
    "userCount": 0,
    "usefulCount": 0,
    "followCount": 0
  }]
}

          
Status code: 400
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity is invalid - [actual information]"
    
    }
		
          
Status code: 401
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The requested resource requires authorization"
    
    }
		
          
Status code: 403
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "You are not authorized to access the resource"
    
    }
		
          
Status code: 500
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "Server error - [actual information]"
    
    }
		
          

Emits

ContentTopicCreatedEvent
Path: null
Method: null
Body

            
{
  "@context": 'https://vocabularies.xenzone.com/context.jsonld',
  "@graph": [{
    "@id": "[event-id]",
    "@type": "ContentTopicCreatedEvent",
    "atTime": "2018-01-10T16:56:15Z",
    "causedBy": "commands/[command-id]"
  }, {
    "@id": "f9edff9c-9d54-4e5e-94e3-891d94e64af2",
    "@type": "Topic"
    "application": {
      "@id": "20fc60c1-d232-48a4-96ed-85b03fddc0a4",
      "@type": "Application"
    },
    "category": {
      "@id": "e401fd9b-ef4a-49a0-a27b-aeecdf6c4df3",
      "@type": "Category"
    },
    "name": "Topic Name",
    "contentCount": 0,
    "userCount": 0,
    "usefulCount": 0,
    "followCount": 0
  }]
}

          

[#] [back to top]

CreateUseful

Creates a useful mark

Path /content/usefuls
Method POST
Headers
Authorization: JWT
Accepts: application/json+ld
Content-Type: application/json+ld
Query Parameters
Request Body
        
{
  "@type": "Useful",
  "resource": {
    "@id": "20fc60c1-d232-48a4-96ed-85b03fddc0a4",
    "@type": "Topic"
  },
  "user": {
    "@id": "20fc60c1-d232-48a4-96ed-85b03fddc0a4",
    "@type": "Worker"
  }
}

      
Constraints
http://vocabularies.xenzone.com/xcp-api/0.0.1/CreateUseful.schema.json
        
{
  "type": "object",
  "properties": {
    "@type": { "type": "enum", ["Useful"], "default": "Useful" },
    "resource": {
      "type": "object",
      "properties": {
        "@id": { "type": "string", "minLength": 1 },
        "@type": {
          "type": "string",
          "enum": [
            "Category",
            "Topic",
            "Article",
            "Discussion",
            "LiveDiscussion",
            "QAndADiscussion",
            "Comment"
          ]
        }
      },
      "required": ["@id", "@type"]
    },
    "user": {
      "type": "object",
      "properties": {
        "@id": { "type": "string", "minLength": 1 },
        "@type": { "type": "string", "enum": ["Worker", "ServiceUser"] }
      },
      "required": ["@id", "@type"]
    }
  },
  "required": ["@type", "@resourceType", "user"]
}

      

Responses

Status code: 200
Response Headers
Response Body
            
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@graph": [
    {
      "@id": "13328e94-afd8-4135-b467-409256f2778f",
      "@type": "CreatedUsefulEvent",
      "causedBy": "commands/75a892ba-1ed3-4bb3-afe2-1df5f1141b35",
      "atTime": "2018-01-01T00:00:00.000Z"
    }, {
      "@type": "Useful",
      "resource": {
        "@id": "330b65b8-0b71-44e4-a65f-4e6e984907b6",
        "@type": "Comment"
      },
      "user": {
        "@id": "20fc60c1-d232-48a4-96ed-85b03fddc0a4",
        "@type": "Worker"
      }
    }
  ]
}

          
Status code: 400
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity is invalid - [actual information]"
    
    }
		
          
Status code: 401
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The requested resource requires authorization"
    
    }
		
          
Status code: 403
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "You are not authorized to access the resource"
    
    }
		
          
Status code: 500
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "Server error - [actual information]"
    
    }
		
          

Emits

CreateUsefulEvent
Path: null
Method: null
Body

            
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@graph": [
    {
      "@id": "13328e94-afd8-4135-b467-409256f2778f",
      "@type": "CreatedUsefulEvent",
      "causedBy": "commands/75a892ba-1ed3-4bb3-afe2-1df5f1141b35",
      "atTime": "2018-01-01T00:00:00.000Z"
    }, {
      "@type": "Useful",
      "resource": {
        "@id": "330b65b8-0b71-44e4-a65f-4e6e984907b6",
        "@type": "Comment"
      },
      "user": {
        "@id": "20fc60c1-d232-48a4-96ed-85b03fddc0a4",
        "@type": "Worker"
      }
    }
  ]
}

          

[#] [back to top]

DeleteContentResource

Deletes a content resource

Path /content/resources/:id
Method DELETE
Headers
Authorization: JWT
Accepts: application/json+ld
Content-Type: application/json+ld
Query Parameters
applicationServiceGroupId: application service group id

Responses

Status code: 200
Response Headers
Response Body
            
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@graph": [
    {
      "@id": "13328e94-afd8-4135-b467-409256f2778f",
      "@type": "ContentResourceDeletedEvent",
      "causedBy": "commands/75a892ba-1ed3-4bb3-afe2-1df5f1141b35",
      "atTime": "2018-01-01T00:00:00.000Z"
    }, {
      "@id": "330b65b8-0b71-44e4-a65f-4e6e984907b6",
      "@type": "Article",
      "application": {
        "@id": "20fc60c1-d232-48a4-96ed-85b03fddc0a4",
        "@type": "Application"
      },
      "category": {
        "@id": "bb965149-bae9-4535-9dbe-c751229643d5",
        "@type": "Category"
      },
      "topic": {
        "@id": "f5dcceae-8bbd-4b87-ae59-d9ac9697ed5c",
        "@type": "Topic"
      },
      "author": {
        "@id": "e453f1a8-623a-4ea0-be09-544d4671aacc",
        "@type": "Worker"
      },
      "title": "Title of the article",
      "content": "The content of the article",
      "publishStatus": { "@id": "Published", "@type": "PublishStatus" },
      "moderationStatus": { "@id": "PassedModeration", "@type": "ModerationStatus" },
      "minAge": 0,
      "maxAge": 999,
      "dateTimeCreated": "2018-01-01T00:00:00.000Z",
      "contentCount": 0,
      "userCount": 0,
      "usefulCount": 0,
      "followCount": 0
    }
  ]
}

          
Status code: 400
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity is invalid - [actual information]"
    
    }
		
          
Status code: 401
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The requested resource requires authorization"
    
    }
		
          
Status code: 403
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "You are not authorized to access the resource"
    
    }
		
          
Status code: 500
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "Server error - [actual information]"
    
    }
		
          

Emits

DeleteContentResourceEvent
Path: null
Method: null
Body

            
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@graph": [
    {
      "@id": "13328e94-afd8-4135-b467-409256f2778f",
      "@type": "ContentResourceDeletedEvent",
      "causedBy": "commands/75a892ba-1ed3-4bb3-afe2-1df5f1141b35",
      "atTime": "2018-01-01T00:00:00.000Z"
    }, {
      "@id": "330b65b8-0b71-44e4-a65f-4e6e984907b6",
      "@type": "Article",
      "application": {
        "@id": "20fc60c1-d232-48a4-96ed-85b03fddc0a4",
        "@type": "Application"
      },
      "category": {
        "@id": "bb965149-bae9-4535-9dbe-c751229643d5",
        "@type": "Category"
      },
      "topic": {
        "@id": "f5dcceae-8bbd-4b87-ae59-d9ac9697ed5c",
        "@type": "Topic"
      },
      "author": {
        "@id": "e453f1a8-623a-4ea0-be09-544d4671aacc",
        "@type": "Worker"
      },
      "title": "Title of the article",
      "content": "The content of the article",
      "publishStatus": { "@id": "Published", "@type": "PublishStatus" },
      "moderationStatus": { "@id": "PassedModeration", "@type": "ModerationStatus" },
      "minAge": 0,
      "maxAge": 999,
      "dateTimeCreated": "2018-01-01T00:00:00.000Z",
      "contentCount": 0,
      "userCount": 0,
      "usefulCount": 0,
      "followCount": 0
    }
  ]
}

          

[#] [back to top]

DeleteFollow

Delete a follow to content

Path /content/follows
Method DELETE
Headers
Authorization: JWT
Accepts: application/json+ld
Content-Type: application/json+ld
Query Parameters
Request Body
        
{
  "@type": "Follow",
  "resource": {
    "@id": "20fc60c1-d232-48a4-96ed-85b03fddc0a4",
    "@type": "Topic"
  },
  "follower": {
    "@id": "20fc60c1-d232-48a4-96ed-85b03fddc0a4",
    "@type": "Worker"
  }
}

      
Constraints
http://vocabularies.xenzone.com/xcp-api/0.0.1/DeleteFollow.schema.json
        
{
  "type": "object",
  "properties": {
    "@type": { "type": "enum", ["Follow"], "default": "Follow" },
    "resource": {
      "type": "object",
      "properties": {
        "@id": { "type": "string", "minLength": 1 },
        "@type": {
          "type": "string",
          "enum": [
            "Category",
            "Topic",
            "Article",
            "Discussion",
            "LiveDiscussion",
            "Comment"
          ]
        }
      },
      "required": ["@id", "@type"]
    },
    "follower": {
      "type": "object",
      "properties": {
        "@id": { "type": "string", "minLength": 1 },
        "@type": {
          "type": "string",
          "enum": ["Worker", "ServiceUser"]
        }
      },
      "required": ["@id", "@type"]
    }
  },
  "required": ["@type", "@resourceType", "follower"]
}

      

Responses

Status code: 200
Response Headers
Response Body
            
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@graph": [
    {
      "@id": "13328e94-afd8-4135-b467-409256f2778f",
      "@type": "FollowDeletedEvent",
      "causedBy": "commands/75a892ba-1ed3-4bb3-afe2-1df5f1141b35",
      "atTime": "2018-01-01T00:00:00.000Z"
    }, {
      "@type": "Follow",
      "resource": {
        "@id": "20fc60c1-d232-48a4-96ed-85b03fddc0a4",
        "@type": "Topic"
      },
      "follower": {
        "@id": "20fc60c1-d232-48a4-96ed-85b03fddc0a4",
        "@type": "Worker"
      }
    }
  ]
}

          
Status code: 400
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity is invalid - [actual information]"
    
    }
		
          
Status code: 401
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The requested resource requires authorization"
    
    }
		
          
Status code: 403
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "You are not authorized to access the resource"
    
    }
		
          
Status code: 500
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "Server error - [actual information]"
    
    }
		
          

Emits

DeleteFollowResponse
Path: null
Method: null
Body

            
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@graph": [
    {
      "@id": "13328e94-afd8-4135-b467-409256f2778f",
      "@type": "FollowDeletedEvent",
      "causedBy": "commands/75a892ba-1ed3-4bb3-afe2-1df5f1141b35",
      "atTime": "2018-01-01T00:00:00.000Z"
    }, {
      "@type": "Follow",
      "resource": {
        "@id": "20fc60c1-d232-48a4-96ed-85b03fddc0a4",
        "@type": "Topic"
      },
      "follower": {
        "@id": "20fc60c1-d232-48a4-96ed-85b03fddc0a4",
        "@type": "Worker"
      }
    }
  ]
}

          

[#] [back to top]

DeleteUseful

Deletes a useful mark

Path /content/usefuls
Method DELETE
Headers
Authorization: JWT
Accepts: application/json+ld
Content-Type: application/json+ld
Query Parameters
Request Body
        
{
  "@type": "Useful",
  "resource": {
    "@id": "20fc60c1-d232-48a4-96ed-85b03fddc0a4",
    "@type": "Topic"
  },
  "follower": {
    "@id": "20fc60c1-d232-48a4-96ed-85b03fddc0a4",
    "@type": "Worker"
  }
}

      
Constraints
http://vocabularies.xenzone.com/xcp-api/0.0.1/DeleteUseful.schema.json
        
{
  "type": "object",
  "properties": {
    "@type": { "type": "enum", ["Useful"], "default": "Useful" },
    "resource": {
      "type": "object",
      "properties": {
        "@id": { "type": "string", "minLength": 1 },
        "@type": {
          "type": "string",
          "enum": [
            "Category",
            "Topic",
            "Article",
            "Discussion",
            "LiveDiscussion",
            "Comment"
          ]
        }
      },
      "required": ["@id", "@type"]
    },
    "user": {
      "type": "object",
      "properties": {
        "@id": { "type": "string", "minLength": 1 },
        "@type": { "type": "string", "enum": ["Worker", "ServiceUser" }
      },
      "required": ["@id", "@type"]
    }
  },
  "required": ["@type", "@resourceType", "user"]
}

      

Responses

Status code: 200
Response Headers
Response Body
            
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@graph": [
    {
      "@id": "13328e94-afd8-4135-b467-409256f2778f",
      "@type": "CommentUnmarkedAsUsefulEvent",
      "causedBy": "commands/75a892ba-1ed3-4bb3-afe2-1df5f1141b35",
      "atTime": "2018-01-01T00:00:00.000Z"
    }, {
      "@type": "Useful",
      "resource": {
        "@id": "330b65b8-0b71-44e4-a65f-4e6e984907b6",
        "@type": "Topic"
      },
      "user": {
        "@id": "20fc60c1-d232-48a4-96ed-85b03fddc0a4",
        "@type": "Worker"
      }
    }
  ]
}

          
Status code: 400
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity is invalid - [actual information]"
    
    }
		
          
Status code: 401
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The requested resource requires authorization"
    
    }
		
          
Status code: 403
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "You are not authorized to access the resource"
    
    }
		
          
Status code: 500
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "Server error - [actual information]"
    
    }
		
          

Emits

DeletedUsefulEvent
Path: null
Method: null
Body

            
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@graph": [
    {
      "@id": "13328e94-afd8-4135-b467-409256f2778f",
      "@type": "CommentUnmarkedAsUsefulEvent",
      "causedBy": "commands/75a892ba-1ed3-4bb3-afe2-1df5f1141b35",
      "atTime": "2018-01-01T00:00:00.000Z"
    }, {
      "@type": "Useful",
      "resource": {
        "@id": "330b65b8-0b71-44e4-a65f-4e6e984907b6",
        "@type": "Topic"
      },
      "user": {
        "@id": "20fc60c1-d232-48a4-96ed-85b03fddc0a4",
        "@type": "Worker"
      }
    }
  ]
}

          

[#] [back to top]

GetCategories

Returns all the categories

Path /content/categories
Method GET
Headers
Authorization: JWT
Accepts: application/json+ld
Content-Type: application/json+ld
Query Parameters
applicationServiceGroupId: application service group id filter
applicationId: application id filter
order: The ordering of the response
resourceType: Resource type filter
moderationStatus: Resource moderation status filter
perPage: number of results per page
page: page of results to fetch
Constraints
http://vocabularies.xenzone.com/xcp-api/0.0.1/GetCategories.schema.json
        
{
  "type": "object",
  "properties": {
    "applicationServiceGroupId": { "type": "string", "minLength": 1 },
    "applicationId": { "type": "string", "minLength": 1 },
    "order": {
      "type": "string",
      "enum": [
        "AlphabeticalAsc",
        "AlphabeticalDesc",
        "MostUseful",
        "LeastUseful",
        "MostFollowed",
        "LeastFollowed"
      ],
      "default": "AlphabeticalAsc"
    },
    "resourceType": {
      "type": "string",
      "enum": ["Article", "Discussion", "LiveDiscussion", "QAndADiscussion", "Comment"]
    },
    "moderationStatus": {
      "type": "string",
      "enum": ["PendingModeration", "PassedModeration", "FailedModeration"]
    },
    "page": { "type": "integer", "minimum": 1, "default": 1 },
    "perPage": { "type": "integer", "minimum": 1, "maximum": 50, "default": 10 }
  },
}

      

Responses

Status code: 200
Response Headers
Response Body
            
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@type": "Collection",
  "results": [
    {
      "@id": "330b65b8-0b71-44e4-a65f-4e6e984907b6",
      "@type": "Category",
      "application": {
        "@id": "20fc60c1-d232-48a4-96ed-85b03fddc0a4",
        "@type": "Application"
      },
      "name": "Category A",
      "contentCount": 5,
      "userCount": 0,
      "usefulCount": 0,
      "followCount": 1,
    }
    // etc...
  ],
  "pagination": {
    "total": 1,
    "currentPage": 10,
    "perPage": 2
  }
}

          
Status code: 400
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity is invalid - [actual information]"
    
    }
		
          
Status code: 401
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The requested resource requires authorization"
    
    }
		
          
Status code: 403
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "You are not authorized to access the resource"
    
    }
		
          
Status code: 500
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "Server error - [actual information]"
    
    }
		
          

Emits

[#] [back to top]

GetCategory

Returns the category for a given ID

Path /content/categories/:id
Method GET
Headers
Authorization: JWT
Accepts: application/json+ld
Content-Type: application/json+ld
Query Parameters
resourceType: Resource type filter
moderationStatus: Resource moderation status filter
Constraints
http://vocabularies.xenzone.com/xcp-api/0.0.1/GetCategory.schema.json
        
{
  "type": "object",
  "properties": {
    "resourceType": {
      "type": "string",
      "enum": ["Article", "Discussion", "LiveDiscussion", "QAndADiscussion", "Comment"]
    },
    "moderationStatus": {
      "type": "string",
      "enum": ["PendingModeration", "PassedModeration", "FailedModeration"]
    }
  },
}

      

Responses

Status code: 200
Response Headers
Response Body
            
{
  "@id": "330b65b8-0b71-44e4-a65f-4e6e984907b6",
  "@type": "Category",
  "application": {
    "@id": "20fc60c1-d232-48a4-96ed-85b03fddc0a4",
    "@type": "Application"
  },
  "name": "Category A",
  "contentCount": 5,
  "userCount": 0,
  "usefulCount": 0,
  "followCount": 1
}

          
Status code: 400
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity is invalid - [actual information]"
    
    }
		
          
Status code: 401
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The requested resource requires authorization"
    
    }
		
          
Status code: 403
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "You are not authorized to access the resource"
    
    }
		
          
Status code: 404
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity was not found - [actual information]"
    
    }
		
          
Status code: 500
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "Server error - [actual information]"
    
    }
		
          

Emits

[#] [back to top]

GetContentResource

Returns the content resource for a given ID

Path /content/resources/:id
Method GET
Headers
Authorization: JWT
Accepts: application/json+ld
Content-Type: application/json+ld
Query Parameters
resourceType: Resource type filter
moderationStatus: Resource moderation status filter
Constraints
http://vocabularies.xenzone.com/xcp-api/0.0.1/GetContentResource.schema.json
        
{
  "type": "object",
  "properties": {
    "resourceType": {
      "type": "string",
      "enum": ["Article", "Discussion", "LiveDiscussion", "QAndADiscussion", "Comment", "ArticleComment", "DiscussionComment", "LiveDiscussionComment"]
    },
    "moderationStatus": {
      "type": "string",
      "enum": ["PendingModeration", "PassedModeration", "FailedModeration"]
    }
  }
}

      

Responses

Status code: 200
Response Headers
Response Body
            
{
  "@id": "330b65b8-0b71-44e4-a65f-4e6e984907b6",
  "@type": "LiveDiscussion",
  "application": {
    "@id": "20fc60c1-d232-48a4-96ed-85b03fddc0a4",
    "@type": "Application"
  },
  "topic": {
    "@id": "f5dcceae-8bbd-4b87-ae59-d9ac9697ed5c",
    "@type": "Topic"
  },
  "category": {
    "@id": "bb965149-bae9-4535-9dbe-c751229643d5",
    "@type": "Category"
  },
  "author": {
    "@id": "e453f1a8-623a-4ea0-be09-544d4671aacc",
    "@type": "Worker"
  },
  "title": "Title of the live discussion",
  "content": "The content of the live discussion",
  "publishStatus": { "@id": "Published", "@type": "PublishStatus" },
  "moderationStatus": { "@id": "PassedModeration", "@type": "ModerationStatus" },
  "minAge": 0,
  "maxAge": 999,
  "thumbnail": {
    "@id": "[file-path]",
    "@type": "Thumbnail"
  },
  "startTime": "2018-01-01T00:00:00.000Z",
  "endTime": "2018-01-01T00:00:00.000Z",
  "dateTimeCreated": "2018-01-01T00:00:00.000Z",
  "contentCount": 0,
  "userCount": 0,
  "usefulCount": 0,
  "followCount": 0
}

          
Status code: 400
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity is invalid - [actual information]"
    
    }
		
          
Status code: 401
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The requested resource requires authorization"
    
    }
		
          
Status code: 403
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "You are not authorized to access the resource"
    
    }
		
          
Status code: 404
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity was not found - [actual information]"
    
    }
		
          
Status code: 500
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "Server error - [actual information]"
    
    }
		
          

Emits

[#] [back to top]

GetContentResources

Returns all relevant content resources

Path /content/resources
Method GET
Headers
Authorization: JWT
Accepts: application/json+ld
Content-Type: application/json+ld
Query Parameters
applicationId: application id
applicationServiceGroupId: application service group id
categoryId: category filter
topicId: topic filter
resourceType: content resource type filter
parentResourceId: parent resource id resource filter
publishStatus: publish status filter
moderationStatus: moderation status filter
age: age filter
keywords: keyword search
order: the ordering of the results
perPage: number of results per page
page: page of results to fetch
Constraints
http://vocabularies.xenzone.com/xcp-api/0.0.1/GetContentResources.schema.json
        
{
  "type": "object",
  "properties": {
    "applicationId": { "type": "string", "minLength": 1 },
    "applicationServiceGroupId": { "type": "string", "minLength": 1 },
    "resourceType": {
      "type": "string",
      "enum": [
        "Article",
        "Discussion",
        "LiveDiscussion",
        "QAndADiscussion",
        "Comment",
        "ArticleComment",
        "DiscussionComment",
        "LiveDiscussionComment"
      ]
    },
    "categoryId": { "type": "string", "minLength": 1 },
    "topicId": { "type": "string", "minLength": 1 },
    "parentResourceId": { "type": "string", "minLength": 1 },
    "publishStatus": {
      "type": "string",
      "enum": ["Unpublished", "Published"]
    },
    "moderationStatus": {
      "type": "string",
      "enum": ["PendingModeration", "PassedModeration", "FailedModeration"]
    },
    "age": { "type": "integer", "minimum": 1, "maximum": 999 },
    "keywords": { "type": "string", "minLength": 3 },
    "order": {
      "type": "string",
      "enum": [
        "Newest",
        "Oldest",
        "MostUseful",
        "LeastUseful",
        "MostFollowed",
        "LeastFollowed"
      ],
      "default": "Newest"
    },
    "page": { "type": "integer', "minimum": 1, "default": 1 },
    "perPage": { "type": "integer', "minimum": 1, "maximum": 50, "default": 10 }
  },
}

      

Responses

Status code: 400
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity is invalid - [actual information]"
    
    }
		
          
Status code: 401
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The requested resource requires authorization"
    
    }
		
          
Status code: 403
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "You are not authorized to access the resource"
    
    }
		
          
Status code: 500
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "Server error - [actual information]"
    
    }
		
          

Emits

[#] [back to top]

GetFollows

Returns the resources that a user follows

Path /content/follows
Method GET
Headers
Authorization: JWT
Accepts: application/json+ld
Content-Type: application/json+ld
Query Parameters
applicationServiceGroupId: application service group id
applicationId: application id
resourceId: The resource id to return follows for
resourceType: The resource type to return follows for
followerId: user ID follow filter
followerType: user type follow filter
perPage: number of results per page
page: page of results to fetch
Constraints
http://vocabularies.xenzone.com/xcp-api/0.0.1/GetFollows.schema.json
        
{
  "type": "object",
  "properties": {
    "applicationServiceGroupId": { "type": "string", "minLength": 1 },
    "applicationId": { "type": "string", "minLength": 1 },
    "resourceId": { "type": "string", "minLength": 1 },
    "resourceType": {
      "type": "string",
      "enum": [
        "Category",
        "Topic",
        "Article",
        "Discussion",
        "LiveDiscussion",
        "QAndADiscussion",
        "Comment"
      ]
    },
    "followerId": { "type": "string", "minLength": 1 },@
    "followerType": { "type": "string", "enum": ["ServiceUser", "Worker"] },
    "page": { "type": "integer", "minimum": 1, "default": 1 },
    "perPage": { "type": "integer", "minimum": 1, "maximum": 50, "default": 10 }
  }
}

      

Responses

Status code: 200
Response Headers
Response Body
            
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@type": "Collection",
  "results": [
    {
      "@type": "Follow",
      "resource": {
        "@id": "20fc60c1-d232-48a4-96ed-85b03fddc0a4",
        "@type": "Topic"
      },
      "follower": {
        "@id" "20fc60c1-d232-48a4-96ed-85b03fddc0a4",
        "@type": "ServiceUser",
      }
    },
    {
      "@type": "Follow",
      "resource": {
        "@id": "f9edff9c-9d54-4e5e-94e3-891d94e64af2",
        "@type": "Topic"
      },
      "follower": {
        "@id" "20fc60c1-d232-48a4-96ed-85b03fddc0a4",
        "@type": "ServiceUser",
      }
    }
    // etc...
  ],
  "pagination": {
    "total": 2,
    "currentPage": 10,
    "perPage": 2
  }
}

          
Status code: 400
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity is invalid - [actual information]"
    
    }
		
          
Status code: 401
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The requested resource requires authorization"
    
    }
		
          
Status code: 403
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "You are not authorized to access the resource"
    
    }
		
          
Status code: 500
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "Server error - [actual information]"
    
    }
		
          

Emits

[#] [back to top]

GetTopic

Returns the topic for a given ID

Path /content/topics/:id
Method GET
Headers
Authorization: JWT
Accepts: application/json+ld
Content-Type: application/json+ld
Query Parameters
resourceType: Resource type filter
moderationStatus: Resource moderation status filter
Constraints
http://vocabularies.xenzone.com/xcp-api/0.0.1/GetTopic.schema.json
        
{
  "type": "object",
  "properties": {
    "resourceType": {
      "type": "string",
      "enum": ["Article", "Discussion", "LiveDiscussion", "QAndADiscussion", "Comment"]
    },
    "moderationStatus": {
      "type": "string",
      "enum": ["PendingModeration", "PassedModeration", "FailedModeration"]
    }
  },
}

      

Responses

Status code: 200
Response Headers
Response Body
            
{
  "@id": "330b65b8-0b71-44e4-a65f-4e6e984907b6",
  "@type": "Topic",
  "application": {
    "@id": "20fc60c1-d232-48a4-96ed-85b03fddc0a4",
    "@type": "Application"
  },
  "category": { 
    "@id": "bb965149-bae9-4535-9dbe-c751229643d5",
    "@type": "Category"
  },
  "name": "Topic 1",
  "contentCount": 0,
  "userCount": 0,
  "usefulCount": 0,
  "followCount": 0
}

          
Status code: 400
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity is invalid - [actual information]"
    
    }
		
          
Status code: 401
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The requested resource requires authorization"
    
    }
		
          
Status code: 403
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "You are not authorized to access the resource"
    
    }
		
          
Status code: 404
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity was not found - [actual information]"
    
    }
		
          
Status code: 500
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "Server error - [actual information]"
    
    }
		
          

Emits

[#] [back to top]

GetTopics

Returns all the topics

Path /content/topics
Method GET
Headers
Authorization: JWT
Accepts: application/json+ld
Content-Type: application/json+ld
Query Parameters
applicationServiceGroupId: application service group id
applicationId: application id
categoryId: category id
order: The ordering of the response
resourceType: Resource type filter
moderationStatus: Resource moderation status filter
perPage: number of results per page
page: page of results to fetch
Constraints
http://vocabularies.xenzone.com/xcp-api/0.0.1/GetTopics.schema.json
        
{
  "type": "object",
  "properties": {
    "applicationServiceGroupId": { "type": "string", "minLength": 1 },
    "applicationId": { "type": "string", "minLength": 1 },
    "categoryId": { "type": "string", "minLength": 1 },
    "order": {
      "type": "string",
      "enum": [
        "AlphabeticalAsc",
        "AlphabeticalDesc",
        "MostUseful",
        "LeastUseful",
        "MostFollowed",
        "LeastFollowed"
      ],
      "default": "AlphabeticalAsc"
    },
    "resourceType": {
      "type": "string",
      "enum": ["Article", "Discussion", "LiveDiscussion", "QAndADiscussion", "Comment"]
    },
    "moderationStatus": {
      "type": "string",
      "enum": ["PendingModeration", "PassedModeration", "FailedModeration"]
    },
    "page": { "type": "integer", "minimum": 1, "default": 1 },
    "perPage": { "type": "integer", "minimum": 1, "maximum": 50, "default": 10 }
  },
}

      

Responses

Status code: 200
Response Headers
Response Body
            
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@type": "Collection",
  "results": [
    {
      "@id": "330b65b8-0b71-44e4-a65f-4e6e984907b6",
      "@type": "Topic",
      "application": {
        "@id": "20fc60c1-d232-48a4-96ed-85b03fddc0a4",
        "@type": "Application"
      },
      "category": { 
        "@id": "bb965149-bae9-4535-9dbe-c751229643d5",
        "@type": "Category"
      },
      "name": "Topic 1",
      "contentCount": 0,
      "userCount": 0,
      "usefulCount": 0,
      "followCount": 0
    },
    // etc...
  ],
  "pagination": {
    "total": 2,
    "currentPage": 10,
    "perPage": 2
  }
}

          
Status code: 400
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity is invalid - [actual information]"
    
    }
		
          
Status code: 401
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The requested resource requires authorization"
    
    }
		
          
Status code: 403
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "You are not authorized to access the resource"
    
    }
		
          
Status code: 500
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "Server error - [actual information]"
    
    }
		
          

Emits

[#] [back to top]

GetUsefuls

Returns the resources that a user finds useful

Path /content/usefuls
Method GET
Headers
Authorization: JWT
Accepts: application/json+ld
Content-Type: application/json+ld
Query Parameters
applicationServiceGroupId: application service group id
applicationId: application id
resourceId: The resource id to return usefuls for
resourceType: The resource type to return usefuls for
usefulUserId: user ID usefuls filter
perPage: number of results per page
page: page of results to fetch
Constraints
http://vocabularies.xenzone.com/xcp-api/0.0.1/GetUsefuls.schema.json
        
{
  "type": "object",
  "properties": {
    "applicationServiceGroupId": { "type": "string", "minLength": 1 },
    "applicationId": { "type": "string", "minLength": 1 },
    "resourceId": { "type": "string", "minLength": 1 },
    "resourceType": {
      "type": "string",
      "enum": [
        "Category",
        "Topic",
        "Article",
        "Discussion",
        "LiveDiscussion",
        "QAndADiscussion",
        "Comment"
      ]
    },
    "userType": { "type": "string", "enum": ["ServiceUser", "Worker" },
    "usefulUserId": { "type": "string", "minLength": 1 },
    "page": { "type": "integer", "minimum": 1, "default": 1 },
    "perPage": { "type": "integer", "minimum": 1, "maximum": 50, "default": 10 }
  }
}

      

Responses

Status code: 200
Response Headers
Response Body
            
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@type": "Collection",
  "results": [
    {
      "@type": "Useful",
      "resource": {
        "@id": "20fc60c1-d232-48a4-96ed-85b03fddc0a4",
        "@type": "Topic"
      },
      "user": {
        "@id": "20fc60c1-d232-48a4-96ed-85b03fddc0a4",
        "@type": "Worker"
      }
    },
    {
      "@type": "Useful",
      "resource": {
        "@id": "f9edff9c-9d54-4e5e-94e3-891d94e64af2",
        "@type": "Topic"
      },
      "user": {
        "@id": "20fc60c1-d232-48a4-96ed-85b03fddc0a4",
        "@type": "ServiceUser"
      }
    }
    // etc...
  ],
  "pagination": {
    "total": 2,
    "currentPage": 10,
    "perPage": 2
  }
}

          
Status code: 400
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity is invalid - [actual information]"
    
    }
		
          
Status code: 401
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The requested resource requires authorization"
    
    }
		
          
Status code: 403
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "You are not authorized to access the resource"
    
    }
		
          
Status code: 500
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "Server error - [actual information]"
    
    }
		
          

Emits

[#] [back to top]

ModerateContentResource

Moderate a content resource

Path /content/resources/:id/moderation
Method PUT
Headers
Authorization: JWT
Accepts: application/json+ld
Content-Type: application/json+ld
Query Parameters
applicationServiceGroupId: application service group id
Request Body
        
{
  "@id": "330b65b8-0b71-44e4-a65f-4e6e984907b6",
  "@type": "Comment",
  "application": {
    "@id": "20fc60c1-d232-48a4-96ed-85b03fddc0a4",
    "@type": "Application"
  },
  "topic": {
    "@id": "f5dcceae-8bbd-4b87-ae59-d9ac9697ed5c",
    "@type": "Topic"
  },
  "category": {
    "@id": "bb965149-bae9-4535-9dbe-c751229643d5",
    "@type": "Category"
  },
  "replyTo": {
    "@id": "f5dcceae-8bbd-4b87-ae59-d9ac9697ed5c",
    "@type": "Comment"
  },
  "author": {
    "@id": "e453f1a8-623a-4ea0-be09-544d4671aacc",
    "@type": "ServiceUser"
  },
  "title": "Title of the comment",
  "content": "The content of the comment",
  "publishStatus": { "@id": "Published", "@type": "PublishStatus" },
  "moderationStatus": { "@id": "PassedModeration", "@type": "ModerationStatus" },
  "minAge": 0,
  "maxAge": 999,
  "thumbnail": {
    "@id": "[file-path]",
    "@type": "Thumbnail"
  },
}

      
Constraints
http://vocabularies.xenzone.com/xcp-api/0.0.1/ModerateContentResource.schema.json
        
{
  "type": "object",
  "properties": {
    "@type": {
      "type": "string",
      "enum": [
        "Article",
        "Discussion",
        "LiveDiscussion",
        "QAndADiscussion",
        "Comment"
      ]
    },
    "application": {
      "type": "object",
      "properties": {
        "@id": {
          "type": "string",
          "minLength": 1
        },
        "@type": {
          "type": "string",
          "enum": [
            "Application"
          ],
          "default": "Application"
        }
      },
      "required": [
        "@id"
      ]
    },
    "category": {
      "type": "object",
      "properties": {
        "@id": {
          "type": "string",
          "minLength": 1
        },
        "@type": {
          "type": "string",
          "enum": [
            "Category"
          ],
          "default": "Category"
        }
      },
      "required": [
        "@id"
      ]
    },
    "topic": {
      "type": "object",
      "properties": {
        "@id": {
          "type": "string",
          "minLength": 1
        },
        "@type": {
          "type": "string",
          "enum": [
            "Topic"
          ],
          "default": "Topic"
        }
      },
      "required": [
        "@id"
      ]
    },
    "author": {
      "type": "object",
      "properties": {
        "@id": {
          "type": "string",
          "minLength": 1
        },
        "@type": {
          "type": "string",
          "enum": [
            "ServiceUser",
            "Worker"
          ]
        }
      },
      "required": [
        "@id",
        "@type"
      ]
    },
    "title": {
      "type": "string",
      "minLength": 1
    },
    "content": {
      "type": "string",
      "minLength": 1
    },
    "publishStatus": {
      "type": "object",
      "properties": {
        "@id": {
          "type": "string",
          "enum": [
            "Unpublished",
            "Published"
          ],
          "default": "Unpublished"
        },
        "@type": {
          "type": "string",
          "enum": [
            "PublishStatus"
          ],
          "default": "PublishStatus"
        }
      },
      "required": [
        "@id"
      ]
    },
    "moderationStatus": {
      "type": "object",
      "properties": {
        "@id": {
          "type": "string",
          "enum": [
            "PendingModeration",
            "PassedModeration",
            "FailedModeration"
          ],
          "default": "PendingModeration"
        },
        "@type": {
          "type": "string",
          "enum": [
            "ModerationStatus"
          ],
          "default": "ModerationStatus"
        }
      },
      "required": [
        "@id"
      ]
    },
    "minAge": {
      "type": "integer",
      "minimum": 0,
      "maximum": 999
    },
    "maxAge": {
      "type": "integer",
      "minimum": 0,
      "maximum": 999
    },
    "startTime": {
      "type": "string"
    },
    "endTime": {
      "type": "string"
    },
    "replyTo": {
      "type": "object",
      "properties": {
        "@id": {
          "type": "string",
          "minLength": 1
        },
        "@type": {
          "type": "string",
          "enum": [
            "Article",
            "Discussion",
            "LiveDiscussion",
            "QAndADiscussion",
            "Comment"
          ]
        }
      },
      "required": [
        "@id",
        "@type"
      ]
    }
  },
  "thumbnail": {
    "type": "object",
    "properties": {
      "@id": {
        "type": "string",
        "minLength": 1
      },
      "@type": {
        "type": "string",
        "enum": [
          "Thumbnail"
        ],
        "default": "Thumbnail"
      }
    },
    "required": [
      "@id"
    ]
  },
  "required": [
    "@id",
    "@type",
    "application",
    "author",
    "content",
    "publishStatus",
    "moderationStatus"
  ]
}

      

Responses

Status code: 200
Response Headers
Response Body
            
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@graph": [
    {
      "@id": "13328e94-afd8-4135-b467-409256f2778f",
      "@type": "ContentResourceModeratedEvent",
      "causedBy": "commands/75a892ba-1ed3-4bb3-afe2-1df5f1141b35",
      "atTime": "2018-01-01T00:00:00.000Z"
    }, {
      "@id": "330b65b8-0b71-44e4-a65f-4e6e984907b6",
      "@type": "Comment",
      "application": {
        "@id": "20fc60c1-d232-48a4-96ed-85b03fddc0a4",
        "@type": "Application"
      },
      "topic": {
        "@id": "f5dcceae-8bbd-4b87-ae59-d9ac9697ed5c",
        "@type": "Topic"
      },
      "category": {
        "@id": "bb965149-bae9-4535-9dbe-c751229643d5",
        "@type": "Category"
      },
      "replyTo": {
        "@id": "f5dcceae-8bbd-4b87-ae59-d9ac9697ed5c",
        "@type": "Comment"
      },
      "author": {
        "@id": "e453f1a8-623a-4ea0-be09-544d4671aacc",
        "@type": "ServiceUser"
      },
      "thumbnail": {
        "@id": "[file-path]",
        "@type": "Thumbnail"
      },
      "title": "Title of the comment",
      "content": "The content of the comment",
      "publishStatus": { "@id": "Unpublished", "@type": "PublishStatus" },
      "moderationStatus": { "@id": "FailedModeration", "@type": "ModerationStatus" },
      "minAge": 0,
      "maxAge": 999,
      "dateTimeCreated": "2018-01-01T00:00:00.000Z",
      "contentCount": 0,
      "userCount": 0,
      "usefulCount": 0,
      "followCount": 0
    }
  ]
}

          
Status code: 400
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity is invalid - [actual information]"
    
    }
		
          
Status code: 401
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The requested resource requires authorization"
    
    }
		
          
Status code: 403
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "You are not authorized to access the resource"
    
    }
		
          
Status code: 500
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "Server error - [actual information]"
    
    }
		
          

Emits

ContentResourceModeratedEvent
Path: null
Method: null
Body

            
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@graph": [
    {
      "@id": "13328e94-afd8-4135-b467-409256f2778f",
      "@type": "ContentResourceModeratedEvent",
      "causedBy": "commands/75a892ba-1ed3-4bb3-afe2-1df5f1141b35",
      "atTime": "2018-01-01T00:00:00.000Z"
    }, {
      "@id": "330b65b8-0b71-44e4-a65f-4e6e984907b6",
      "@type": "Comment",
      "application": {
        "@id": "20fc60c1-d232-48a4-96ed-85b03fddc0a4",
        "@type": "Application"
      },
      "topic": {
        "@id": "f5dcceae-8bbd-4b87-ae59-d9ac9697ed5c",
        "@type": "Topic"
      },
      "category": {
        "@id": "bb965149-bae9-4535-9dbe-c751229643d5",
        "@type": "Category"
      },
      "replyTo": {
        "@id": "f5dcceae-8bbd-4b87-ae59-d9ac9697ed5c",
        "@type": "Comment"
      },
      "author": {
        "@id": "e453f1a8-623a-4ea0-be09-544d4671aacc",
        "@type": "ServiceUser"
      },
      "thumbnail": {
        "@id": "[file-path]",
        "@type": "Thumbnail"
      },
      "title": "Title of the comment",
      "content": "The content of the comment",
      "publishStatus": { "@id": "Unpublished", "@type": "PublishStatus" },
      "moderationStatus": { "@id": "FailedModeration", "@type": "ModerationStatus" },
      "minAge": 0,
      "maxAge": 999,
      "dateTimeCreated": "2018-01-01T00:00:00.000Z",
      "contentCount": 0,
      "userCount": 0,
      "usefulCount": 0,
      "followCount": 0
    }
  ]
}

          

[#] [back to top]

UpdateCategory

Updates a category

Path /content/categories/:id
Method PUT
Headers
Authorization: JWT
Accepts: application/json+ld
Content-Type: application/json+ld
Query Parameters
Request Body
        
{
  "@id": "330b65b8-0b71-44e4-a65f-4e6e984907b6",
  "@type": "Category",
  "application": {
    "@id": "20fc60c1-d232-48a4-96ed-85b03fddc0a4",
    "@type": "Application"
  },
  "name": "Category A"
}

      
Constraints
http://vocabularies.xenzone.com/xcp-api/0.0.1/UpdateCategory.schema.json
        
{
  "type": "object",
  "properties": {
    "@id": { "type": "string", "minLength": 1 },
    "@type": { "type": "string", "enum": ["Category"], default: "Category" },
    "application": {
      "type": "object",
      "properties: {
        "@id": { "type": "string", "minLength": 1 },
        "@type" { "type": "string", "enum": ["Application"], "default": "Application" }
      },
      "required": ["@id"]
    }
    "name": { "type": "string", "minLength": 1 }
  },
  "required": ["@id", "application", "name"]
}

      

Responses

Status code: 200
Response Headers
Response Body
            
{
  "@context": 'https://vocabularies.xenzone.com/context.jsonld',
  "@graph": [{
    "@id": "[event-id]",
    "@type": "ContentCategoryUpdatedEvent",
    "atTime": "2018-01-10T16:56:15Z",
    "causedBy": "commands/[command-id]"
  }, {
    "@id": "330b65b8-0b71-44e4-a65f-4e6e984907b6",
    "@type": "Category",
    "application": {
      "@id": "20fc60c1-d232-48a4-96ed-85b03fddc0a4",
      "@type": "Application"
    },
    "name": "Category A",
    "contentCount": 0,
    "userCount": 0,
    "usefulCount": 0,
    "followCount": 0
  }]
}

          
Status code: 400
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity is invalid - [actual information]"
    
    }
		
          
Status code: 401
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The requested resource requires authorization"
    
    }
		
          
Status code: 403
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "You are not authorized to access the resource"
    
    }
		
          
Status code: 500
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "Server error - [actual information]"
    
    }
		
          

Emits

[#] [back to top]

UpdateContentResource

Updates a content resource

Path /content/resources/:id
Method PUT
Headers
Authorization: JWT
Accepts: application/json+ld
Content-Type: application/json+ld
Query Parameters
applicationServiceGroupId: application service group id
Request Body
        
{
  "@id": "20fc60c1-d232-48a4-96ed-85b03fddc0a4",
  "@type": "Comment"
  "application": {
    "@id": "20fc60c1-d232-48a4-96ed-85b03fddc0a4",
    "@type": "Application"
  },
  "topic": {
    "@id": "f5dcceae-8bbd-4b87-ae59-d9ac9697ed5c",
    "@type": "Topic"
  },
  "category": {
    "@id": "bb965149-bae9-4535-9dbe-c751229643d5",
    "@type": "Category"
  },
  "replyTo": {
    "@id": "bb965149-bae9-4535-9dbe-c751229643d5",
    "@type": "Comment"
  },
  "title": "The title of the comment",
  "content": "The content of the comment",
  "publishStatus": { "@id": "PendingModeration", "@type": "ModerationStatus" },
  "minAge": 0,
  "maxAge": 999,
  "thumbnail": {
    "@id": "[file-path]",
    "@type": "Thumbnail"
  },
}

      
Constraints
http://vocabularies.xenzone.com/xcp-api/0.0.1/UpdateContentResource.schema.json
        
{
  "type": "object",
  "properties": {
    "@type": {
      "type": "string",
      "enum": [
        "Article",
        "Discussion",
        "LiveDiscussion",
        "QAndADiscussion",
        "Comment"
      ]
    },
    "application": {
      "type": "object",
      "properties": {
        "@id": {
          "type": "string",
          "minLength": 1
        },
        "@type": {
          "type": "string",
          "enum": [
            "Application"
          ],
          "default": "Application"
        }
      },
      "required": [
        "@id"
      ]
    },
    "category": {
      "type": "object",
      "properties": {
        "@id": {
          "type": "string",
          "minLength": 1
        },
        "@type": {
          "type": "string",
          "enum": [
            "Category"
          ],
          "default": "Category"
        }
      },
      "required": [
        "@id"
      ]
    },
    "topic": {
      "type": "object",
      "properties": {
        "@id": {
          "type": "string",
          "minLength": 1
        },
        "@type": {
          "type": "string",
          "enum": [
            "Topic"
          ],
          "default": "Topic"
        }
      },
      "required": [
        "@id"
      ]
    },
    "author": {
      "type": "object",
      "properties": {
        "@id": {
          "type": "string",
          "minLength": 1
        },
        "@type": {
          "type": "string",
          "enum": [
            "ServiceUser",
            "Worker"
          ]
        }
      },
      "required": [
        "@id",
        "@type"
      ]
    },
    "title": {
      "type": "string",
      "minLength": 1
    },
    "content": {
      "type": "string",
      "minLength": 1
    },
    "publishStatus": {
      "type": "object",
      "properties": {
        "@id": {
          "type": "string",
          "enum": [
            "Unpublished",
            "Published"
          ],
          "default": "Unpublished"
        },
        "@type": {
          "type": "string",
          "enum": [
            "PublishStatus"
          ],
          "default": "PublishStatus"
        }
      },
      "required": [
        "@id"
      ]
    },
    "minAge": {
      "type": "integer",
      "minimum": 0,
      "maximum": 999
    },
    "maxAge": {
      "type": "integer",
      "minimum": 0,
      "maximum": 999
    },
    "startTime": {
      "type": "string"
    },
    "endTime": {
      "type": "string"
    },
    "replyTo": {
      "type": "object",
      "properties": {
        "@id": {
          "type": "string",
          "minLength": 1
        },
        "@type": {
          "type": "string",
          "enum": [
            "Article",
            "Discussion",
            "LiveDiscussion",
            "QAndADiscussion",
            "Comment"
          ]
        }
      },
      "required": [
        "@id",
        "@type"
      ]
    }
  },
  "thumbnail": {
    "type": "object",
    "properties": {
      "@id": {
        "type": "string",
        "minLength": 1
      },
      "@type": {
        "type": "string",
        "enum": [
          "Thumbnail"
        ],
        "default": "Thumbnail"
      }
    },
    "required": [
      "@id"
    ]
  },
  "required": [
    "@type",
    "application",
    "author",
    "content"
  ]
}

      

Responses

Status code: 200
Response Headers
Response Body
            
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@graph": [
    {
      "@id": "13328e94-afd8-4135-b467-409256f2778f",
      "@type": "ContentResourceUpdatedEvent",
      "causedBy": "commands/75a892ba-1ed3-4bb3-afe2-1df5f1141b35",
      "atTime": "2018-01-01T00:00:00.000Z"
    }, {
      "@id": "330b65b8-0b71-44e4-a65f-4e6e984907b6",
      "@type": "Comment",
      "application": {
        "@id": "20fc60c1-d232-48a4-96ed-85b03fddc0a4",
        "@type": "Application"
      },
      "topic": {
        "@id": "f5dcceae-8bbd-4b87-ae59-d9ac9697ed5c",
        "@type": "Topic"
      },
      "category": {
        "@id": "bb965149-bae9-4535-9dbe-c751229643d5",
        "@type": "Category"
      },
      "replyTo": {
        "@id": "f5dcceae-8bbd-4b87-ae59-d9ac9697ed5c",
        "@type": "Comment"
      },
      "author": {
        "@id": "e453f1a8-623a-4ea0-be09-544d4671aacc",
        "@type": "ServiceUser"
      },
      "thumbnail": {
        "@id": "[file-path]",
        "@type": "Thumbnail"
      },
      "title": "Title of the comment",
      "content": "The content of the comment",
      "publishStatus": { "@id": "Unpublished", "@type": "PublishStatus" },
      "moderationStatus": { "@id": "PendingModeration", "@type": "ModerationStatus" },
      "minAge": 0,
      "maxAge": 999,
      "dateTimeCreated": "2018-01-01T00:00:00.000Z",
      "contentCount": 0,
      "userCount": 0,
      "usefulCount": 0,
      "followCount": 0
    }
  ]
}

          
Status code: 400
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity is invalid - [actual information]"
    
    }
		
          
Status code: 401
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The requested resource requires authorization"
    
    }
		
          
Status code: 403
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "You are not authorized to access the resource"
    
    }
		
          
Status code: 500
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "Server error - [actual information]"
    
    }
		
          

Emits

UpdateContentResourceEvent
Path: null
Method: null
Body

            
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@graph": [
    {
      "@id": "13328e94-afd8-4135-b467-409256f2778f",
      "@type": "ContentResourceUpdatedEvent",
      "causedBy": "commands/75a892ba-1ed3-4bb3-afe2-1df5f1141b35",
      "atTime": "2018-01-01T00:00:00.000Z"
    }, {
      "@id": "330b65b8-0b71-44e4-a65f-4e6e984907b6",
      "@type": "Comment",
      "application": {
        "@id": "20fc60c1-d232-48a4-96ed-85b03fddc0a4",
        "@type": "Application"
      },
      "topic": {
        "@id": "f5dcceae-8bbd-4b87-ae59-d9ac9697ed5c",
        "@type": "Topic"
      },
      "category": {
        "@id": "bb965149-bae9-4535-9dbe-c751229643d5",
        "@type": "Category"
      },
      "replyTo": {
        "@id": "f5dcceae-8bbd-4b87-ae59-d9ac9697ed5c",
        "@type": "Comment"
      },
      "author": {
        "@id": "e453f1a8-623a-4ea0-be09-544d4671aacc",
        "@type": "ServiceUser"
      },
      "thumbnail": {
        "@id": "[file-path]",
        "@type": "Thumbnail"
      },
      "title": "Title of the comment",
      "content": "The content of the comment",
      "publishStatus": { "@id": "Unpublished", "@type": "PublishStatus" },
      "moderationStatus": { "@id": "PendingModeration", "@type": "ModerationStatus" },
      "minAge": 0,
      "maxAge": 999,
      "dateTimeCreated": "2018-01-01T00:00:00.000Z",
      "contentCount": 0,
      "userCount": 0,
      "usefulCount": 0,
      "followCount": 0
    }
  ]
}

          

[#] [back to top]

UpdateTopic

Updates a topic

Path /content/topics/:id
Method PUT
Headers
Authorization: JWT
Accepts: application/json+ld
Content-Type: application/json+ld
Query Parameters
Request Body
        
{
  "@id": "f9edff9c-9d54-4e5e-94e3-891d94e64af2",
  "@type": "Topic",
  "application": {
    "@id": "20fc60c1-d232-48a4-96ed-85b03fddc0a4",
    "@type": "Application"
  },
  "category": {
    "@id": "e401fd9b-ef4a-49a0-a27b-aeecdf6c4df3",
    "@type": "Category"
  },
  "name": "Topic Name"
}

      
Constraints
http://vocabularies.xenzone.com/xcp-api/0.0.1/UpdateTopic.schema.json
        
{
  "type": "object",
  "properties": {
    "@id": { "type": "string", "minLength": 1 },
    "@type": { "type": "string", "enum": ["Topic"], "default": "Topic" },
    "application": {
      "type": "object",
      "properties": {
        "@id": { "type": "string", "minLength": 1 },
        "@type": { "type": "string", "enum": ["Application"], "default": "Application" }
      },
      "required": ["@id"]
    },
    "category": {
      "type": "object",
      "properties": {
        "@id": { "type": "string", "minLength": 1 },
        "@type": { "type": "string", "enum": ["Category"], "default": "Category" }
      },
      "required": ["@id"]
    }
    "name": { "type": "string", "minLength": 1 }
  },
  "required": ["@id", "application", "category", "name"]
}

      

Responses

Status code: 200
Response Headers
Response Body
            
{
  "@context": 'https://vocabularies.xenzone.com/context.jsonld',
  "@graph": [{
    "@id": "[event-id]",
    "@type": "ContentTopicUpdatedEvent",
    "atTime": "2018-01-10T16:56:15Z",
    "causedBy": "commands/[command-id]"
  }, {
    "@id": "f9edff9c-9d54-4e5e-94e3-891d94e64af2",
    "@type": "Topic",
    "application": {
      "@id": "20fc60c1-d232-48a4-96ed-85b03fddc0a4",
      "@type": "Application",
    },
    "category": {
      "@id": "e401fd9b-ef4a-49a0-a27b-aeecdf6c4df3",
      "@type" "Category"
    },
    "name": "Topic Name",
    "contentCount": 0,
    "userCount": 0,
    "usefulCount": 0,
    "followCount": 0
  }]
}

          
Status code: 400
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity is invalid - [actual information]"
    
    }
		
          
Status code: 401
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The requested resource requires authorization"
    
    }
		
          
Status code: 403
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "You are not authorized to access the resource"
    
    }
		
          
Status code: 500
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "Server error - [actual information]"
    
    }
		
          

Emits

ForumTopicUpdatedEvent
Path: null
Method: null
Body

            
{
  "@context": 'https://vocabularies.xenzone.com/context.jsonld',
  "@graph": [{
    "@id": "[event-id]",
    "@type": "ContentTopicUpdatedEvent",
    "atTime": "2018-01-10T16:56:15Z",
    "causedBy": "commands/[command-id]"
  }, {
    "@id": "f9edff9c-9d54-4e5e-94e3-891d94e64af2",
    "@type": "Topic",
    "application": {
      "@id": "20fc60c1-d232-48a4-96ed-85b03fddc0a4",
      "@type": "Application",
    },
    "category": {
      "@id": "e401fd9b-ef4a-49a0-a27b-aeecdf6c4df3",
      "@type" "Category"
    },
    "name": "Topic Name",
    "contentCount": 0,
    "userCount": 0,
    "usefulCount": 0,
    "followCount": 0
  }]
}

          

[#] [back to top]

Email Service

SendEmail

A command to send an email

Path /emails
Method POST
Headers
Authorization: JWT
Accepts: application/json+ld
Content-Type: application/json+ld
Query Parameters
Request Body
        
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@id": "commands/6de5bb4e-6f81-4f85-82cf-8bca85703fab",
  "@type": "communication:Email",
  "communication:subject": "Welcome to XCP",
  "communication:body": [
    {
      "@type": "communication:HtmlBody",
      "core:content": "Lorem Ipsum"
    },
    {
      "@type": "communication:TextBody",
      "core:content": "Lorem Ipsum"
    }
  ],
  "communication:from": {
    "@type": "communication:Sender",
    "core:emailAddress": "platform@xenzone.com",
    "core:name": "XenZone Platform"
  },
  "communication:to": [
    {
      "@type": "communication:Recipient",
      "core:emailAddress": "t.cooper@example.com"
    },
    {
      "@type": "communication:Recipient",
      "core:emailAddress": "j.smith@example.com"
    }
  ]
}

      

Responses

Status code: 201
Response Headers
Response Body
            
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "api:atTime": "2018-01-05T16:56:15+00:00",
  "email": {
    "@type": "Email",
    "communication:subject": "Welcome to XCP",
    "communication:body": [
      {
        "@type": "communication:HtmlBody",
        "core:content": "Lorem Ipsum"
      },
      {
        "@type": "communication:TextBody",
        "core:content": "Lorem Ipsum"
      }
    ],
    "communication:from": {
      "core:emailAddress": "platform@xenzone.com",
      "core:name": "XenZone Platform"
    },
    "communication:to": [
      {
        "core:emailAddress": "t.cooper@example.com"
      },
      {
        "core:emailAddress": "j.smith@example.com"
      }
    ]
  }
}

          
Status code: 400
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity is invalid - [actual information]"
    
    }
		
          
Status code: 401
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The requested resource requires authorization"
    
    }
		
          
Status code: 403
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "You are not authorized to access the resource"
    
    }
		
          
Status code: 500
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "Server error - [actual information]"
    
    }
		
          

Emits

EmailSentEvent
Path: null
Method: null
Body

            
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "api:atTime": "2018-01-05T16:56:15+00:00",
  "email": {
    "@type": "Email",
    "communication:subject": "Welcome to XCP",
    "communication:body": [
      {
        "@type": "communication:HtmlBody",
        "core:content": "Lorem Ipsum"
      },
      {
        "@type": "communication:TextBody",
        "core:content": "Lorem Ipsum"
      }
    ],
    "communication:from": {
      "core:emailAddress": "platform@xenzone.com",
      "core:name": "XenZone Platform"
    },
    "communication:to": [
      {
        "core:emailAddress": "t.cooper@example.com"
      },
      {
        "core:emailAddress": "j.smith@example.com"
      }
    ]
  }
}

          
EmailFailedEvent
Path: null
Method: null
Body
            
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "api:atTime": "2018-01-05T16:56:15+00:00"
}

          

[#] [back to top]

Messaging Service

CreateChat

Creates a new multi-user chat, and invites the moderators and participants

Path /messaging/chats
Method POST
Headers
Authorization: JWT
Accepts: application/json+ld
Content-Type: application/json+ld
Query Parameters
Request Body
        {
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@type": "Chat",
  "participants": [
    {
      "@id": "0794c1d2-3cd6-4587-8e66-bcc27ba368c1",
      "@type": "ServiceUser"
    }
  ],
  "moderators": [
    {
      "@id": "d682ed3f-dbce-41eb-bf2d-e5fc56dc9db1",
      "@type": "Worker"
    }
  ],
  "application": {
    "@id": "645d38b7-1105-40d5-b1e6-17cf17d430ce",
    "@type": "Application"
  }
}
      
Constraints
http://vocabularies.xenzone.com/xcp-api/0.0.1/CreateChat.schema.json
        
{
  "type": "object",
  "properties": {
    "@context": {
      "type": "string",
      "enum": [
        "https://vocabularies.xenzone.com/context.jsonld"
      ]
    },
    "@id": {
      "type": "string",
      "format": "uuid"
    },
    "@type": {
      "type": "string",
      "enum": [
        "Chat"
      ]
    },
    "status": {
      "type": "object",
      "properties": {
        "@id": {
          "type": "string",
          "enum": [
            "Active",
            "Archived",
            "Unassigned"
          ]
        },
        "@type": {
          "type": "string",
          "enum": [
            "ConversationStatus"
          ]
        }
      },
      "required": [
        "@id",
        "@type"
      ]
    },
    "timer": {
      "type": "object",
      "properties": {
        "startTime": {
          "type": "string",
          "format": "date-time"
        },
        "endTime": {
          "type": "string",
          "format": "date-time"
        }
      }
    },
    "participants": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "@id": {
            "type": "string",
            "format": "uuid"
          },
          "@type": {
            "type": "string",
            "enum": [
              "Worker",
              "ServiceUser"
            ]
          }
        },
        "required": [
          "@id",
          "@type"
        ]
      }
    },
    "moderators": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "@id": {
            "type": "string",
            "format": "uuid"
          },
          "@type": {
            "type": "string",
            "enum": [
              "Worker",
              "ServiceUser"
            ]
          }
        },
        "required": [
          "@id",
          "@type"
        ]
      }
    },
    "application": {
      "type": "object",
      "properties": {
        "@id": {
          "type": "string",
          "format": "uuid"
        },
        "@type": {
          "type": "string",
          "enum": [
            "Application"
          ]
        }
      },
      "required": [
        "@id",
        "@type"
      ]
    }
  },
  "required": [
    "@type",
    "participants",
    "moderators"
  ]
}

      

Responses

Status code: 201
Response Headers
Response Body
            
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@graph": [
    {
      "@id": "[event-id]",
      "@type": "ChatCreatedEvent",
      "causedBy": "commands/[command-id]",
      "atTime": "2018-01-01T00:00:00.000Z"
    }, 
    {
      "@id": "3bb3c9ba-d26f-44bd-a007-fe6c3574789f",
      "@type": "Chat",
      "participants": [
        {
          "@id": "0794c1d2-3cd6-4587-8e66-bcc27ba368c1",
          "@type": "ServiceUser"
        }
      ],
      "moderators": [
        {
          "@id": "d682ed3f-dbce-41eb-bf2d-e5fc56dc9db1",
          "@type": "Worker"
        }
      ],
      "timer": {
        "startTime": "2018-04-27T13:00:13.006Z",
        "endTime": "2018-04-28T13:00:13.006Z",
      },
      "status": {
        "@id": "Active",
        "@type": "ConversationStatus"
      },
      "application": {
        "@id": "645d38b7-1105-40d5-b1e6-17cf17d430ce",
        "@type": "Application"
      }
    }
  ]
}

          
Status code: 400
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity is invalid - [actual information]"
    
    }
		
          
Status code: 401
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The requested resource requires authorization"
    
    }
		
          
Status code: 403
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "You are not authorized to access the resource"
    
    }
		
          
Status code: 404
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity was not found - [actual information]"
    
    }
		
          
Status code: 500
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "Server error - [actual information]"
    
    }
		
          

Emits

ChatCreatedEvent
Path: null
Method: null
Body

            
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@graph": [
    {
      "@id": "[event-id]",
      "@type": "ChatCreatedEvent",
      "causedBy": "commands/[command-id]",
      "atTime": "2018-01-01T00:00:00.000Z"
    }, 
    {
      "@id": "3bb3c9ba-d26f-44bd-a007-fe6c3574789f",
      "@type": "Chat",
      "participants": [
        {
          "@id": "0794c1d2-3cd6-4587-8e66-bcc27ba368c1",
          "@type": "ServiceUser"
        }
      ],
      "moderators": [
        {
          "@id": "d682ed3f-dbce-41eb-bf2d-e5fc56dc9db1",
          "@type": "Worker"
        }
      ],
      "timer": {
        "startTime": "2018-04-27T13:00:13.006Z",
        "endTime": "2018-04-28T13:00:13.006Z",
      },
      "status": {
        "@id": "Active",
        "@type": "ConversationStatus"
      },
      "application": {
        "@id": "645d38b7-1105-40d5-b1e6-17cf17d430ce",
        "@type": "Application"
      }
    }
  ]
}

          

[#] [back to top]

CreateMailboxConversation

Create a new conversation within a mailbox

Path /mailbox-conversations
Method POST
Headers
Authorization: JWT
Accepts: application/json+ld
Content-Type: application/json+ld
Query Parameters
Request Body
        
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@type": "MailboxConversation",
  "status": {
    "@id": "Active",
    "@type": "ConversationStatus"
  },
  "timer": {
    "startTime": "2018-04-27T13:00:13.006Z",
  },
  "participants": [
    {
      "@id": "d682ed3f-dbce-41eb-bf2d-e5fc56dc9db1",
      "@type": "Worker"
    },
    {
      "@id": "0794c1d2-3cd6-4587-8e66-bcc27ba368c1",
      "@type": "ServiceUser"
    },
  ],
  "applicationServiceGroup": {
    "@id": "asg/YoungPeople",
    "@type": "ApplicationServiceGroup"
  }
}

      
Constraints
http://vocabularies.xenzone.com/xcp-api/0.0.1/CreateMailboxConversation.schema.json
        
{
  "type": "object",
  "properties": {
    "@context": {
      "type": "string",
      "enum": [
        "https://vocabularies.xenzone.com/context.jsonld"
      ]
    },
    "@id": {
      "type": "string",
      "format": "uuid"
    },
    "@type": {
      "type": "string",
      "enum": [
        "MailboxConversation"
      ]
    },
    "status": {
      "type": "object",
      "properties": {
        "@id": {
          "type": "string",
          "enum": [
            "Active",
            "Archived",
            "Unassigned"
          ]
        },
        "@type": {
          "type": "string",
          "enum": [
            "ConversationStatus"
          ]
        }
      },
      "required": [
        "@id",
        "@type"
      ]
    },
    "timer": {
      "type": "object",
      "properties": {
        "startTime": {
          "type": "string",
          "format": "date-time"
        },
        "endTime": {
          "type": "string",
          "format": "date-time"
        }
      }
    },
    "participants": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "@id": {
            "type": "string",
            "format": "uuid"
          },
          "@type": {
            "type": "string",
            "enum": [
              "Worker",
              "ServiceUser"
            ]
          }
        },
        "required": [
          "@id",
          "@type"
        ]
      }
    },
    "applicationServiceGroup": {
      "type": "object",
      "properties": {
        "@id": {
          "type": "string",
          "pattern": "^asg\/.+$"
        },
        "@type": {
          "type": "string",
          "enum": [
            "ApplicationServiceGroup"
          ]
        }
      },
      "required": [
        "@id",
        "@type"
      ]
    }
  },
  "required": [
    "@type",
    "participants"
  ]
}

      

Responses

Status code: 201
Response Headers
Response Body
            {
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@graph": [
    {
      "@id": "ed7ebb91-26af-46c6-ba82-18121ace1cbe",
      "@type": "MailboxConversationCreatedEvent",
      "causedBy": "commands/e5e72f2d-82c1-4dfc-bd30-eb2209604916",
      "atTime": "2018-01-01T00:00:00.000Z"
    },
    {
      "@id": "867e8039-6b46-4207-9656-b55973a6d537",
      "@type": "MailboxConversation",
      "status": {
        "@id": "Active",
        "@type": "ConversationStatus"
      },
      "timer": {
        "startTime": "2018-04-27T13:00:13.006Z",
      },
      "participants": [
        {
          "@id": "d682ed3f-dbce-41eb-bf2d-e5fc56dc9db1",
          "@type": "Worker"
        },
        {
          "@id": "0794c1d2-3cd6-4587-8e66-bcc27ba368c1",
          "@type": "ServiceUser"
        },
      ],
      "applicationServiceGroup": {
        "@id": "asg/YoungPeople",
        "@type": "ApplicationServiceGroup"
      }
    }
  ]
}
          
Status code: 400
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity is invalid - [actual information]"
    
    }
		
          
Status code: 401
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The requested resource requires authorization"
    
    }
		
          
Status code: 403
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "You are not authorized to access the resource"
    
    }
		
          
Status code: 404
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity was not found - [actual information]"
    
    }
		
          
Status code: 406
Response Headers
Response Body
            {
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@type": "Error",
  "title": "An error occurred",
  "description": "The request entity is invalid - [actual information]"
}
          
Status code: 500
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "Server error - [actual information]"
    
    }
		
          

Emits

MailboxConversationCreatedEvent
Path: null
Method: null
Body

            {
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@graph": [
    {
      "@id": "ed7ebb91-26af-46c6-ba82-18121ace1cbe",
      "@type": "MailboxConversationCreatedEvent",
      "causedBy": "commands/e5e72f2d-82c1-4dfc-bd30-eb2209604916",
      "atTime": "2018-01-01T00:00:00.000Z"
    },
    {
      "@id": "867e8039-6b46-4207-9656-b55973a6d537",
      "@type": "MailboxConversation",
      "status": {
        "@id": "Active",
        "@type": "ConversationStatus"
      },
      "timer": {
        "startTime": "2018-04-27T13:00:13.006Z",
      },
      "participants": [
        {
          "@id": "d682ed3f-dbce-41eb-bf2d-e5fc56dc9db1",
          "@type": "Worker"
        },
        {
          "@id": "0794c1d2-3cd6-4587-8e66-bcc27ba368c1",
          "@type": "ServiceUser"
        },
      ],
      "applicationServiceGroup": {
        "@id": "asg/YoungPeople",
        "@type": "ApplicationServiceGroup"
      }
    }
  ]
}
          

[#] [back to top]

EndChat

Ends an existing multi-user chat, and removes all users from the room

Path /messaging/chats/[chat-id]
Method DELETE
Headers
Authorization: JWT
Accepts: application/json+ld
Content-Type: application/json+ld
Query Parameters

Responses

Status code: 200
Response Headers
Response Body
            
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@graph": [
    {
      "@id": "[event-id]",
      "@type": "ChatEndedEvent",
      "causedBy": "commands/[command-id]",
      "atTime": "2018-01-01T00:00:00.000Z"
    },
    {
      "@id": "3bb3c9ba-d26f-44bd-a007-fe6c3574789f",
      "@type": "Chat",
      "participants": [
        {
          "@id": "0794c1d2-3cd6-4587-8e66-bcc27ba368c1",
          "@type": "ServiceUser"
        }
      ],
      "moderators": [
        {
          "@id": "d682ed3f-dbce-41eb-bf2d-e5fc56dc9db1",
          "@type": "Worker"
        }
      ],
      "timer": {
        "startTime": "2018-04-27T13:00:13.006Z",
        "endTime": "2018-04-28T13:00:13.006Z"
      },
      "status": {
        "@id": "Active",
        "@type": "ConversationStatus"
      },
      "application": {
        "@id": "645d38b7-1105-40d5-b1e6-17cf17d430ce",
        "@type": "Application"
      }
    }
  ]
}

          
Status code: 400
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity is invalid - [actual information]"
    
    }
		
          
Status code: 401
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The requested resource requires authorization"
    
    }
		
          
Status code: 403
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "You are not authorized to access the resource"
    
    }
		
          
Status code: 404
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity was not found - [actual information]"
    
    }
		
          
Status code: 500
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "Server error - [actual information]"
    
    }
		
          

Emits

ChatEndedEvent
Path: null
Method: null
Body

            
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@graph": [
    {
      "@id": "[event-id]",
      "@type": "ChatEndedEvent",
      "causedBy": "commands/[command-id]",
      "atTime": "2018-01-01T00:00:00.000Z"
    },
    {
      "@id": "3bb3c9ba-d26f-44bd-a007-fe6c3574789f",
      "@type": "Chat",
      "participants": [
        {
          "@id": "0794c1d2-3cd6-4587-8e66-bcc27ba368c1",
          "@type": "ServiceUser"
        }
      ],
      "moderators": [
        {
          "@id": "d682ed3f-dbce-41eb-bf2d-e5fc56dc9db1",
          "@type": "Worker"
        }
      ],
      "timer": {
        "startTime": "2018-04-27T13:00:13.006Z",
        "endTime": "2018-04-28T13:00:13.006Z"
      },
      "status": {
        "@id": "Active",
        "@type": "ConversationStatus"
      },
      "application": {
        "@id": "645d38b7-1105-40d5-b1e6-17cf17d430ce",
        "@type": "Application"
      }
    }
  ]
}

          

[#] [back to top]

EndTimer

Sets the end time of a chat

Path /messaging/chats/[chat-id]/timer
Method DELETE
Headers
Authorization: JWT
Accepts: application/json+ld
Content-Type: application/json+ld
Query Parameters
Request Body
        
{
  @context: "https://vocabularies.xenzone.com/context.jsonld",
  @type: "Chat",
  "endTime": "2018-01-01T00:00:00.000Z"
}

      
Constraints
http://vocabularies.xenzone.com/xcp-api/0.0.1/EndTimer.schema.json
        
{
  "type": "object",
  "properties": {
    "startTime": {
      "type": "string",
      "format": "date-time"
    },
    "endTime": {
      "type": "string",
      "format": "date-time"
    }
  }
}

      

Responses

Status code: 200
Response Headers
Response Body
            
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@graph": [
    {
      "@id": "[event-id]",
      "@type": "ChatTimerEndedEvent",
      "causedBy": "commands/[command-id]",
      "atTime": "2018-01-01T00:00:00.000Z"
    },
    {
      "@id": "3bb3c9ba-d26f-44bd-a007-fe6c3574789f",
      "@type": "Chat",
      "participants": [
        {
          "@id": "0794c1d2-3cd6-4587-8e66-bcc27ba368c1",
          "@type": "ServiceUser"
        }
      ],
      "moderators": [
        {
          "@id": "d682ed3f-dbce-41eb-bf2d-e5fc56dc9db1",
          "@type": "Worker"
        }
      ],
      "timer": {
        "startTime": "2018-04-27T13:00:13.006Z",
        "endTime": "2018-04-28T13:00:13.006Z"
      },
      "status": {
        "@id": "Active",
        "@type": "ConversationStatus"
      },
      "application": {
        "@id": "645d38b7-1105-40d5-b1e6-17cf17d430ce",
        "@type": "Application"
      }
    }
  ]
}

          
Status code: 400
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity is invalid - [actual information]"
    
    }
		
          
Status code: 401
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The requested resource requires authorization"
    
    }
		
          
Status code: 403
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "You are not authorized to access the resource"
    
    }
		
          
Status code: 404
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity was not found - [actual information]"
    
    }
		
          
Status code: 500
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "Server error - [actual information]"
    
    }
		
          

Emits

ChatTimerEndedEvent
Path: null
Method: null
Body

            
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@graph": [
    {
      "@id": "[event-id]",
      "@type": "ChatTimerEndedEvent",
      "causedBy": "commands/[command-id]",
      "atTime": "2018-01-01T00:00:00.000Z"
    },
    {
      "@id": "3bb3c9ba-d26f-44bd-a007-fe6c3574789f",
      "@type": "Chat",
      "participants": [
        {
          "@id": "0794c1d2-3cd6-4587-8e66-bcc27ba368c1",
          "@type": "ServiceUser"
        }
      ],
      "moderators": [
        {
          "@id": "d682ed3f-dbce-41eb-bf2d-e5fc56dc9db1",
          "@type": "Worker"
        }
      ],
      "timer": {
        "startTime": "2018-04-27T13:00:13.006Z",
        "endTime": "2018-04-28T13:00:13.006Z"
      },
      "status": {
        "@id": "Active",
        "@type": "ConversationStatus"
      },
      "application": {
        "@id": "645d38b7-1105-40d5-b1e6-17cf17d430ce",
        "@type": "Application"
      }
    }
  ]
}

          

[#] [back to top]

GetChat

Gets information about a multi-user chat room

Path /messaging/chats/[chat-id]
Method GET
Headers
Authorization: JWT
Accepts: application/json+ld
Content-Type: application/json+ld
Query Parameters

Responses

Status code: 200
Response Headers
Response Body
            
{
  "@id": "3bb3c9ba-d26f-44bd-a007-fe6c3574789f",
  "@type": "Chat",
  "participants": [
    {
      "@id": "0794c1d2-3cd6-4587-8e66-bcc27ba368c1",
      "@type": "ServiceUser"
    }
  ],
  "moderators": [
    {
      "@id": "d682ed3f-dbce-41eb-bf2d-e5fc56dc9db1",
      "@type": "Worker"
    }
  ],
  "timer": {
    "startTime": "2018-04-27T13:00:13.006Z",
    "endTime": "2018-04-28T13:00:13.006Z"
  },
  "status": {
    "@id": "Active",
    "@type": "ConversationStatus"
  },
  "application": {
    "@id": "645d38b7-1105-40d5-b1e6-17cf17d430ce",
    "@type": "Application"
  }
}

          
Status code: 400
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity is invalid - [actual information]"
    
    }
		
          
Status code: 401
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The requested resource requires authorization"
    
    }
		
          
Status code: 403
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "You are not authorized to access the resource"
    
    }
		
          
Status code: 404
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity was not found - [actual information]"
    
    }
		
          
Status code: 500
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "Server error - [actual information]"
    
    }
		
          

Emits

[#] [back to top]

GetMailboxConversations

Get all conversations

Path /mailbox-conversations
Method GET
Headers
Authorization: JWT
Accepts: application/json+ld
Query Parameters
applicationServiceGroupId: application service group id, if token contains a ASG that will override this
status: status
participantId: participant id
perPage: number of results per page
page: page of results to fetch

Responses

Status code: 401
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The requested resource requires authorization"
    
    }
		
          
Status code: 403
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "You are not authorized to access the resource"
    
    }
		
          
Status code: 404
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity was not found - [actual information]"
    
    }
		
          
Status code: 500
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "Server error - [actual information]"
    
    }
		
          

Emits

[#] [back to top]

GetServiceUserMailboxConversation

Get a conversation within a service user mailbox

Path /service-user-mailboxes/:workerId/conversations/:conversationId
Method GET
Headers
Authorization: JWT
Accepts: application/json+ld
Query Parameters

Responses

Status code: 200
Response Headers
Response Body
            
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@id": "c12c7186-b5f7-45cd-892b-7975775bf8c2",
  "@type": "MailboxConversation",
  "status": {
    "@id": "Active",
    "@type": "ConversationStatus"
  },
  "timer": {
    "startTime": "2018-04-27T13:00:13.006Z",
  },
  "participants": [
    {
      "@id": "d682ed3f-dbce-41eb-bf2d-e5fc56dc9db1",
      "@type": "Worker"
    },
    {
      "@id": "0794c1d2-3cd6-4587-8e66-bcc27ba368c1",
      "@type": "ServiceUser"
    },
  ],
  "applicationServiceGroup": {
    "@id": "asg/YoungPeople",
    "@type": "ApplicationServiceGroup"
  }
}

          
Status code: 401
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The requested resource requires authorization"
    
    }
		
          
Status code: 403
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "You are not authorized to access the resource"
    
    }
		
          
Status code: 404
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity was not found - [actual information]"
    
    }
		
          
Status code: 500
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "Server error - [actual information]"
    
    }
		
          

Emits

[#] [back to top]

GetServiceUserMailboxConversations

Get all conversation within a service user mailbox

Path /service-user-mailboxes/:serviceUserId/conversations
Method GET
Headers
Authorization: JWT
Accepts: application/json+ld
Query Parameters
applicationServiceGroupId: application service group id, if token contains a ASG that will override this
status: status
participantId: participant id
perPage: number of results per page
page: page of results to fetch

Responses

Status code: 200
Response Headers
Response Body
            
{
  "results": [
    {
      "@context": "https://vocabularies.xenzone.com/context.jsonld",
      "@id": "c12c7186-b5f7-45cd-892b-7975775bf8c2",
      "@type": "MailboxConversation",
      "status": {
        "@id": "Active",
        "@type": "ConversationStatus"
      },
      "timer": {
        "startTime": "2018-04-27T13:00:13.006Z",
      },
      "participants": [
        {
          "@id": "d682ed3f-dbce-41eb-bf2d-e5fc56dc9db1",
          "@type": "ServiceUser"
        },
        {
          "@id": "0794c1d2-3cd6-4587-8e66-bcc27ba368c1",
          "@type": "ServiceUser"
        },
      ],
      "applicationServiceGroup": {
        "@id": "asg/YoungPeople",
        "@type": "ApplicationServiceGroup"
      }
    }
  ],
  "pagination": {
    "total": 10,
    "currentPage": 1,
    "perPage": 1
  }
}

          
Status code: 401
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The requested resource requires authorization"
    
    }
		
          
Status code: 403
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "You are not authorized to access the resource"
    
    }
		
          
Status code: 404
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity was not found - [actual information]"
    
    }
		
          
Status code: 500
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "Server error - [actual information]"
    
    }
		
          

Emits

[#] [back to top]

GetWorkerMailboxConversation

Get a conversation within a worker mailbox

Path /worker-mailboxes/:workerId/conversations/:conversationId
Method GET
Headers
Authorization: JWT
Accepts: application/json+ld
Query Parameters

Responses

Status code: 200
Response Headers
Response Body
            
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@id": "c12c7186-b5f7-45cd-892b-7975775bf8c2",
  "@type": "MailboxConversation",
  "status": {
    "@id": "Active",
    "@type": "ConversationStatus"
  },
  "timer": {
    "startTime": "2018-04-27T13:00:13.006Z",
  },
  "participants": [
    {
      "@id": "d682ed3f-dbce-41eb-bf2d-e5fc56dc9db1",
      "@type": "Worker"
    },
    {
      "@id": "0794c1d2-3cd6-4587-8e66-bcc27ba368c1",
      "@type": "ServiceUser"
    },
  ],
  "applicationServiceGroup": {
    "@id": "asg/YoungPeople",
    "@type": "ApplicationServiceGroup"
  }
}

          
Status code: 401
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The requested resource requires authorization"
    
    }
		
          
Status code: 403
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "You are not authorized to access the resource"
    
    }
		
          
Status code: 404
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity was not found - [actual information]"
    
    }
		
          
Status code: 500
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "Server error - [actual information]"
    
    }
		
          

Emits

[#] [back to top]

GetWorkerMailboxConversations

Get all conversation within a worker mailbox

Path /worker-mailboxes/:workerId/conversations
Method GET
Headers
Authorization: JWT
Accepts: application/json+ld
Query Parameters
applicationServiceGroupId: application service group id, if token contains a ASG that will override this
status: status
participantId: participant id
perPage: number of results per page
page: page of results to fetch

Responses

Status code: 200
Response Headers
Response Body
            
{
  "results": [
    {
      "@context": "https://vocabularies.xenzone.com/context.jsonld",
      "@id": "c12c7186-b5f7-45cd-892b-7975775bf8c2",
      "@type": "MailboxConversation",
      "status": {
        "@id": "Active",
        "@type": "ConversationStatus"
      },
      "timer": {
        "startTime": "2018-04-27T13:00:13.006Z",
      },
      "participants": [
        {
          "@id": "d682ed3f-dbce-41eb-bf2d-e5fc56dc9db1",
          "@type": "Worker"
        },
        {
          "@id": "0794c1d2-3cd6-4587-8e66-bcc27ba368c1",
          "@type": "ServiceUser"
        },
      ],
      "applicationServiceGroup": {
        "@id": "asg/YoungPeople",
        "@type": "ApplicationServiceGroup"
      }
    }
  ],
  "pagination": {
    "total": 10,
    "currentPage": 1,
    "perPage": 1
  }
}

          
Status code: 200
Response Headers
Response Body
            
{
  "results": [
    {
      "@context": "https://vocabularies.xenzone.com/context.jsonld",
      "@id": "c12c7186-b5f7-45cd-892b-7975775bf8c2",
      "@type": "MailboxConversation",
      "status": {
        "@id": "Active",
        "@type": "ConversationStatus"
      },
      "timer": {
        "startTime": "2018-04-27T13:00:13.006Z",
      },
      "participants": [
        {
          "@id": "d682ed3f-dbce-41eb-bf2d-e5fc56dc9db1",
          "@type": "Worker"
        },
        {
          "@id": "0794c1d2-3cd6-4587-8e66-bcc27ba368c1",
          "@type": "ServiceUser"
        },
      ],
      "applicationServiceGroup": {
        "@id": "asg/YoungPeople",
        "@type": "ApplicationServiceGroup"
      }
    }
  ],
  "pagination": {
    "total": 10,
    "currentPage": 1,
    "perPage": 1
  }
}

          
Status code: 401
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The requested resource requires authorization"
    
    }
		
          
Status code: 403
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "You are not authorized to access the resource"
    
    }
		
          
Status code: 404
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity was not found - [actual information]"
    
    }
		
          
Status code: 500
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "Server error - [actual information]"
    
    }
		
          

Emits

[#] [back to top]

UpdateMailboxConversation

Partially update a conversation within a mailbox

Path /mailbox-conversations/:conversationId
Method PATCH
Headers
Authorization: JWT
Accepts: application/json+ld
Content-Type: application/json+ld
Query Parameters
Request Body
        
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@type": "MailboxConversation",
  "status": {
    "@id": "Active",
    "@type": "ConversationStatus"
  },
  "timer": {
    "startTime": "2018-04-27T13:00:13.006Z",
  },
  "participants": [
    {
      "@id": "d682ed3f-dbce-41eb-bf2d-e5fc56dc9db1",
      "@type": "Worker"
    },
    {
      "@id": "0794c1d2-3cd6-4587-8e66-bcc27ba368c1",
      "@type": "ServiceUser"
    },
  ],
  "applicationServiceGroup": {
    "@id": "asg/YoungPeople",
    "@type": "ApplicationServiceGroup"
  }
}

      
Constraints
http://vocabularies.xenzone.com/xcp-api/0.0.1/UpdateMailboxConversation.schema.json
        
{
  "type": "object",
  "properties": {
    "@context": {
      "type": "string",
      "enum": [
        "https://vocabularies.xenzone.com/context.jsonld"
      ]
    },
    "@id": {
      "type": "string",
      "format": "uuid"
    },
    "@type": {
      "type": "string",
      "enum": [
        "MailboxConversation"
      ]
    },
    "status": {
      "type": "object",
      "properties": {
        "@id": {
          "type": "string",
          "enum": [
            "Active",
            "Archived",
            "Unassigned"
          ]
        },
        "@type": {
          "type": "string",
          "enum": [
            "ConversationStatus"
          ]
        }
      },
      "required": [
        "@id",
        "@type"
      ]
    },
    "timer": {
      "type": "object",
      "properties": {
        "startTime": {
          "type": "string",
          "format": "date-time"
        },
        "endTime": {
          "type": "string",
          "format": "date-time"
        }
      }
    },
    "participants": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "@id": {
            "type": "string",
            "format": "uuid"
          },
          "@type": {
            "type": "string",
            "enum": [
              "Worker",
              "ServiceUser"
            ]
          }
        },
        "required": [
          "@id",
          "@type"
        ]
      }
    },
    "applicationServiceGroup": {
      "type": "object",
      "properties": {
        "@id": {
          "type": "string",
          "pattern": "^asg\/.+$"
        },
        "@type": {
          "type": "string",
          "enum": [
            "ApplicationServiceGroup"
          ]
        }
      },
      "required": [
        "@id",
        "@type"
      ]
    }
  },
  "required": [
    "@type"
  ]
}

      

Responses

Status code: 201
Response Headers
Response Body
            {
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@graph": [
    {
      "@id": "ed7ebb91-26af-46c6-ba82-18121ace1cbe",
      "@type": "MailboxConversationUpdatedEvent",
      "causedBy": "commands/e5e72f2d-82c1-4dfc-bd30-eb2209604916",
      "atTime": "2018-01-01T00:00:00.000Z"
    },
    {
      "@id": "867e8039-6b46-4207-9656-b55973a6d537",
      "@type": "MailboxConversation",
      "status": {
        "@id": "Active",
        "@type": "ConversationStatus"
      },
      "timer": {
        "startTime": "2018-04-27T13:00:13.006Z",
      },
      "participants": [
        {
          "@id": "d682ed3f-dbce-41eb-bf2d-e5fc56dc9db1",
          "@type": "Worker"
        },
        {
          "@id": "0794c1d2-3cd6-4587-8e66-bcc27ba368c1",
          "@type": "ServiceUser"
        },
      ],
      "applicationServiceGroup": {
        "@id": "asg/YoungPeople",
        "@type": "ApplicationServiceGroup"
      }
    }
  ]
}
          
Status code: 400
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity is invalid - [actual information]"
    
    }
		
          
Status code: 401
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The requested resource requires authorization"
    
    }
		
          
Status code: 403
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "You are not authorized to access the resource"
    
    }
		
          
Status code: 404
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity was not found - [actual information]"
    
    }
		
          
Status code: 406
Response Headers
Response Body
            {
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@type": "Error",
  "title": "An error occurred",
  "description": "The request entity is invalid - [actual information]"
}
          
Status code: 500
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "Server error - [actual information]"
    
    }
		
          

Emits

MailboxConversationUpdatedEvent
Path: null
Method: null
Body

            {
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@graph": [
    {
      "@id": "ed7ebb91-26af-46c6-ba82-18121ace1cbe",
      "@type": "MailboxConversationUpdatedEvent",
      "causedBy": "commands/e5e72f2d-82c1-4dfc-bd30-eb2209604916",
      "atTime": "2018-01-01T00:00:00.000Z"
    },
    {
      "@id": "867e8039-6b46-4207-9656-b55973a6d537",
      "@type": "MailboxConversation",
      "status": {
        "@id": "Active",
        "@type": "ConversationStatus"
      },
      "timer": {
        "startTime": "2018-04-27T13:00:13.006Z",
      },
      "participants": [
        {
          "@id": "d682ed3f-dbce-41eb-bf2d-e5fc56dc9db1",
          "@type": "Worker"
        },
        {
          "@id": "0794c1d2-3cd6-4587-8e66-bcc27ba368c1",
          "@type": "ServiceUser"
        },
      ],
      "applicationServiceGroup": {
        "@id": "asg/YoungPeople",
        "@type": "ApplicationServiceGroup"
      }
    }
  ]
}
          

[#] [back to top]

SendMessage

Sends a message to a conversation

Path /messages
Method POST
Headers
Authorization: JWT
Accepts: application/json+ld
Content-Type: application/json+ld
Query Parameters
Request Body
        
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@type": "LinkMessage",
  "to": {
    "@id": "3bb3c9ba-d26f-44bd-a007-fe6c3574789f",
    "@type": "Chat"
  },
  "from": {
    "@id": "3bb3c9ba-d26f-44bd-a007-fe6c3574789f",
    "@type": "Worker"
  },
  "body": "The text to show as a hyperlink",
  "url": "The URL to direct a user to when the link is clicked"
}

      
Constraints
http://vocabularies.xenzone.com/xcp-api/0.0.1/SendMessage.schema.json
        
{
  "type": "object",
  "properties": {
    "@type": {
      "type": "string",
      "enum": [
        "BasicMessage",
        "BasicAdminMessage",
        "LinkMessage"
      ]
    },
    "to": {
      "type": "object",
      "properties": {
        "@id": { "type": "string", "minLength": 1 },
        "@type": {
          "type": "string",
          "enum": ["Worker", "ServiceUser", "Chat", "MailboxConversation"]
        }
      },
      "required": ["@id", "@type"]
    },
    "from": {
      "type": "object",
      "properties": {
        "@id": { "type": "string", "minLength": 1 },
        "@type": {
          "type": "string",
          "enum": ["Worker", "ServiceUser", "Chat", "MailboxConversation"]
        }
      },
      "required": ["@id", "@type"]
    },
    "body": { "type": "string", "minLength": 1 },
    "url": { "type": "string", "minLength": 1 }
  },
  "required": ["@type", "to", "from", "body"]
}

      

Responses

Status code: 202
Response Headers
Response Body
            
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@graph": [
    {
      "@id": "[event-id]",
      "@type": "MessagePreparedEvent",
      "causedBy": "commands/[command-id]",
      "atTime": "2018-01-01T00:00:00.000Z"
    }, 
    {
      "@id": "[user-id]",
      "@type": "Worker"
    }, 
    {
      "@id": "[message-id]",
      "@type": "MessageStanza",
    },
    {
      "@id": "3bb3c9ba-d26f-44bd-a007-fe6c3574789f",
      "@type": "Chat",
      "participants": [
        {
          "@id": "0794c1d2-3cd6-4587-8e66-bcc27ba368c1",
          "@type": "ServiceUser"
        }
      ],
      "moderators": [
        {
          "@id": "d682ed3f-dbce-41eb-bf2d-e5fc56dc9db1",
          "@type": "Worker"
        }
      ],
      "timer": {
        "startTime": "2018-04-27T13:00:13.006Z"
      },
      "status": {
        "@id": "Active",
        "@type": "ConversationStatus"
      },
      "application": {
        "@id": "645d38b7-1105-40d5-b1e6-17cf17d430ce",
        "@type": "Application"
      }
    }
  ]
}

          
Status code: 400
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity is invalid - [actual information]"
    
    }
		
          
Status code: 401
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The requested resource requires authorization"
    
    }
		
          
Status code: 403
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "You are not authorized to access the resource"
    
    }
		
          
Status code: 404
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity was not found - [actual information]"
    
    }
		
          
Status code: 500
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "Server error - [actual information]"
    
    }
		
          

Emits

MessagePreparedEvent
Path: null
Method: null
Body

            
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@graph": [
    {
      "@id": "[event-id]",
      "@type": "MessagePreparedEvent",
      "causedBy": "commands/[command-id]",
      "atTime": "2018-01-01T00:00:00.000Z"
    }, 
    {
      "@id": "[user-id]",
      "@type": "Worker"
    }, 
    {
      "@id": "[message-id]",
      "@type": "MessageStanza",
    },
    {
      "@id": "3bb3c9ba-d26f-44bd-a007-fe6c3574789f",
      "@type": "Chat",
      "participants": [
        {
          "@id": "0794c1d2-3cd6-4587-8e66-bcc27ba368c1",
          "@type": "ServiceUser"
        }
      ],
      "moderators": [
        {
          "@id": "d682ed3f-dbce-41eb-bf2d-e5fc56dc9db1",
          "@type": "Worker"
        }
      ],
      "timer": {
        "startTime": "2018-04-27T13:00:13.006Z"
      },
      "status": {
        "@id": "Active",
        "@type": "ConversationStatus"
      },
      "application": {
        "@id": "645d38b7-1105-40d5-b1e6-17cf17d430ce",
        "@type": "Application"
      }
    }
  ]
}

          

[#] [back to top]

StartTimer

Sets the start time of a chat

Path /messaging/chats/[chat-id]/timer
Method POST
Headers
Authorization: JWT
Accepts: application/json+ld
Content-Type: application/json+ld
Query Parameters
Request Body
        
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@type": "Chat",
  "startTime": "2018-01-01T00:00:00.000Z"
}

      
Constraints
http://vocabularies.xenzone.com/xcp-api/0.0.1/StartTimer.schema.json
        
{
  "type": "object",
  "properties": {
    "startTime": {
      "type": "string",
      "format": "date-time"
    },
    "endTime": {
      "type": "string",
      "format": "date-time"
    }
  }
}

      

Responses

Status code: 200
Response Headers
Response Body
            
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@graph": [
    {
      "@id": "[event-id]",
      "@type": "ChatTimerStartedEvent",
      "causedBy": "commands/[command-id]",
      "atTime": "2018-01-01T00:00:00.000Z"
    }, 
    {
      "@id": "3bb3c9ba-d26f-44bd-a007-fe6c3574789f",
      "@type": "Chat",
      "participants": [
        {
          "@id": "0794c1d2-3cd6-4587-8e66-bcc27ba368c1",
          "@type": "ServiceUser"
        }
      ],
      "moderators": [
        {
          "@id": "d682ed3f-dbce-41eb-bf2d-e5fc56dc9db1",
          "@type": "Worker"
        }
      ],
      "timer": {
        "startTime": "2018-04-27T13:00:13.006Z"
      },
      "status": {
        "@id": "Active",
        "@type": "ConversationStatus"
      },
      "application": {
        "@id": "645d38b7-1105-40d5-b1e6-17cf17d430ce",
        "@type": "Application"
      }
    }
  ]
}

          
Status code: 400
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity is invalid - [actual information]"
    
    }
		
          
Status code: 401
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The requested resource requires authorization"
    
    }
		
          
Status code: 403
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "You are not authorized to access the resource"
    
    }
		
          
Status code: 404
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity was not found - [actual information]"
    
    }
		
          
Status code: 500
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "Server error - [actual information]"
    
    }
		
          

Emits

ChatTimerStartedEvent
Path: null
Method: null
Body

            
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@graph": [
    {
      "@id": "[event-id]",
      "@type": "ChatTimerStartedEvent",
      "causedBy": "commands/[command-id]",
      "atTime": "2018-01-01T00:00:00.000Z"
    }, 
    {
      "@id": "3bb3c9ba-d26f-44bd-a007-fe6c3574789f",
      "@type": "Chat",
      "participants": [
        {
          "@id": "0794c1d2-3cd6-4587-8e66-bcc27ba368c1",
          "@type": "ServiceUser"
        }
      ],
      "moderators": [
        {
          "@id": "d682ed3f-dbce-41eb-bf2d-e5fc56dc9db1",
          "@type": "Worker"
        }
      ],
      "timer": {
        "startTime": "2018-04-27T13:00:13.006Z"
      },
      "status": {
        "@id": "Active",
        "@type": "ConversationStatus"
      },
      "application": {
        "@id": "645d38b7-1105-40d5-b1e6-17cf17d430ce",
        "@type": "Application"
      }
    }
  ]
}

          

[#] [back to top]

Signposting service

CreateAgency

A command to create a new agency in an asg.

Path /agencies
Method POST
Headers
Authorization: JWT
Accepts: application/json+ld
Content-Type: application/json+ld
Query Parameters
Request Body
        
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@type": "Agency",
  "organisation": "City of London Police",
  "address": "12 Norrice Avenue, SW3 58T",
  "details": "The City of London Police is responsible for law enforcement within the City of London",
  "categories": [
    {
      "@type": "AgencyCategory",
      "@id": "Advocacy",
    }
  ],
  "contact": {
    "@type": "AgencyContact",
    "name": "Hans Gruber",
    "telephoneNumber": "+442075673810",
  },
  "areas": [
    {
      "@type": "AgencyArea",
      "@id": "Wirral",
    }
  ]
}
    
      
Constraints
http://vocabularies.xenzone.com/xcp-api/0.0.1/CreateAgency.schema.json
        
{
  "title": "CreateAgency",
  "type": "object",
  "properties" {
    "@context": {
      "type": "string"
    },
    "@type": {
      "type": "string"
    },
    "organisation": {
      "type": "string",
    },
    "address": {
      "type": "string",
    },
    "details": {
      "type": "string",
    },
    "categories": {
      "type": "array",
      "items": {
        "type": "object",
        "properties" {
          "@type": {
            "type": "string"
          },
          "@id": {
            "type": "string",
            "enum": [
              "AdultServices",
              "Advocacy",
              "BullyingServices",
              "BereavementServices",
              "Camhs",
              "ChildrenSServices",
              "ChildProtection",
              "CrisisServices",
              "CounsellingAndTherapy",
              "CommunitySupportGroups",
              "ChildSexualExploitation",
              "DrugAndAlcoholServices",
              "DisabilityServices",
              "DomesticAbuse",
              "EducationWorkAndTraining",
              "FamilyServices",
              "ForcedMarriage",
              "Fgm",
              "HealthAndWelbeingServices",
              "HousingAndHomelessness",
              "Iapt",
              "InformationAdviceAndGuidance",
              "KoothF2FCounselling",
              "LgbtqServices",
              "LookedAfterChildren",
              "MentalHealthSupportServices",
              "OnlineSupportServices",
              "OnlineSafety",
              "ParentingServices",
              "PositiveActivitiesGroups",
              "PoliceServices",
              "RacismAndInequality",
              "Radicalisation",
              "StayingSafe",
              "Sen",
              "SexualHealthAndRelationships",
              "SocialCare",
              "TargettedYouthSupport",
              "VolunteeringServices",
              "VictimSupport",
              "YouthWorkServices",
              "YoungCarers",
              "YouthJusticeOffending",
              "Uncategorised"
            ]
          }
        }
      },
      "required": [
        "@type",
        "@id"
      ]
    },
    "contact": {
      "type": "object",
      "properties": {
        "@type": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "telephoneNumber": {
          "pattern": "^\+[1-9]\d{1,14}$",
          "type": "string"
        },
        "required": [
          "@type",
          "name",
          "telephoneNumber",
        ],
      },
    "areas": {
      "type": "array",
      "items": {
        "type": "object",
        "properties" {
          "@type": {
            "type": "string"
          },
          "@id": {
            "type": "string",
            "enum": [
              "Knowsley",
              "Wirral",
              "Powys",
              "Cardiff",
              "Oldham",
              "CheshireEast",
              "Dudley",
              "Lincolnshire",
              "Cornwall",
              "Walsall",
              "NottinghamCity",
              "WestSussex",
              "Sandwell",
              "Cumbria",
              "Lewisham",
              "Bracknell",
              "Halton",
              "Devon",
              "Leicestershire",
              "Wakefield",
              "Hertfordshire",
              "Slough",
              "WindsorAndMaidenhead",
              "Warrington",
              "Rochdale",
              "Wiltshire",
              "BathAndNorthEastSomerset",
              "Surrey",
              "Manchester",
              "Plymouth",
              "Bristol",
              "BarkingAndDagenham",
              "CambridgeshireAndPeterborough",
              "Worcestershire",
              "LincolnshireNorthEast",
              "Nottinghamshire",
              "TelfordAndWrekin",
              "KingstonUponThames",
              "Shropshire",
              "Somerset",
              "Barnet",
              "Redbridge",
              "Calderdale",
              "Havering",
              "Westminster",
              "KensingtonAndChelsea",
              "HammersmithAndFulham",
              "KentSwale",
              "KentGravesham",
              "ManchesterTrafford",
              "Rootcapital",
              "UniversityOfWestEngland",
              "Essex",
              "Windleborough",
              "Solihull",
              "KentAshford",
              "KentCanterbury",
              "KentShepway",
              "Swindon",
              "Bolton",
              "NorthTyneside",
              "SomersetNorth",
              "Wolverhampton"
            ]
          }
        }
      },
      "required": [
        "@type",
        "@id"
      ]
    }
  },
  "required": [
    "@type",
    "organisation",
    "address",
    "details",
    "categories",
    "contact",
    "areas",
  ],
}
  
      

Responses

Status code: 201
Response Headers
Response Body
            
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@graph": [
    {
      "@id": "[event-id]",
      "@type": "AgencyCreatedEvent",
      "atTime": "2018-01-10T16:56:15Z",
      "causedBy": "commands/[command-uuid]"
    },
    {
      "@id": "[agency-id]",
      "@type": "Agency",
      "organisation": "City of London Police",
      "address": "12 Norrice Avenue, SW3 58T",
      "details": "The City of London Police is responsible for law enforcement within the City of London",
      "categories": [
        {
          "@type": "AgencyCategory",
          "@id": "Advocacy",
        }
      ],
      "contact": {
        "@type": "AgencyContact",
        "name": "Hans Gruber",
        "telephoneNumber": "+442075673810",
      },
      "areas": [
        {
          "@type": "AgencyArea",
          "@id": "Wirral",
        }
      ]
    }
  ]
}

          
Status code: 400
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity is invalid - [actual information]"
    
    }
		
          
Status code: 401
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The requested resource requires authorization"
    
    }
		
          
Status code: 403
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "You are not authorized to access the resource"
    
    }
		
          
Status code: 409
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity conflicts with an pre-existing entity - [actual information]"
    
    }
		
          
Status code: 500
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "Server error - [actual information]"
    
    }
		
          

Emits

AgencyCreatedEvent
Path: null
Method: null
Body

            
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@graph": [
    {
      "@id": "[event-id]",
      "@type": "AgencyCreatedEvent",
      "atTime": "2018-01-10T16:56:15Z",
      "causedBy": "commands/[command-uuid]"
    },
    {
      "@id": "[agency-id]",
      "@type": "Agency",
      "organisation": "City of London Police",
      "address": "12 Norrice Avenue, SW3 58T",
      "details": "The City of London Police is responsible for law enforcement within the City of London",
      "categories": [
        {
          "@type": "AgencyCategory",
          "@id": "Advocacy",
        }
      ],
      "contact": {
        "@type": "AgencyContact",
        "name": "Hans Gruber",
        "telephoneNumber": "+442075673810",
      },
      "areas": [
        {
          "@type": "AgencyArea",
          "@id": "Wirral",
        }
      ]
    }
  ]
}

          

[#] [back to top]

GetAgencies

A command to get agencies

Path /agencies
Method GET
Headers
Authorization: JWT
Accepts: application/json+ld
Content-Type: application/json+ld
Query Parameters
category: Agency Category list to search for
area: Agency Area list to search for
organisation: Wildcard search using organisation name
perPage: number of results per page

Responses

Status code: 200
Response Headers
Response Body
            {
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Collection",
    "results": [
      {
        "@id": "[agency-id]",
        "@type": "Agency",
        "organisation": "City of London Police",
        "address": "12 Norrice Avenue, SW3 58T",
        "details": "The City of London Police is responsible for law enforcement within the City of London",
        "categories": [
          {
            "@type": "AgencyCategory",
            "@id": "Advocacy",
          }
        ],
        "contact": {
          "@type": "AgencyContact",
          "name": "Hans Gruber",
          "telephoneNumber": "+442075673810",
        },
        "areas": [
          {
            "@type": "AgencyArea",
            "@id": "Wirral",
          }
        ]
      }
    ],
    "pagination": {
      "currentPage": 5,
      "perPage": 20,
      "total": 521
    }
  }
          
Status code: 400
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity is invalid - [actual information]"
    
    }
		
          
Status code: 401
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The requested resource requires authorization"
    
    }
		
          
Status code: 403
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "You are not authorized to access the resource"
    
    }
		
          
Status code: 500
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "Server error - [actual information]"
    
    }
		
          

Emits

[#] [back to top]

GetAgency

A command to get an agency

Path /agencies/[agency-id]
Method GET
Headers
Authorization: JWT
Accepts: application/json+ld
Content-Type: application/json+ld
Query Parameters

Responses

Status code: 200
Response Headers
Response Body
            
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@id": "[agency-id]",
  "@type": "Agency",
  "organisation": "City of London Police",
  "address": "12 Norrice Avenue, SW3 58T",
  "details": "The City of London Police is responsible for law enforcement within the City of London",
  "categories": [
    {
      "@type": "AgencyCategory",
      "@id": "Advocacy",
    }
  ],
  "contact": {
    "@type": "AgencyContact",
    "name": "Hans Gruber",
    "telephoneNumber": "+442075673810",
  },
  "areas": [
    {
      "@type": "AgencyArea",
      "@id": "Wirral",
    }
  ]
}
    
          
Status code: 400
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity is invalid - [actual information]"
    
    }
		
          
Status code: 401
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The requested resource requires authorization"
    
    }
		
          
Status code: 403
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "You are not authorized to access the resource"
    
    }
		
          
Status code: 500
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "Server error - [actual information]"
    
    }
		
          

Emits

[#] [back to top]

GetAgencyAreas

A command to get agency areas

Path /areas
Method GET
Headers
Authorization: JWT
Accepts: application/json+ld
Content-Type: application/json+ld
Query Parameters
perPage: number of results per page

Responses

Status code: 200
Response Headers
Response Body
            {
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Collection",
    "results": [
      {
        "@id": "Wirral",
        "@type": "AgencyArea"
      }
    ],
    "pagination": {
      "currentPage": 5,
      "perPage": 20,
      "total": 521
    }
  }
          
Status code: 400
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity is invalid - [actual information]"
    
    }
		
          
Status code: 401
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The requested resource requires authorization"
    
    }
		
          
Status code: 403
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "You are not authorized to access the resource"
    
    }
		
          
Status code: 500
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "Server error - [actual information]"
    
    }
		
          

Emits

[#] [back to top]

GetAgencyCategories

A command to get agency categories

Path /agency-categories
Method GET
Headers
Authorization: JWT
Accepts: application/json+ld
Content-Type: application/json+ld
Query Parameters
perPage: number of results per page

Responses

Status code: 400
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity is invalid - [actual information]"
    
    }
		
          
Status code: 401
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The requested resource requires authorization"
    
    }
		
          
Status code: 403
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "You are not authorized to access the resource"
    
    }
		
          
Status code: 500
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "Server error - [actual information]"
    
    }
		
          

Emits

[#] [back to top]

UpdateAgency

A command to update an agency in an ASG

Path /agencies/[agency-id]/
Method PUT
Headers
Query Parameters
Request Body
        
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@type": "Agency",
  "organisation": "City of London Police",
  "address": "12 Norrice Avenue, SW3 58T",
  "details": "The City of London Police is responsible for law enforcement within the City of London",
  "categories": [
    {
      "@type": "AgencyCategory",
      "@id": "Advocacy",
    }
  ],
  "contact": {
    "@type": "AgencyContact",
    "name": "Hans Gruber",
    "telephoneNumber": "+442075673810",
  },
  "areas": [
    {
      "@type": "AgencyArea",
      "@id": "Wirral",
    }
  ]
}
    
      
Constraints
http://vocabularies.xenzone.com/xcp-api/0.0.1/UpdateAgency.schema.json
        
{
  "title": "UpdateAgency",
  "type": "object",
  "properties" {
    "@context": {
      "type": "string"
    },
    "@type": {
      "type": "string"
    },
    "organisation": {
      "type": "string",
    },
    "address": {
      "type": "string",
    },
    "details": {
      "type": "string",
    },
    "categories": {
      "type": "array",
      "items": {
        "type": "object",
        "properties" {
          "@type": {
            "type": "string"
          },
          "@id": {
            "type": "string",
            "enum": [
              "AdultServices",
              "Advocacy",
              "BullyingServices",
              "BereavementServices",
              "Camhs",
              "ChildrenSServices",
              "ChildProtection",
              "CrisisServices",
              "CounsellingAndTherapy",
              "CommunitySupportGroups",
              "ChildSexualExploitation",
              "DrugAndAlcoholServices",
              "DisabilityServices",
              "DomesticAbuse",
              "EducationWorkAndTraining",
              "FamilyServices",
              "ForcedMarriage",
              "Fgm",
              "HealthAndWelbeingServices",
              "HousingAndHomelessness",
              "Iapt",
              "InformationAdviceAndGuidance",
              "KoothF2FCounselling",
              "LgbtqServices",
              "LookedAfterChildren",
              "MentalHealthSupportServices",
              "OnlineSupportServices",
              "OnlineSafety",
              "ParentingServices",
              "PositiveActivitiesGroups",
              "PoliceServices",
              "RacismAndInequality",
              "Radicalisation",
              "StayingSafe",
              "Sen",
              "SexualHealthAndRelationships",
              "SocialCare",
              "TargettedYouthSupport",
              "VolunteeringServices",
              "VictimSupport",
              "YouthWorkServices",
              "YoungCarers",
              "YouthJusticeOffending",
              "Uncategorised"
            ]
          }
        }
      },
      "required": [
        "@type",
        "@id"
      ]
    },
    "contact": {
      "type": "object",
      "properties": {
        "@type": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "telephoneNumber": {
          "pattern": "^\+[1-9]\d{1,14}$",
          "type": "string"
        },
        "required": [
          "@type",
          "name",
          "telephoneNumber",
        ],
      },
    "areas": {
      "type": "array",
      "items": {
        "type": "object",
        "properties" {
          "@type": {
            "type": "string"
          },
          "@id": {
            "type": "string",
            "enum": [
              "Knowsley",
              "Wirral",
              "Powys",
              "Cardiff",
              "Oldham",
              "CheshireEast",
              "Dudley",
              "Lincolnshire",
              "Cornwall",
              "Walsall",
              "NottinghamCity",
              "WestSussex",
              "Sandwell",
              "Cumbria",
              "Lewisham",
              "Bracknell",
              "Halton",
              "Devon",
              "Leicestershire",
              "Wakefield",
              "Hertfordshire",
              "Slough",
              "WindsorAndMaidenhead",
              "Warrington",
              "Rochdale",
              "Wiltshire",
              "BathAndNorthEastSomerset",
              "Surrey",
              "Manchester",
              "Plymouth",
              "Bristol",
              "BarkingAndDagenham",
              "CambridgeshireAndPeterborough",
              "Worcestershire",
              "LincolnshireNorthEast",
              "Nottinghamshire",
              "TelfordAndWrekin",
              "KingstonUponThames",
              "Shropshire",
              "Somerset",
              "Barnet",
              "Redbridge",
              "Calderdale",
              "Havering",
              "Westminster",
              "KensingtonAndChelsea",
              "HammersmithAndFulham",
              "KentSwale",
              "KentGravesham",
              "ManchesterTrafford",
              "Rootcapital",
              "UniversityOfWestEngland",
              "Essex",
              "Windleborough",
              "Solihull",
              "KentAshford",
              "KentCanterbury",
              "KentShepway",
              "Swindon",
              "Bolton",
              "NorthTyneside",
              "SomersetNorth",
              "Wolverhampton"
            ]
          }
        }
      },
      "required": [
        "@type",
        "@id"
      ]
    }
  },
  "required": [
    "@type",
    "organisation",
    "address",
    "details",
    "categories",
    "contact",
    "areas",
  ],
}
  
      

Responses

Status code: 200
Response Headers
Response Body
            
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@graph": [
    {
      "@id": "[event-id]",
      "@type": "AgencyUpdatedEvent",
      "atTime": "2018-01-10T16:56:15Z",
      "causedBy": "commands/[command-uuid]"
    },
    {
      "@id": "[agency-id]",
      "@type": "Agency",
      "organisation": "City of London Police",
      "address": "12 Norrice Avenue, SW3 58T",
      "details": "The City of London Police is responsible for law enforcement within the City of London",
      "categories": [
        {
          "@type": "AgencyCategory",
          "id": "Advocacy",
        }
      ],
      "contact": {
        "@type": "AgencyContact",
        "name": "Hans Gruber",
        "telephoneNumber": "+442075673810",
      },
      "areas": [
        {
          "@type": "AgencyArea",
          "@id": "Wirral",
        }
      ]
    }
  ]
}

          
Status code: 400
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity is invalid - [actual information]"
    
    }
		
          
Status code: 401
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The requested resource requires authorization"
    
    }
		
          
Status code: 403
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "You are not authorized to access the resource"
    
    }
		
          
Status code: 409
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "The request entity conflicts with an pre-existing entity - [actual information]"
    
    }
		
          
Status code: 500
Response Headers
Response Body
            
		{
    "@context": "https://vocabularies.xenzone.com/context.jsonld",
    "@type": "Error",
    "title": "An error occurred",
    "description": "Server error - [actual information]"
    
    }
		
          

Emits

AgencyCreatedEvent
Path: null
Method: null
Body

            
{
  "@context": "https://vocabularies.xenzone.com/context.jsonld",
  "@graph": [
    {
      "@id": "[event-id]",
      "@type": "AgencyCreatedEvent",
      "atTime": "2018-01-10T16:56:15Z",
      "causedBy": "commands/[command-uuid]"
    },
    {
      "@id": "[agency-id]",
      "@type": "Agency",
      "organisation": "City of London Police",
      "address": "12 Norrice Avenue, SW3 58T",
      "details": "The City of London Police is responsible for law enforcement within the City of London",
      "categories": [
        {
          "@type": "AgencyCategory",
          "@id": "Advocacy",
        }
      ],
      "contact": {
        "@type": "AgencyContact",
        "name": "Hans Gruber",
        "telephoneNumber": "+442075673810",
      },
      "areas": [
        {
          "@type": "AgencyArea",
          "@id": "Wirral",
        }
      ]
    }
  ]
}

          

[#] [back to top]

Xmpp Service

SendXMPPMessage

Sends a message to a multi-user chat room using XMPP

Path
Method
Headers
Query Parameters
Request Body
        
<message
  from="hag66@shakespeare.lit/pda"
  id="hysf1v37"
  to="coven@chat.shakespeare.lit"
  type="groupchat">
  <body>Harpier cries: 'tis time, 'tis time.</body>
</message>

      

Responses

Emits

[#] [back to top]