User Tokens
To obtain an API JWT Token for a user
HTTP Request
Section titled “HTTP Request”POST {server_url}/api/v1/sso_auth/auth_token
Header Parameter
Section titled “Header Parameter”| Parameter | Default |
|---|---|
| Content-type | application/json |
Request Body
Section titled “Request Body”| Attribute | Required | Description |
|---|---|---|
| auth | true | parent attribute specifying user information to update or create in MD Live |
| ↳ first_name | true | User’s first name |
| ↳ last_name | true | User’s last name |
| ↳ gender | true | User’s gender, specified as ‘M’ for male, ‘F’ for female, ‘U’ for non-binary |
| ↳ birthdate | true | User’s birthdate, specified as year-month-day |
| ↳ subscriber_id | true | User’s subscriber id |
| ↳ member_id | false | user’s member id |
| ↳ phone | true | User’s contact phone number |
| true | User’s email address | |
| ↳ address1 | true | First line of user’s mailing address |
| ↳ address2 | false | Second line of user’s mailing address, if needed |
| ↳ city | true | City of user’s mailing address |
| ↳ state | true | State of user’s mailing address |
| ↳ zip | true | Zip code of user’s mailing address |
| ↳ relationship | true | Relationship of user to primary account holder. Specified as either ‘Self’, ‘Spouse’, ‘Child’, or ‘Other Adult’ |
| ↳ primary_first_name | false | First name of primary account holder, if user is not primary |
| ↳ primary_last_name | false | Last name of primary account holder, if user is not primary |
| ↳ primary_gender | false | Gender of primary account holder, if user is not primary, specified as ‘M’ for male, ‘F’ for female, ‘U’ for non-binary |
| ↳ primary_birthdate | false | Birthdate of primary account holder, if user is not primary, specified as day-month-year |
| ↳ primary_subscriber_id | false | Subscriber id of primary account holder, if user is not primary |
| ↳ primary_member_id | false | Member id of primary account holder, if user is not primary |
| ↳ primary_address1 | false | First line of mailing address for primary account holder, if user is not primary |
| ↳ primary_address2 | false | Second line of mailing address for primary account holder, if user is not primary |
| ↳ primary_city | false | City of mailing address for primary account holder, if user is not primary |
| ↳ primary_state | false | State of mailing address for primary account holder, if user is not primary |
| ↳ primary_zip | false | Zip code of mailing address for primary account holder, if user is not primary |
| org | true | parent attribute for calling organizational information |
| ↳ ou | true | Organizational unit identifier assigned by MD Live |
| ↳ request_timestamp | false | Timestamp of request, specified as floating point number of seconds since the Epoch |
| ↳ enterprise_hash | false | Base64 encoded SHA-256 digest of memberid, request_timestamp, and a shared secret digest key |
| api | true | parent attribute of api_key and password |
| ↳ api_key | true | Unique key assigned to you by your account manager |
| ↳ password | true | Unique password assigned to key by your account manager |
Example Request
Section titled “Example Request”curl -X POST {server_url}/api/v1/sso_auth/auth_token-H "Content-type: application/json"-d '{ "auth": { "first_name": "firstname", "last_name": "lastname", "gender": "M", "birthdate": "1960-12-31", "subscriber_id": "subscriberid", "member_id": "memberid", "phone": "555-555-5555", "email": "some@email.com", "address1": "address1", "address2": "address2", "city": "Sunrise", "state": "FL", "zip": "33303", "relationship": "Self", "primary_first_name": "", "primary_last_name": "", "primary_gender": "", "primary_birthdate": "", "primary_subscriber_id": "", "primary_member_id": "", "primary_address1": "", "primary_address2": "", "primary_city": "", "primary_state": "", "primary_zip": "" }, "org": { "ou": "ou", "request_timestamp": "1509727623.5845659", "enterprise_hash": "YTBmNjVlNzFlODJlNmU3ZGQ5NjZlZDExODlhYTE2MDhmZWY4NDVmYTQ0ZmZkMmI0NzFlOGMyMWQ4ZWM3N2FjZg==" }, "api": { "api_key": "my_api_key", "password": "my_password" } }'RestClient::Request.new( :method => :post, :url => "{server_url}/api/v1/sso_auth/auth_token", :headers => { "Content-type" => "application/json" }, :payload => { "auth" => { "first_name" => "firstname", "last_name" => "lastname", "gender" => "M", "birthdate" => "1960-12-31", "subscriber_id" => "subscriberid", "member_id" => "memberid", "phone" => "555-555-5555", "email" => "some@email.com", "address1" => "address1", "address2" => "address2", "city" => "Sunrise", "state" => "FL", "zip" => "33303", "relationship" => "Self", "primary_first_name" => "", "primary_last_name" => "", "primary_gender" => "", "primary_birthdate" => "", "primary_subscriber_id" => "", "primary_member_id" => "", "primary_address1" => "", "primary_address2" => "", "primary_city" => "", "primary_state" => "", "primary_zip" => "" }, "org" => { "ou" => "ou", "request_timestamp" => "1509727623.5845659", "enterprise_hash" => "YTBmNjVlNzFlODJlNmU3ZGQ5NjZlZDExODlhYTE2MDhmZWY4NDVmYTQ0ZmZkMmI0NzFlOGMyMWQ4ZWM3N2FjZg==" }, "api" => { "api_key" => "my_api_key", "password" => "my_password" } }).executeExample Response
Section titled “Example Response”{ "jwt": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyaWQiOjUyLCJ1c2VybmFtZSI6ImRlbW9wYXRpZW50MSIsInByaW1hcnlfYWN0aW5nX2FzX2FnZW50IjpmYWxzZSwiZGV2aWNlX29zIjoiQW5kcm9pZCIsImFwcF9pZCI6Ik1ETElWRSIsImFwcF92ZXJzaW9uIjoiMTA1MSIsImFwaV9jcmVkX2lkIjoxLCJleHAiOjE1MDgzNTM5MTF9.orRpY5qV6f7NVAmOIX9-ZB92U-omf_rVjLZ6IyVxfU0", "user": { "id": 52, "type": "Patient", "time_to_live_minutes": 60 }}