web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / How to get Access Toke...
Power Automate
Suggested Answer

How to get Access Tokens (Client Credentials) and refresh tokens before calling Third Party API

(1) ShareShare
ReportReport
Posted on by
I am making an automated recurring flow to trigger Paylocity Get Employee Punch Details API for all employees. For this flow to work and run 3 times a day without any errors, I should have the access token which refreshes. Please tell me the steps to get the access token and refresh tokens so that the flow will run without errors.
Categories:
I have the same question (0)
  • Suggested answer
    Inogic Profile Picture
    1,285 Moderator on at
    Hi,
     
    Here's a breakdown of how you can handle the Paylocity API token refresh for your recurring Power Automate flow:
    ·  Register Application: Obtain Client ID and Client Secret from Paylocity.
    ·  Obtain Access Token:
    • Make a request to the Paylocity OAuth token endpoint with your Client ID and Client Secret.
    • Include the necessary parameters to receive an access token.
    ·  Store Access Token: Securely store the access token.
    ·  Set Up Token Refresh:
    • Include an action in the flow to call the token API with credentials to obtain a new access token.
    • Capture the response to extract the new access token.
    • Place this action above the main API call to ensure the main API call always uses a refreshed token because access tokens typically have a limited lifespan.
    ·  Make API Calls:
    • Use the valid access token retrieved from the token API in the main API call.
    Hope this helps.
     
    Thanks!
    Inogic

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 921

#2
Valantis Profile Picture

Valantis 801

#3
Haque Profile Picture

Haque 588

Last 30 days Overall leaderboard