Self Endpoints (2022/06) Updates

 

GET /Self/Session/

Retrieves the complete set of attributes defined in the context of the current person session.

Request Example

The example request parameters and headers are set as follows:

  • The optional If-Modified-Since header value equals the Last-Modified header value retrieved from the GET /Self/Session/ response.

GET /2022/06/REST/Self/Session/ HTTP/1.1 Host: api.bsn.cloud Connection: Keep-Alive Authorization: Bearer {{AccessToken}} Accept: application/json, application/vnd.bsn.error+json Accept-Encoding: gzip,deflate If-Modified-Since: Wed, 29 Nov 2023 17:40:51 GMT

______________________________________________________________

Success Response with Body

200: Returns the Session Context Structure (2022/06)

Example

{ "network": { "id": 12345, "name": "JohnDoe" }, "authorizationScope": "bsn.api.main bsn.api.self bsn.api.upload bsn.ui.main player", "lastModifiedDate": "2024-08-08T16:10:13.673Z" }

 

304: The provided If-Modified-Since HTTP header value matches the timestamp of the current attribute value assignment

Failure Response

400: The request is malformed and therefore invalid

401: The provided person access token is invalid and the session id cannot be retrieved

406: The server cannot return the data representation that you requested (as specified in the "Accept" header)

410: The provided person access token is valid but the session with resolved id has been invalidated

5XX: Any 500 code is an internal server error

 

GET /Self/Session/Network/

Retrieves the identifiers of the network that the current user is signed into.

Request Example

The example request parameters and headers are set as follows:

  • The optional If-Modified-Since header value equals the Last-Modified header value retrieved from the GET /Self/Session/Network/ response.

GET /2022/06/REST/Self/Session/Network/ HTTP/1.1 Host: api.bsn.cloud Connection: Keep-Alive Authorization: Bearer {{AccessToken}} Accept: application/json, application/vnd.bsn.error+json Accept-Encoding: gzip,deflate If-Modified-Since: Wed, 29 Nov 2023 17:40:51 GMT

______________________________________________________________

Success Response with Body

200: Returns the requested attribute value, which is either the Network Info Entity (2022/06) or null if the current person is not signed into any network.

Example

304: The provided If-Modified-Since HTTP header value matches the timestamp of the current attribute value assignment

Failure Response

400: The request is malformed and therefore invalid

401: The provided person access token is invalid and the session id cannot be retrieved

406: The server cannot return the data representation that you requested (as specified in the "Accept" header)

410: The provided person access token is valid but the session with the resolved id has been invalidated

5XX: Any 500 code is an internal server error

 

GET /Self/Session/AuthorizationScope/

Retrieves the scope of actions the current user is authorized to do with the provided access token.

Request Example

The example request parameters and headers are set as follows:

  • The optional If-Modified-Since header value equals the Last-Modified header value retrieved from the GET /Self/Session/AuthorizationScope/ response.

______________________________________________________________

Success Response with Body

200: Returns the space-separated list of tokens which represent the available resources

Example

 

304: The provided If-Modified-Since HTTP header value matches the timestamp of the current attribute value assignment

Failure Response

400: The request is malformed and therefore invalid

401: The provided person access token is invalid and the session id cannot be retrieved

406: The server cannot return the data representation that you requested (as specified in the "Accept" header)

410: The provided person access token is valid but the session with the resolved id has been invalidated

5XX: Any 500 code is an internal server error

 

PUT /Self/Session/Network/

Allows a person to set or change a network the person is signed into in scope of the current session

Request Example

The example request parameters and headers are set as follows:

  • The optional If-Unmodified-Since header value equals the Last-Modified header value retrieved from the GET /Self/Session/Network/ response.

This is the example request body:

______________________________________________________________

Success Response with Body

204: The person is successfully signed into the specified network

Failure Response

400: Invalid request and any of the following business rules violations:

  • The provided Network Info Entity (2022/06) has an invalid format

  • Neither network id not network name is specified in the request

  • A network with the specified id or name does not exist

  • A network with the specified id or name is suspended

  • The person who owns the provided access token is not a member of the network with the specified id or name

  • The person in the network with the specified id or name is disabled

401: The provided person access token is invalid and the session id cannot be retrieved

410: The provided person access token is valid but the session with the resolved id has been invalidated

412: The provided If-Unmodified-Since HTTP header value does not match the timestamp of the current attribute value assignment

5XX: Any 500 code is an internal server error

 

PUT /Self/Session/AuthorizationScope/

Allows a person to change the list of resources he is authorized to access with the provided access token.

Request Example

The example request parameters and headers are set as follows:

  • The optional If-Unmodified-Since header value equals the Last-Modified header value retrieved from the GET /Self/Session/AuthorizationScope/ response.

This is the example request body:

______________________________________________________________

Success Response with Body

204: The authorization scope has been successfully updated.

Failure Response

400: Invalid request and any of the following business rules violations:

  • The provided authorization scope has an invalid format

  • One or more specified scope tokens are not available with the provided token

401: The provided person access token is invalid and the session id cannot be retrieved

410: The provided person access token is valid but the session with the resolved id has been invalidated

412: The provided If-Unmodified-Since HTTP header value does not match the timestamp of the current attribute value assignment

5XX: Any 500 code is an internal server error