##API URLS
- Account Resources
- Catalog Resources
- Downline Resources
##Authentication
To obtain a token, issue a request to POST https://beta.youngliving.com/api/accounts/token
- The request must be a HTTP POST request.
- The request must include a Content-Type header with the value of application/json.
- The body of the request must in JSON format with memberId and password.
Request body
{
"memberId": ":member_id",
"password": ":password"
}Example request
POST /api/accounts/token HTTP/1.1
Host: beta.youngliving.com
Content-Type: application/json
{
"memberId": ":member_id",
"password": ":password"
}
##Commission Endpoints ###Base URL https://beta.youngliving.com/vo.dlv.api/commission
- GET: https://beta.youngliving.com/vo.dlv.api/commission/check/summary/period_id
- GET: https://beta.youngliving.com/vo.dlv.api/commission/check/unilevel/period_id/level
- GET: https://beta.youngliving.com/vo.dlv.api/commission/history/period_id
- (0 for current period)
##Organization Endpoints
- GET: https://beta.youngliving.com/vo.dlv.api/downline/children/user/period_id
- (0 for current period)
- GET: https://beta.youngliving.com/vo.dlv.api/downline/children/member_id/period_id
- (0 for current period)
- GET: https://beta.youngliving.com/vo.dlv.api/downline/detail/user/period_id
- (0 for current period)
- GET: https://beta.youngliving.com/vo.dlv.api/downline/detail/member_id/period_id
- (0 for current period)
##Qualification Endpoints
- GET: https://beta.youngliving.com/vo.dlv.api/downline/qualification/user/period_id
- (0 for current period)
##Helpers
function getPeriodId(date) { // Defaults to Current Period if you leave 'date' empty
date = date instanceof Date ? date : new Date();
return (date.getFullYear() * 12 + date.getMonth() + 1) - (2014 * 12 + 5) + 400;
}
@westdavidr I was testing the API calls with postman, and YL updated the base URL and the required fields in the payload. I forked and updated your gist. Can you review an merge it?