Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
203 views
in Technique[技术] by (71.8m points)

spring - Calling multiple API in sequence with token in java

I have to call 5 APIs in sequence after generating the token. i am using below API to generate token.

POST https://idcs-xxxx.identity.c9dev2.oc9qadev.com/oauth2/v1/token

I will send username and password to get token in above API. Once token will be received I will have to use the same token to call below 5 APIs in sequence. I will use output of one API and filter it and pick some values as an input to next API. all the rest endpoint will change based on the input value of previous API response.

GET https://idcs-xxxx.identity-t0.data.digitalassistant.oci.oc-test.com/api/v1/skills

GET https://idcs-oda-9417f93560b94eb8a2e2a4c9aac9a3ff-t0.data.digitalassistant.oci.oc-test.com/api/v1/skills/dynamicEntities

POST https://idcs-xxxx.identity-t0.data.digitalassistant.oci.oc-test.com/api/v1/bots/xxx/v2/yyy

PATCH https://idcs-xxxx.identity-t0.data.digitalassistant.oci.oc-test.com/api/v1/bots/xxx

PUT https://idcs-xxxx.identity-t0.data.digitalassistant.oci.oc-test.com/api/v1/bots/xxx/DONE

How can I automate token generation and the same token can be used in every API call. token will expire in every one hour. My only purpose is to automate above process somehow. even smallest help would be highly appreciated. you can suggest even some part of solution if not all. I could not get much material from google.

Rather than coding I am interested in architecture.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...