Authenticate User
client.profile.authenticate(ProfileAuthenticateParams { emailaddress, password } body?, RequestOptionsoptions?): ProfileAuthenticateResponse { Data, Metadata }
POST/profile/authenticate
Perform user authentication, returning a model which includes the users profile and a JWT auth token to re-use in subsequent requests.
Authenticate User
import Ocm from 'ocm-sdk';
const client = new Ocm({
apiKey: process.env['OCM_API_KEY'], // This is the default and can be omitted
});
const response = await client.profile.authenticate({ emailaddress: 'string', password: 'string' });
console.log(response.Data);{
"Data": {
"access_token": "x",
"UserProfile": {
"DateCreated": "x",
"ID": 0,
"IsProfilePublic": true,
"Username": "x",
"DateLastLogin": "x",
"EmailAddress": "x",
"Latitude": 0,
"Location": "x",
"Longitude": 0,
"Permissions": "x",
"Profile": "x",
"ProfileImageURL": "x",
"ReputationPoints": 0,
"WebsiteURL": "x"
}
},
"Metadata": {
"StatusCode": 0
}
}Returns Examples
{
"Data": {
"access_token": "x",
"UserProfile": {
"DateCreated": "x",
"ID": 0,
"IsProfilePublic": true,
"Username": "x",
"DateLastLogin": "x",
"EmailAddress": "x",
"Latitude": 0,
"Location": "x",
"Longitude": 0,
"Permissions": "x",
"Profile": "x",
"ProfileImageURL": "x",
"ReputationPoints": 0,
"WebsiteURL": "x"
}
},
"Metadata": {
"StatusCode": 0
}
}