Copy of Self Endpoints (2020/10): temp question

These endpoints allow users to manage their settings in the current network. 

Base URL for these endpoints:  https://api.bsn.cloud/2020/10/REST/Self/

_________________________________________________________________________

GET

Returns the information associated with the person (the requestor).

Response Body

Returns the Person Entity

POST

Registers the person and returns your person credentials (except the password if it was provided in your request). 

Parameters

returnURL string 

If this parameter is not specified, the parameters value from BSN configuration file will be used.

______________________________________________________________

Request Body

The Person Entity. If you specify a password that matches our security policy, the server will apply the password you specify and will not return a password. If you do not specify a password, the server will generate a password and return it to you.

______________________________________________________________

Response Body

Returns the Person Entity

PUT

Updates a person's information. Any customer can edit their own password, first name, and last name regardless of network membership, but cannot edit someone else's name or password.

The login property, whose values are email addresses, is a key and not editable. To give another customer access to that property or handle an email address change, a user with sufficient privileges need to create a new person, add it to the same network, assign them to the same role, and copy the custom user permissions (if any) from an existing user. This can be done in the Users Endpoints (2020/10)#POST API call.

Request Body

The Person Entity

______________________________________________________________

Response Body

On success this method returns a status code 2XX, on failure it returns a status code of 5XX.

{login}/Password/GET

Initiate a password reset for a person

Parameters

login string 

The person's login information 


returnURL string optional

The location header will be set to this Url, if specified.

______________________________________________________________

Response Body

On success, this method returns a status code 200 and triggers an email to your login which contains a reference to the returnURL that you specified. On failure it returns a status code of 5XX. 

Tokens/{token}/GET

Gets the status of the specified OAuth2 person access or refresh token

Parameters

token string 

 A device registration token for a BSN.cloud network

______________________________________________________________

Response Body

Returns the Token Info Entity

Tokens/{token}/DELETE

Revokes a person access or refresh token

Parameters

token string 

 A device registration token for a BSN.cloud network

______________________________________________________________

Response Body

On success, this method returns a status code 2XX, on failure it returns a status code of 5XX.

Endpoints:


Networks/GET

Returns the networks associated with a person

Response Body

Returns a complete list of Network Entity instances associated with a person.

Networks/POST

Creates a network for the person.

Request Body

The Network Entity

______________________________________________________________

Response Body

Returns a 201 status code and the new resource created and referenced by the Uri (given by the Location header field) in the response. The response includes the network entity (see Network Entity).

Networks/{id:int}/GET

Get a list of networks associated with a specified id.

Parameters

id int

The unique identifier for a network

______________________________________________________________

Response Body

Returns the Network Entity


Networks/{name}/GET

Get a list of networks associated with a specified name.

Parameters

name string

The name of a network

______________________________________________________________

Response Body

Returns the Network Entity


Networks/{id:int}/Settings/GET

Returns the settings associated with a specified network.

Parameters

id int

The unique identifier for a network

______________________________________________________________

Response Body

Returns the Network Settings Entity

Networks/{id:int}/Settings/PUT

Update the settings associated with a specified network

Parameters

id int

The unique identifier for a network

______________________________________________________________

Request Body

The Network Settings Entity

______________________________________________________________

Response Body

On success this method returns a status code 2XX, on failure it returns a status code of 5XX.

Networks/{name}/Settings/GET

Get the settings associated with a specified network.

Parameters

name string

The name of a network

______________________________________________________________

Response Body

Returns the Network Settings Entity

Networks/{name}/Settings/PUT

Update the settings associated with a specified network

Parameters

name string

The name of a network

______________________________________________________________

Request Body

The Network Settings Entity

______________________________________________________________

Response Body

On success this method returns a status code 2XX, on failure it returns a status code of 5XX.

Networks/{id:int}/Subscription/GET

Returns the current subscription Information associated with a specified network.

Parameters

id int

The unique identifier for a network

______________________________________________________________

Response Body

Returns the Network Subscription Entity

Networks/{id:int}/Subscription/PUT

Update the current subscription information associated with a specified network

Parameters

id int

The unique identifier for a network

______________________________________________________________

Request Body

The Network Subscription Entity

______________________________________________________________

Response Body

On success this method returns a status code 2XX, on failure it returns a status code of 5XX.

Networks/{name}/Subscription/GET

Returns the current subscription information associated with a specified network.

Parameters

name string

The name of a network

______________________________________________________________

Response Body

Returns the Network Subscription Entity

Networks/{name}/Subscription/PUT

Updates the current subscription information associated with a specified network

Parameters

name string

The name of a network

______________________________________________________________

Request Body

The Network Subscription Entity

______________________________________________________________

Response Body

On success this method returns a status code 2XX, on failure it returns a status code of 5XX.

Networks/{id:int}/Subscriptions/GET

Returns all of the network subscriptions associated with a specified network.

Parameters

id int

The unique identifier for a network

______________________________________________________________

Response Body

Returns all Network Subscription entities on a network

Networks/{name}/Subscriptions/GET

Returns all of the network subscriptions associated with a specified network.

Parameters

name string

The name of a network

______________________________________________________________

Response Body

Returns all Network Subscription entities on a network

Users/GET

Returns all user entities that the customer is associated with over all networks where the person has a user record

Response Body

Returns an array of user entities (see User Entity) if the user is a member of multiple networks, or to a single User Entity if the user is only a member of one network, or nothing if the user is not a member of any network.

Users/{userid:int}/GET

Returns information about a specified user on a network

Parameters

id int

The unique identifier for a user

______________________________________________________________

Response Body

Returns the User Entity

Users/{userid:int}/Role/GET

Returns information about a specified user role on a network

Parameters

id int

The unique identifier for a user

______________________________________________________________

Response Body

If the user is not assigned to a role, then the expected response status is 204 (No content). Otherwise this returns the User Entity.

Users/{userid:int}/Profile/GET

Returns the user profile settings

Parameters

id int

The unique identifier for a user

______________________________________________________________

Response Body

The return type is object, where property names are profile keys and the profile values are those property values

Users/{userid:int}/Profile/POST

Creates the user profile property

Parameters

id int

The unique identifier for a user

______________________________________________________________

Request Body

pair <string, string>

 A key value pair. There should be not more than 100 properties per user, and each property value should be not more than 64KB. 

______________________________________________________________

Response Body

Returns a 201 status code, the key value pair, and a link to the GET method to retrieve it. 

Users/{userid:int}/Profile/{key}/GET

Returns the value of a user profile key

Parameters

id int

The unique identifier for a user


key string 

The name of the profile property

______________________________________________________________

Response Body

Returns the value of the requested user profile key 

Users/{userid:int}/Profile/{key}/PUT

Sets a property value in a user profile

Parameters

id int

The unique identifier for a user


key string 

The name of the profile property

______________________________________________________________

Request Body

value string: The profile property value to update

______________________________________________________________

Response Body

Returns HTTP status code 201 if the property value is defined for first time, or status code 204 if the property already exists and has been updated.

Users/{userid:int}/Profile/{key}/DELETE

Removes a user profile property

Parameters

id int

The unique identifier for a user


key string 

The name of the profile property

______________________________________________________________

Response Body

On success this method returns a status code 2XX, on failure it returns a status code of 5XX.

Profile/GET

Returns a complete person profile

Response Body

The return type is object, where property names are profile keys and the profile values are those property values

Profile/POST

Creates a profile property for the person

Request Body

pair <string, string> 

A key value pair of the person and profile property

______________________________________________________________

Response Body

Returns a 201 status code and the new resource created and referenced by the Uri (given by the Location header field) in the response. Returns an object where property names correspond to profile keys and property values correspond to profile names.

Profile/{key}/GET

Returns a profile property value for a person

Parameters

key string 

The name of the profile property

______________________________________________________________

Response Body

Returns a profile property value

Profile/{key}/PUT

Sets a profile property value for a person

Parameters

key string 

The name of the profile property

______________________________________________________________

Request Body

value string 

The profile property value to update

______________________________________________________________

Response Body

On success this method returns a status code 2XX, on failure it returns a status code of 5XX.

Profile/{key}/DELETE

Removes a profile property for a person

Parameters

key string 

The name of the profile property

______________________________________________________________

Response Body

On success this method returns a status code 2XX, on failure it returns a status code of 5XX.

Users/{userid:int}/Permissions/GET

Returns permissions for a given user

Parameters

id int 

A unique identifier for a user

______________________________________________________________

Response Body

Returns an array of Permission Entity entities

Users/{userid:int}/Role/Permissions/GET

Returns permissions for a given user role.

Parameters

id int 

A unique identifier for a user

______________________________________________________________

Response Body

Returns the Permission Entity for a given user role