External API activity - Authentication token | Community
Skip to main content
Level 2
May 21, 2025
Solved

External API activity - Authentication token

  • May 21, 2025
  • 2 replies
  • 1082 views

Hi,

 

I'm planning to send some data from ACS via External API activity to Dynamics 365, but Dynamics 365 authentication token expires every 1hr, I can't be able to send data out automatically (need to manually update the token after it expires). Could anyone please suggest what needs to be done to fetch new authentication token after expiration / after 1hr.

 

Thanks!

Best answer by ccg1706

Hi @dharsanprakash,

 

I had a project in where we  implemented OAuth 2.0 client credentials flow, this what it does is that requests a new token from Azure before each API call from ACS. You might be able to cover it, by building a middleware endpoint that ACS can call. This middlepoint will handle token generation and will forward it the data to Dynamics 365, so in this way ACS doesn't deal with token expiration directly.

 

You can chech the following documentation on the External API activity in ACS:

External API Acs 

 

Hope it helps and if you need more information just let me know!

Best, 

Celia

 

 

2 replies

ccg1706
Community Advisor
ccg1706Community AdvisorAccepted solution
Community Advisor
May 21, 2025

Hi @dharsanprakash,

 

I had a project in where we  implemented OAuth 2.0 client credentials flow, this what it does is that requests a new token from Azure before each API call from ACS. You might be able to cover it, by building a middleware endpoint that ACS can call. This middlepoint will handle token generation and will forward it the data to Dynamics 365, so in this way ACS doesn't deal with token expiration directly.

 

You can chech the following documentation on the External API activity in ACS:

External API Acs 

 

Hope it helps and if you need more information just let me know!

Best, 

Celia

 

 

Level 2
May 21, 2025

Hi @ccg1706, thanks for your response, but I'm not sure how to set the middleware endpoint, could you please guide me on this, also in ACS document it is mentioned that redirect is not allowed in new update. I have attached screenshot for the reference.

 

Thanks!

SatheeskannaK
Community Advisor
Community Advisor
May 21, 2025

@dharsanprakash Dyanmics 365 should have an OAuth mechanism to connect from any external system. I would suggest getting the OAuth API credentials and configuring that as an external connection in ACS for the automatic exchange of tokens when they expire.

https://community.dynamics.com/forums/thread/details/?threadid=ec14d4d7-2c15-ee11-8f6e-000d3a4e5de0

https://experienceleague.adobe.com/en/docs/campaign-standard/using/administrating/application-settings/external-accounts#oauth-account

 

Thanks, Sathees