A DELETE saved-page/:page_path request given there is a valid user session, with /guidance/some-govuk-guidance saved
A GET saved-page/:page_path request given there is a valid user session, with /guidance/some-govuk-guidance saved
A GET saved_pages request given there is a valid user session
A GET saved_pages request given there is a valid user session, with saved pages
A get-attributes request given there is a valid user session
A get-attributes request given there is a valid user session, with an attribute called 'foo'
A get-attributes-names request given there is a valid user session
A get-attributes-names request given there is a valid user session, with an attribute called 'foo'
A get-user request given there is a valid user session
A get-user request given there is a valid user session, with /guidance/some-govuk-guidance saved
A has-subscription request given there is a valid user session
A has-subscription request given there is a valid user session, with a transition checker email subscription
A PUT saved-page/:page_path request given there is a valid user session
A set-attributes request given there is a valid user session
A set-subscription request given there is a valid user session
A validation request given there is a valid OAuth response
A validation request given there is a valid OAuth response, with the redirect path '/some-arbitrary-path'
Upon receiving a create-state request from GDS API Adapters, with
{
"method": "post",
"path": "/api/oauth2/state",
"headers": {
"Accept": "application/json",
"User-Agent": "gds-api-adapters/71.2.0 ()",
"Content-Type": "application/json"
},
"body": {
"attributes": {
"foo": "bar"
}
}
}
Account API will respond with:
{
"status": 200,
"headers": {
"Content-Type": "application/json; charset=utf-8"
},
"body": {
"state_id": "reference-to-pass-to-get_sign_in_url"
}
}
Given there is a valid user session, with /guidance/some-govuk-guidance saved, upon receiving a DELETE saved-page/:page_path request from GDS API Adapters, with
{
"method": "delete",
"path": "/api/saved_pages/%2Fguidance%2Fsome-govuk-guidance",
"headers": {
"Accept": "application/json",
"User-Agent": "gds-api-adapters/71.2.0 ()",
"GOVUK-Account-Session": "logged-in-user-session"
}
}
Account API will respond with:
{
"status": 204
}
Given there is a valid user session, with /guidance/some-govuk-guidance saved, upon receiving a GET saved-page/:page_path request from GDS API Adapters, with
{
"method": "get",
"path": "/api/saved_pages/%2Fguidance%2Fsome-govuk-guidance",
"headers": {
"Accept": "application/json",
"User-Agent": "gds-api-adapters/71.2.0 ()",
"GOVUK-Account-Session": "logged-in-user-session"
}
}
Account API will respond with:
{
"status": 200,
"headers": {
"Content-Type": "application/json; charset=utf-8"
},
"body": {
"govuk_account_session": "user-session-id",
"saved_page": {
"page_path": "/guidance/some-govuk-guidance",
"content_id": "6e0e144a-9e59-4ac8-af3b-d87e8ff30a47",
"title": "Some GOV.UK Guidance"
}
}
}
Given there is a valid user session, upon receiving a GET saved_pages request from GDS API Adapters, with
{
"method": "get",
"path": "/api/saved_pages",
"headers": {
"Accept": "application/json",
"User-Agent": "gds-api-adapters/71.2.0 ()",
"GOVUK-Account-Session": "logged-in-user-session"
}
}
Account API will respond with:
{
"status": 200,
"headers": {
"Content-Type": "application/json; charset=utf-8"
},
"body": {
"govuk_account_session": "user-session-id",
"saved_pages": [
]
}
}
Given there is a valid user session, with saved pages, upon receiving a GET saved_pages request from GDS API Adapters, with
{
"method": "get",
"path": "/api/saved_pages",
"headers": {
"Accept": "application/json",
"User-Agent": "gds-api-adapters/71.2.0 ()",
"GOVUK-Account-Session": "logged-in-user-session"
}
}
Account API will respond with:
{
"status": 200,
"headers": {
"Content-Type": "application/json; charset=utf-8"
},
"body": {
"govuk_account_session": "user-session-id",
"saved_pages": [
{
"page_path": "/page-path/1",
"content_id": "7b7b77b0-257a-467d-84c9-c5167781d05c",
"title": "Page #1"
},
{
"page_path": "/page-path/2",
"content_id": "7b7b77b0-257a-467d-84c9-c5167781d05c",
"title": "Page #1"
}
]
}
}
Given there is a valid user session, upon receiving a get-attributes request from GDS API Adapters, with
{
"method": "get",
"path": "/api/attributes",
"query": "attributes[]=foo",
"headers": {
"Accept": "application/json",
"User-Agent": "gds-api-adapters/71.2.0 ()",
"GOVUK-Account-Session": "logged-in-user-session"
}
}
Account API will respond with:
{
"status": 200,
"headers": {
"Content-Type": "application/json; charset=utf-8"
},
"body": {
"govuk_account_session": "user-session-id",
"values": {
}
}
}
Given there is a valid user session, with an attribute called 'foo', upon receiving a get-attributes request from GDS API Adapters, with
{
"method": "get",
"path": "/api/attributes",
"query": "attributes[]=foo",
"headers": {
"Accept": "application/json",
"User-Agent": "gds-api-adapters/71.2.0 ()",
"GOVUK-Account-Session": "logged-in-user-session"
}
}
Account API will respond with:
{
"status": 200,
"headers": {
"Content-Type": "application/json; charset=utf-8"
},
"body": {
"govuk_account_session": "user-session-id",
"values": {
"foo": {
"bar": "baz"
}
}
}
}
Given there is a valid user session, upon receiving a get-attributes-names request from GDS API Adapters, with
{
"method": "get",
"path": "/api/attributes/names",
"query": "attributes[]=foo",
"headers": {
"Accept": "application/json",
"User-Agent": "gds-api-adapters/71.2.0 ()",
"GOVUK-Account-Session": "logged-in-user-session"
}
}
Account API will respond with:
{
"status": 200,
"headers": {
"Content-Type": "application/json; charset=utf-8"
},
"body": {
"govuk_account_session": "user-session-id",
"values": [
]
}
}
Given there is a valid user session, with an attribute called 'foo', upon receiving a get-attributes-names request from GDS API Adapters, with
{
"method": "get",
"path": "/api/attributes/names",
"query": "attributes[]=foo",
"headers": {
"Accept": "application/json",
"User-Agent": "gds-api-adapters/71.2.0 ()",
"GOVUK-Account-Session": "logged-in-user-session"
}
}
Account API will respond with:
{
"status": 200,
"headers": {
"Content-Type": "application/json; charset=utf-8"
},
"body": {
"govuk_account_session": "user-session-id",
"values": [
"foo"
]
}
}
Given there is a valid user session, upon receiving a get-user request from GDS API Adapters, with
{
"method": "get",
"path": "/api/user",
"headers": {
"Accept": "application/json",
"User-Agent": "gds-api-adapters/71.2.0 ()",
"GOVUK-Account-Session": "logged-in-user-session"
}
}
Account API will respond with:
{
"status": 200,
"headers": {
"Content-Type": "application/json; charset=utf-8"
},
"body": {
"govuk_account_session": "user-session-id",
"level_of_authentication": "level0",
"email": "user@example.com",
"email_verified": true,
"services": {
"transition_checker": "no",
"saved_pages": "no"
}
}
}
Given there is a valid user session, with /guidance/some-govuk-guidance saved, upon receiving a get-user request from GDS API Adapters, with
{
"method": "get",
"path": "/api/user",
"headers": {
"Accept": "application/json",
"User-Agent": "gds-api-adapters/71.2.0 ()",
"GOVUK-Account-Session": "logged-in-user-session"
}
}
Account API will respond with:
{
"status": 200,
"headers": {
"Content-Type": "application/json; charset=utf-8"
},
"body": {
"govuk_account_session": "user-session-id",
"level_of_authentication": "level0",
"email": "user@example.com",
"email_verified": true,
"services": {
"transition_checker": "no",
"saved_pages": "yes"
}
}
}
Given there is a valid user session, upon receiving a has-subscription request from GDS API Adapters, with
{
"method": "get",
"path": "/api/transition-checker-email-subscription",
"headers": {
"Accept": "application/json",
"User-Agent": "gds-api-adapters/71.2.0 ()",
"GOVUK-Account-Session": "logged-in-user-session"
}
}
Account API will respond with:
{
"status": 200,
"headers": {
"Content-Type": "application/json; charset=utf-8"
},
"body": {
"govuk_account_session": "user-session-id",
"has_subscription": false
}
}
Given there is a valid user session, with a transition checker email subscription, upon receiving a has-subscription request from GDS API Adapters, with
{
"method": "get",
"path": "/api/transition-checker-email-subscription",
"headers": {
"Accept": "application/json",
"User-Agent": "gds-api-adapters/71.2.0 ()",
"GOVUK-Account-Session": "logged-in-user-session"
}
}
Account API will respond with:
{
"status": 200,
"headers": {
"Content-Type": "application/json; charset=utf-8"
},
"body": {
"govuk_account_session": "user-session-id",
"has_subscription": true
}
}
Given there is a valid user session, upon receiving a PUT saved-page/:page_path request from GDS API Adapters, with
{
"method": "put",
"path": "/api/saved_pages/%2Fguidance%2Fsome-govuk-guidance",
"headers": {
"Accept": "application/json",
"User-Agent": "gds-api-adapters/71.2.0 ()",
"GOVUK-Account-Session": "logged-in-user-session"
}
}
Account API will respond with:
{
"status": 200,
"headers": {
"Content-Type": "application/json; charset=utf-8"
},
"body": {
"govuk_account_session": "user-session-id",
"saved_page": {
"page_path": "/guidance/some-govuk-guidance"
}
}
}
Given there is a valid user session, upon receiving a set-attributes request from GDS API Adapters, with
{
"method": "patch",
"path": "/api/attributes",
"headers": {
"Accept": "application/json",
"User-Agent": "gds-api-adapters/71.2.0 ()",
"Content-Type": "application/json",
"GOVUK-Account-Session": "logged-in-user-session"
},
"body": {
"attributes": {
"foo": [
1,
2,
3
],
"bar": {
"nested": "json"
}
}
}
}
Account API will respond with:
{
"status": 200,
"headers": {
"Content-Type": "application/json; charset=utf-8"
},
"body": {
"govuk_account_session": "user-session-id"
}
}
Given there is a valid user session, upon receiving a set-subscription request from GDS API Adapters, with
{
"method": "post",
"path": "/api/transition-checker-email-subscription",
"headers": {
"Accept": "application/json",
"User-Agent": "gds-api-adapters/71.2.0 ()",
"Content-Type": "application/json",
"GOVUK-Account-Session": "logged-in-user-session"
},
"body": {
"slug": "brexit-emails-123"
}
}
Account API will respond with:
{
"status": 200,
"headers": {
"Content-Type": "application/json; charset=utf-8"
},
"body": {
"govuk_account_session": "user-session-id"
}
}
Upon receiving a sign-in request from GDS API Adapters, with
{
"method": "get",
"path": "/api/oauth2/sign-in",
"headers": {
"Accept": "application/json",
"User-Agent": "gds-api-adapters/71.2.0 ()"
}
}
Account API will respond with:
{
"status": 200,
"headers": {
"Content-Type": "application/json; charset=utf-8"
},
"body": {
"auth_uri": "http://authentication-provider/some/oauth/url",
"state": "value-to-use-for-csrf-prevention"
}
}
Given there is a valid OAuth response, upon receiving a validation request from GDS API Adapters, with
{
"method": "post",
"path": "/api/oauth2/callback",
"headers": {
"Accept": "application/json",
"User-Agent": "gds-api-adapters/71.2.0 ()",
"Content-Type": "application/json"
},
"body": {
"code": "code",
"state": "state"
}
}
Account API will respond with:
{
"status": 200,
"headers": {
"Content-Type": "application/json; charset=utf-8"
},
"body": {
"govuk_account_session": "user-session-id"
}
}
Given there is a valid OAuth response, with the redirect path '/some-arbitrary-path', upon receiving a validation request from GDS API Adapters, with
{
"method": "post",
"path": "/api/oauth2/callback",
"headers": {
"Accept": "application/json",
"User-Agent": "gds-api-adapters/71.2.0 ()",
"Content-Type": "application/json"
},
"body": {
"code": "code",
"state": "state"
}
}
Account API will respond with:
{
"status": 200,
"headers": {
"Content-Type": "application/json; charset=utf-8"
},
"body": {
"govuk_account_session": "user-session-id",
"redirect_path": "/some-arbitrary-path"
}
}