Complete survey and calculate result
PUT/surveys/sessions/:token
Completes the survey and gives back result
Request
Path Parameters
The token identifying this session
Responses
- 200
- 400
- 401
- 403
- 405
- 500
Result object containing info about the survey result
- application/json
- Schema
- Example (from schema)
Schema
Array [
Array [
]
]
The total emission based on the answers of the survey
Human readable representation of your climate profile category
description
object
required
Copy about the climate profile
meta
object
required
Session and meta information used by the server. Should be sent with every request to server
Percentage of the questionnaire that is already answered
Sum of all emissions up until now
sectors
object[]
required
Distribution of emissions per sector
Possible values: [transport
, lifestyle
, diet
, home
, publicservices
, intro
, personal
, summary
]
sectorDetails
object[]
required
progress
object
Represents the current progress in a certain area:
example:
{
name: 'transport', // Area
count: 10, // Number of answered questions
total: 20, // Total number of question in area
progress: 0.5 // 50% answered
}
Name of the area
No of answered questions in area
Total number of questions in area
Progress percentage
Total number of questions
Index of current question
{
"totalEmissionInYear": 0,
"yourClimateProfile": "string",
"description": {
"title": "string",
"body": "string"
},
"meta": {
"percentage": 0,
"totalEmissions": 0,
"sectors": [
{
"emissions": 0,
"id": "transport",
"name": "string",
"sectorDetails": [
{
"emissions": 0,
"id": "string",
"name": "string"
}
],
"progress": {
"name": "string",
"count": 0,
"total": 0,
"progress": 0
}
}
],
"numberOfQuestions": 0,
"currentQuestionIndex": 0
}
}
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"
}
]
}