User Document
A User document is a construct that houses a user's core data: username, avatar, email address. There are two actions that can be performed on the user document depending on the permissions granted to the service by the user: Get Document and Update Document.
It is recommended that you do not update any user document values unless it is a critical part of your design and your application will fail without it.
Get User Document
To get the user document for a provided service-user token, make a GET request with the service-user token. Something to note is that all action on the user data is logged and available to the user in a tamper proof method that borrows from blockchain concepts.
fetch('https://api.opencider.com/user/document?token=service_user_token');
Update Document
Update the user document by providing valid inputs as specified by the user to the following fields: username, email address, avatar. A valid request will produce a successful or partially successful response based on the permissions granted to the service by the user.
fetch('https://api.opencider.com/user/document', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
'emailAddress': 'updated_email_address',
'username': 'updated_user_name',
'avatar': 'updated_avatar_url',
'token': 'service_user_token'
})
});
Last updated