What Is Needed To Create An OAuth Flow
What Is Needed To Create An OAuth Flow
Prerequisites
Overview
The general OAuth ow consists of the following steps:
Support
Prerequisites
In order to follow along this brief walkthrough, you need to have OAuth keys created. Please refer to this article for
assistance in creating them: How to create OAuth App Credentials
We also highly recommend you have a general understanding of how the YM REST API works and how the SessionId is
used for an authenticated session. Please refer to this article: Getting Started with the REST API
https://www.professional.com/lock.aspx?
app_id=AbCdEfG12345&redirect_uri=https://members.pro.app/callback&scope=basic_pro le
The parameters can be in any order, but this is where you would direct your members to sign in and authorize the
application. On successful authorization, the browser will redirect to your redirect url
(e.g. https://members.pro.app/callback) with a query string parameter "code" that is used to get the access token (e.g.
https://members.pro.app/callback?code=code101010).
In this case, we would be using the Code parameter and not the RefreshToken parameter. The refresh token is used
when you already have the refresh token and need to get a new access token. Once you have all your parameters, you
would make the following call:
Endpoint Type
https://ws.yourmembership.com/OAuth/GetAccessToken POST
Body
{
AppId: "AbCdEfG12345",
AppSecert: "SECRETAbCdEfG12345",
GrantType: "Code",
Code: "code101010"
}
A successful response from this call will return a series of datapoints including the AccessToken and it's expiration. This
token will be used to authenticate to the REST Services. For this example, let's say the access token returned
was a1b2c3d4e5.
Once you have all of your parameters situated, you would make the following call:
Endpoint Type
https://ws.yourmembership.com/Ams/Authenticate POST
Body
{
ConsumerKey: "AbCdEfG12345",
ConsumerSecret: "SECRETAbCdEfG12345",
AccessToken: "a1b2c3d4e5",
ClientID: 12345,
UserType: "Member",
}
A successful authentication will return another series of values including two very important values:
SessionId: The value to be passed into the "X-SS-ID" header for subsequent requests.
These two, in conjunction with the ClientID, will be used to make calls to other services as needed.
/Ams/{ClientID}/Member/
BasicMemberPro le Route The route to get the user's information
{MemberID}/BasicMemberPro le
Once you have all of your parameters situated, you would make the following call:
Endpoint
https://ws.yourmembership.com/Ams/12345/Member/987654321/BasicMemberPro le
Type
GET
Headers
{
...
X-SS-ID: "AUTH123",
...
}
On successful response, you will see your member's information as speci ed in the metadata.
Was this article helpful? 👍 👎 0 out of 0 found this helpful
Powered by Zendesk