Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

[AEM Gems Webinar] Accelerating Experience Manager as a Cloud Service development with Rapid Development Environments
SOLVED

Adobe io campaign API integration with aem

Avatar

Level 4

Hi,

I am trying to create campaign event through my AEM java code but not able to do so. In the process of creating a bearer or access token I have written below logic but it seems to be failing and giving 500 internal server error.
Below is the code snippet:-

Tarun202_0-1649340789099.png

While I am able to create Bearer token using postman but not programmatically.

Any help would be much appreciated.

1 Accepted Solution

Avatar

Correct answer by
Level 4

I was able to solve it.  Just simulated the behavior wit postman call in my java code and it worked.

View solution in original post

1 Reply

Avatar

Community Advisor

Hey,

Can I know which method you are writing in your servlet?

if it is a post and trying from localhost then make sure in your config manager you remove the POST from Referrer filter.

Avatar

Level 4

Hi @Prince_Shivhare 

 

I am using Get method in my servlet. Looking at below screen print I am getting issue at highlighted part where I am getting 500 internal server error in response. Due to this I am not able to create access token.
Though with the same jwttoken created from below code at line number 148 I am able to get access token using Postman.

Tarun202_1-1649968205397.png

 

 




Avatar

Correct answer by
Level 4

I was able to solve it.  Just simulated the behavior wit postman call in my java code and it worked.