Enhanced JSON API not working with POST token request

Confluence User - 02 Jul, 2025

Hi,

Following your sample for Enhanced JSON API works fine with GET method token request, but if I tried POST method to get token, it doesn't seemed to be working.

Do you have the github link for this source code? this link https://github.com/jogetoss/enhanced-json-tool seems to be out dated.

Please advise.

cheers,

Peter.

workflow;accesstoken;json;jsonapi;post

2


03 Jul, 2025
confluenceUser
confluenceUser

Hello Peter,

The github link for this source code is https://github.com/jogetoss/enhanced-json-api.

I have tried using POST method access token request, it is working fine. Please see the following screenshot.


If you face any problems, feel free to report in GitHub Issues. Thanks!

03 Jul, 2025
confluenceUser
confluenceUser

Hi,

Thanks for sharing the latest code and I found where is the problem.

This file "enhanced-json-api/src/main/java/org/joget/marketplace/util/TokenApiUtil.java", where it handles for 

MultipartEntityBuilder builder = MultipartEntityBuilder.create();

This one for my keycloak token generator requires this instead:
tokenRequest.setHeader("Content-Type", "application/x-www-form-urlencoded");

So I created another tokenRequesttype to set this content-type and after this all working fine.


cheers,

Peter.

RELATED QUESTIONS

Your answer


To answer a question you'll need an account.

Print