Expand my Community achievements bar.

SOLVED

Adobe io campaign API integration with aem

Avatar

Community Advisor

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
Community Advisor

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

3 Replies

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

Community Advisor

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
Community Advisor

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