Start a new survey session or restart a current one
POST/surveys/sessions
Creates a survey session token, which is returned back to the client along with the id of the first question for this survey
Request
- application/json
Body
required
The start survey request
ISO 639-1: two-letter code, defaults to en
Optional token to identify this session. Will be auto-generated if omitted
Resets the answered survey if true
Possible values: [transport
, lifestyle
, diet
, home
, publicservices
, intro
, personal
, summary
]
If a specific sector-specific questionnaire is to be created with this session.
Responses
- 200
- 400
- 401
- 403
- 405
- 500
Returns a newly created token to be used throughout to identify the session in subsequent requests along with the id of the first question to be answered
- application/json
- Schema
- Example (from schema)
Schema
Token identifying this session
The first unanswered question in the questionnaire
Boolean indicating if survey is complete
{
"token": "string",
"firstQuestionId": "string",
"isComplete": true
}
Bad Request
- application/json
- Schema
- Example (from schema)
Schema
Array [
]
errors
object[]
required
Detailed errors
The application name that generated this error
Possible values: [BAD_REQUEST
, FORBIDDEN
, INTERNAL_SERVER_ERROR
, METHOD_NOT_ALLOWED
, UNSUPPORTED_MEDIA_TYPE
]
A unique constant identifying the error case encountered during request processing
BAD_REQUEST
- Malformed request, please advice the description
and details fields for more information
FORBIDDEN
- Insufficient scope to access the resource
INTERNAL_SERVER_ERROR
- Unexpected server error
METHOD_NOT_ALLOWED
- Method not allowed
UNSUPPORTED_MEDIA_TYPE
- Unsupported media type
Short description of the reasonCode field.
Indicates whether this error will always be returned for this request, or retrying could change the outcome.
Where appropriate, indicates detailed information about data received and calculated during request processing, to help the user with diagnosing errors.
{
"errors": [
{
"source": "string",
"reasonCode": "BAD_REQUEST",
"description": "string",
"recoverable": true,
"details": "string"
}
]
}
Unauthorized client
- application/json
- Schema
- Example (from schema)
Schema
Array [
]
errors
object[]
required
Detailed errors
The application name that generated this error
Possible values: [BAD_REQUEST
, FORBIDDEN
, INTERNAL_SERVER_ERROR
, METHOD_NOT_ALLOWED
, UNSUPPORTED_MEDIA_TYPE
]
A unique constant identifying the error case encountered during request processing
BAD_REQUEST
- Malformed request, please advice the description
and details fields for more information
FORBIDDEN
- Insufficient scope to access the resource
INTERNAL_SERVER_ERROR
- Unexpected server error
METHOD_NOT_ALLOWED
- Method not allowed
UNSUPPORTED_MEDIA_TYPE
- Unsupported media type
Short description of the reasonCode field.
Indicates whether this error will always be returned for this request, or retrying could change the outcome.
Where appropriate, indicates detailed information about data received and calculated during request processing, to help the user with diagnosing errors.
{
"errors": [
{
"source": "string",
"reasonCode": "BAD_REQUEST",
"description": "string",
"recoverable": true,
"details": "string"
}
]
}
Insufficient scope for accessing this resource
- application/json
- Schema
- Example (from schema)
Schema
Array [
]
errors
object[]
required
Detailed errors
The application name that generated this error
Possible values: [BAD_REQUEST
, FORBIDDEN
, INTERNAL_SERVER_ERROR
, METHOD_NOT_ALLOWED
, UNSUPPORTED_MEDIA_TYPE
]
A unique constant identifying the error case encountered during request processing
BAD_REQUEST
- Malformed request, please advice the description
and details fields for more information
FORBIDDEN
- Insufficient scope to access the resource
INTERNAL_SERVER_ERROR
- Unexpected server error
METHOD_NOT_ALLOWED
- Method not allowed
UNSUPPORTED_MEDIA_TYPE
- Unsupported media type
Short description of the reasonCode field.
Indicates whether this error will always be returned for this request, or retrying could change the outcome.
Where appropriate, indicates detailed information about data received and calculated during request processing, to help the user with diagnosing errors.
{
"errors": [
{
"source": "string",
"reasonCode": "BAD_REQUEST",
"description": "string",
"recoverable": true,
"details": "string"
}
]
}
Method not allowed
- application/json
- Schema
- Example (from schema)
Schema
Array [
]
errors
object[]
required
Detailed errors
The application name that generated this error
Possible values: [BAD_REQUEST
, FORBIDDEN
, INTERNAL_SERVER_ERROR
, METHOD_NOT_ALLOWED
, UNSUPPORTED_MEDIA_TYPE
]
A unique constant identifying the error case encountered during request processing
BAD_REQUEST
- Malformed request, please advice the description
and details fields for more information
FORBIDDEN
- Insufficient scope to access the resource
INTERNAL_SERVER_ERROR
- Unexpected server error
METHOD_NOT_ALLOWED
- Method not allowed
UNSUPPORTED_MEDIA_TYPE
- Unsupported media type
Short description of the reasonCode field.
Indicates whether this error will always be returned for this request, or retrying could change the outcome.
Where appropriate, indicates detailed information about data received and calculated during request processing, to help the user with diagnosing errors.
{
"errors": [
{
"source": "string",
"reasonCode": "BAD_REQUEST",
"description": "string",
"recoverable": true,
"details": "string"
}
]
}
Unexpected server error
- application/json
- Schema
- Example (from schema)
Schema
Array [
]
errors
object[]
required
Detailed errors
The application name that generated this error
Possible values: [BAD_REQUEST
, FORBIDDEN
, INTERNAL_SERVER_ERROR
, METHOD_NOT_ALLOWED
, UNSUPPORTED_MEDIA_TYPE
]
A unique constant identifying the error case encountered during request processing
BAD_REQUEST
- Malformed request, please advice the description
and details fields for more information
FORBIDDEN
- Insufficient scope to access the resource
INTERNAL_SERVER_ERROR
- Unexpected server error
METHOD_NOT_ALLOWED
- Method not allowed
UNSUPPORTED_MEDIA_TYPE
- Unsupported media type
Short description of the reasonCode field.
Indicates whether this error will always be returned for this request, or retrying could change the outcome.
Where appropriate, indicates detailed information about data received and calculated during request processing, to help the user with diagnosing errors.
{
"errors": [
{
"source": "string",
"reasonCode": "BAD_REQUEST",
"description": "string",
"recoverable": true,
"details": "string"
}
]
}