{"id":41,"date":"2022-07-29T14:57:17","date_gmt":"2022-07-29T14:57:17","guid":{"rendered":"https:\/\/www.wellnessliving.com\/developer-portal\/?p=41"},"modified":"2024-10-19T15:03:10","modified_gmt":"2024-10-19T15:03:10","slug":"authentication-guide","status":"publish","type":"post","link":"https:\/\/www.wellnessliving.com\/developer-portal\/getting-started\/authentication-guide\/authentication-guide\/","title":{"rendered":"Authentication guide"},"content":{"rendered":"\n<p>To make authenticated calls to our API, you need four pieces of information that remain static:<\/p>\n\n\n\n<ul><li>Your WellnessLiving username<\/li><li>Your WellnessLiving password<\/li><li>Your authorization code<\/li><li>Your authorization ID<\/li><\/ul>\n\n\n\n<p>A user can be a client or a staff member, but it\u2019s recommended to make all calls with a staff member since they\u2019ll have broader access than clients. The authorization ID is used in the request header. The authorization ID and code are used when <a href=\"#_Signature_Hash_Examples\">calculating the signature<\/a>.<\/p>\n\n\n\n<p>WellnessLiving\u2019s API uses a generated signature in the HTTP request header for additional security. This generated signature is a string set as a hash of multiple values. However, signature generation isn\u2019t required if the endpoint doesn\u2019t require authentication.<\/p>\n\n\n\n<p>When authenticating, there are two session creation endpoints that need to be called before accessing the actual data required:<\/p>\n\n\n\n<ul><li><a rel=\"noreferrer noopener\" href=\"https:\/\/github.com\/wellnessliving\/wl-sdk\/blob\/master\/WellnessLiving\/Core\/Passport\/Login\/Enter\/NotepadModel.php\" target=\"_blank\">NotepadModel,<\/a> which gets the notepad value and cookies.<\/li><li><a rel=\"noreferrer noopener\" href=\"https:\/\/github.com\/wellnessliving\/wl-sdk\/blob\/master\/WellnessLiving\/Core\/Passport\/Login\/Enter\/EnterModel.php\" target=\"_blank\">EnterModel,<\/a> which signs the user in.<\/li><\/ul>\n\n\n\n<p><div class=\"note\"><strong>Note<\/strong>These two session creation endpoints aren\u2019t required if the endpoint in question doesn&#8217;t require authentication.<\/div><\/p>\n\n\n\n<h2>Cookies<\/h2>\n\n\n\n<p>There are two cookies used to maintain your session, depending on the server you\u2019re using. For example, the cookies used on our Staging server are:<\/p>\n\n\n\n<ul><li><em>sp<\/em> (Staging Persistent)<\/li><li><em>st<\/em> (Staging Transient)<\/li><\/ul>\n\n\n\n<p>These cookies are usable for 30 days.<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>To make authenticated calls to our API, you need four pieces of information that remain static: Your WellnessLiving username Your WellnessLiving password Your authorization code Your authorization ID A user can be a client or a staff member, but it\u2019s recommended to make all calls with a staff member since they\u2019ll have broader access than [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[19],"tags":[],"acf":[],"_links":{"self":[{"href":"https:\/\/www.wellnessliving.com\/developer-portal\/wp-json\/wp\/v2\/posts\/41"}],"collection":[{"href":"https:\/\/www.wellnessliving.com\/developer-portal\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wellnessliving.com\/developer-portal\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wellnessliving.com\/developer-portal\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wellnessliving.com\/developer-portal\/wp-json\/wp\/v2\/comments?post=41"}],"version-history":[{"count":19,"href":"https:\/\/www.wellnessliving.com\/developer-portal\/wp-json\/wp\/v2\/posts\/41\/revisions"}],"predecessor-version":[{"id":474,"href":"https:\/\/www.wellnessliving.com\/developer-portal\/wp-json\/wp\/v2\/posts\/41\/revisions\/474"}],"wp:attachment":[{"href":"https:\/\/www.wellnessliving.com\/developer-portal\/wp-json\/wp\/v2\/media?parent=41"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wellnessliving.com\/developer-portal\/wp-json\/wp\/v2\/categories?post=41"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wellnessliving.com\/developer-portal\/wp-json\/wp\/v2\/tags?post=41"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}