How to create Access Token using code?

Not applicable

I am able to create access token using cURL like

curl https://{my-org}-test.apigee.net/oauth/client_credential/accesstoken?grant_type=client_credentials \
-X POST -d 'client_id=GDvTAEOv4efdbbgKUBuEYcDeA0HIiCiY&client_secret=62QRTYvSfHhEwl2o'

But I want to create token using java code.

Is there any way to achieve my objective using 'Apigee API'?

Any help or hint will be appreciated.

0 4 1,097
4 REPLIES 4

@Rakesh Jain , Please search in stackoverflow / google how to make http call from Java. It should be simple & straight forward. For example , Please find post here that talks about making post call in java.

Not applicable

@Anil Sagar Thanks, this is not working...

@Rakesh Jain Please can you provide more information on what are planning?

Are you planning to create a java client outside Apigee & place requests to Apigee to create token?

What do you mean by "achieve my objective using 'Apigee API'" ?

Can you elaborate? Are you trying to make an HTTP Request from within Java ? If so there is no Apigee required for that. If the API endpoint is managed by Apigee Edge, it's irrelevant. The Java code will be the same. If you are asking something different, please elaborate.