Ask the Community
Groups
How to Get a Bearer Token in Passly and Use Pagination - Connect IT Community | Kaseya
<main> <article class="userContent"> <h3 data-id="question">Question</h3> <ul><li>How do I get a bearer token in Passly?</li> <li>How do I get past the first 100 records?</li> </ul><h3 data-id="resolution">Resolution</h3> <p><strong>Bearer Token</strong> (<em>Using Postman</em>)</p> <p>To get an access token use the below API endpoint.</p> <p>POST <a rel="nofollow" href="/home/leaving?allowTrusted=1&target=https%3A%2F%2Fcp.my.passly.com%2Fauthorize%2Ftoken">https://cp.my.passly.com/authorize/token</a> (change cp to your Passly home realm, and note the .com or .eu depending on your URL)</p> <p><img src="https://us.v-cdn.net/6032361/uploads/migrated/NWI4IF5EASZQ/screen-shot-2021-03-09-at-8-14-28-am.png" alt="Screen_Shot_2021-03-09_at_8.14.28_AM.png" class="embedImage-img importedEmbed-img"></img></p> <p>The Body is as follows:</p> <p>Select x-www-form-urlencoded with the below attributes</p> <table border="1"><tbody><tr><td>Key</td> <td>Value</td> </tr><tr><td>grant_type</td> <td>password</td> </tr><tr><td>client_id</td> <td>my:passly:portal</td> </tr><tr><td>username</td> <td><yourUserName></td> </tr><tr><td>password</td> <td><yourPassword></td> </tr></tbody></table><p><img src="https://us.v-cdn.net/6032361/uploads/migrated/0VSVKT9ME006/screen-shot-2021-03-09-at-8-14-46-am.png" alt="Screen_Shot_2021-03-09_at_8.14.46_AM.png" class="embedImage-img importedEmbed-img"></img></p> <p>The response will be:</p> <p><img src="https://us.v-cdn.net/6032361/uploads/migrated/S1UB38PC0CVW/screen-shot-2021-03-09-at-8-15-12-am.png" alt="Screen_Shot_2021-03-09_at_8.15.12_AM.png" class="embedImage-img importedEmbed-img"></img></p> <p> </p> <p>Now that you have a token, you can make API calls against your Passly tenant. You can find all the available API endpoints within the Passly UI:</p> <p><img src="https://us.v-cdn.net/6032361/uploads/migrated/CQF0OR999VPM/screen-shot-2021-03-09-at-9-10-32-am.png" alt="Screen_Shot_2021-03-09_at_9.10.32_AM.png" class="embedImage-img importedEmbed-img"></img></p> <p><strong>Pagination</strong></p> <p>In order to get more than 100 records, you would need to use the attributes top and skip. NOTE: Skip must be used with an order by attribute, while top can be used by itself. </p> <p>Example: </p> <p>The below API endpoint will provide you the second record in your Passly user list.</p> <p>GET <a rel="nofollow" href="/home/leaving?allowTrusted=1&target=https%3A%2F%2Fcp.my.passly.com%2Fapi%2Fdirectory%2FPeople%2FPeopleDTO%3F%2524orderby%3DPrincipalName%26%2524top%3D1%26%2524skip%3D1">https://cp.my.passly.com/api/directory/People/PeopleDTO?$orderby=PrincipalName&$top=1&$skip=1</a></p> <p>This will skip the first record, and return the top record which is the second record as the first one is skipped.</p> </article> </main>