Users and Sessions
In order to use Rollee Connect, our product's interface, we must have Users and Sessions.
Users are instances of a Client's account, and a Client can have as many Users as desired, and each Connected Account is associated with a User.
One easy way to look at Users is comparing them to a football team: a Client is a Team, and a Team has Football Players, which are Users. The Players are the ones that actually touch the ball, score goals, etc. Users are the ones that connect accounts.
Each User is represented by an unique ID (UUID). In order to help you identify which User you created, we allow Metadata to be added on the creation optionally.
Sessions are User identifiers with specific time ranges for when Rollee Connect is allowed to operate on behalf of a User. Each Session is uniquely associated with a User, although a User can have many Sessions.
One easy way to look at Sessions is comparing them to Hotel Room Key Cards: you have an Hotel Room, but you can have more than 1 Key Card (for your child to keep, for instance), the Key Cards are only valid during your stay and whatever purchase made at the Hotel using your Room Key Card will be associated with you.
Each Session is represented by an unique ID (UUID) and has a 30 minute validity period.
Here are some requests that will be helpful to interact with Users and Sessions:
- Get all Users:
curl -X GET -H "Authorization: Bearer <YOUR_TOKEN>" https://api.getrollee.com/api/v0.4/users
curl -X GET -H "Authorization: Bearer <YOUR_TOKEN>" https://api.sand.getrollee.com/api/v0.4/users
- Create a User:
curl -X POST -H 'Authorization: Bearer <YOUR_TOKEN>' https://api.getrollee.com/api/v0.4/users/
# with metadata
curl -X POST -H 'Authorization: Bearer <YOUR_TOKEN>' https://api.getrollee.com/api/v0.4/users/ --data '
{
"metadata": {
"newKey": "New Value",
"newKey-1": "New Value"
}
}
'
curl -X POST -H 'Authorization: Bearer <YOUR_TOKEN>' https://api.sand.getrollee.com/api/v0.4/users/
# with Metadata
curl -X POST -H 'Authorization: Bearer <YOUR_TOKEN>' https://api.sand.getrollee.com/api/v0.4/users/ --data '
{
"metadata": {
"newKey": "New Value",
"newKey-1": "New Value"
}
}
'
- Create a Session
curl -X POST -H 'Authorization: Bearer <YOUR_TOKEN>' https://api.getrollee.com/api/v0.4/users/<YOUR_USER_ID>/sessions/new
curl -X POST -H 'Authorization: Bearer <YOUR_TOKEN>' https://api.sand.getrollee.com/api/v0.4/users/<YOUR_USER_ID>/sessions/new
Updated 9 months ago