{ Community }
  • Academy
  • Docs
  • Developers
  • Resources
    • Community Articles
    • Apigee on GitHub
    • Code Samples
    • Videos & eBooks
    • Accelerator Methodology
  • Support
  • Ask a Question
  • Spaces
    • Product Announcements
    • General
    • Edge/API Management
    • Developer Portal (Drupal-based)
    • Developer Portal (Integrated)
    • API Design
    • APIM on Istio
    • Extensions
    • Business of APIs
    • Academy/Certification
    • Adapter for Envoy
    • Analytics
    • Events
    • Hybrid
    • Integration (AWS, PCF, Etc.)
    • Microgateway
    • Monetization
    • Private Cloud Deployment
    • 日本語コミュニティ
    • Insights
    • IoT Apigee Link
    • BaaS/Usergrid
    • BaaS Transition/Migration
    • Apigee-127
    • New Customers
    • Topics
    • Questions
    • Articles
    • Ideas
    • Leaderboard
    • Badges
  • Log in
  • Sign up

Get answers, ideas, and support from the Apigee Community

  • Home /
  • General /
avatar image
0
Question by Harsh Sharma · Mar 15, 2017 at 10:49 AM · 149 Views Apigee API

How to read extracted variables in target point url ?

Hi All,

I have a target URL as below in my app, which takes firstName and lastName as below,

/createUser/firstName/:firstName/lastName/:lastName

I used the QueryParameters in the Extract Variable policy to read the firstName and lastName values from URL, its working.

Now in targetEndpoint i used the above URL as,

<HTTPTargetConnection>
        <Properties/>
        <URL>http://<myhost>/createUser/firstName/:firstName/lastName/:lastName</URL>
    </HTTPTargetConnection>

Now, how can i tell apigee to put the extracted values of firstName and lastName in extract variable policy. I am unable to pass those values in the target URL above.

Thanks for your help in advance.

Comment
Add comment
10 |5000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by Apigeeks only
  • Viewable by the original poster
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Close

1 Answer

  • Sort: 
avatar image
1

Answer by Ricardo de Andrade   · Mar 15, 2017 at 02:22 PM

The easiest way is to leave the basepath as /createUser as well as the target to end at /createUser

By default the platform will append paths and query parameters to the request that goes to the target.

Now, trying to not be nitpicking and to not hijack the thread, but the design of the API itself would be better if you had something along the lines of:

POST /users

{

"firstName": "...",

"lastName": "...",

...

}

And in your response it would return a unique id to the user that could be referenced to GET it as /users/{userId}

Comment
Add comment Show 3 · Link
10 |5000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by Apigeeks only
  • Viewable by the original poster
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Harsh Sharma · Mar 15, 2017 at 03:09 PM 0
Link

So, what you want to say is that i should write target url as,

<URL>http://<myhost>/createUser</URL>

instead of,

<URL>http://<myhost>/createUser/firstName/:firstName/lastName/:lastName</URL>
avatar image Ricardo de Andrade ♦ Harsh Sharma   · Mar 15, 2017 at 06:21 PM 0
Link

correct, anything that you append beyond your basepath will be added to the target

for example:

basepath /createUser

request /createUser/firstName/John/lastName/Smith

target will be: /createUser/firstName/John/lastName/Smith

avatar image Harsh Sharma Ricardo de Andrade ♦ · Mar 16, 2017 at 06:20 AM 0
Link

Thanks Ricardo, this worked like a charm for me....

Follow this Question

Answers Answers and Comments

37 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

503 Unavailable Service Response 2 Answers

Error: Cannot find module 'cheerio' apigee 3 Answers

How to configure websphere server to connect with Apigee? 1 Answer

Apigee Reports API 1 Answer

How to update developer data? 1 Answer

  • Products
    • Edge - APIs
    • Insights - Big Data
    • Plans
  • Developers
    • Overview
    • Documentation
  • Resources
    • Overview
    • Blog
    • Apigee Institute
    • Academy
    • Documentation
  • Company
    • Overview
    • Press
    • Customers
    • Partners
    • Team
    • Events
    • Careers
    • Contact Us
  • Support
    • Support Overview
    • Documentation
    • Status
    • Edge Support Portal
    • Privacy Policy
    • Terms & Conditions
© 2021 Apigee Corp. All rights reserved. - Apigee Community Terms of Use - Powered by AnswerHub
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Create an article
  • Post an idea
  • Spaces
  • Product Announcements
  • General
  • Edge/API Management
  • Developer Portal (Drupal-based)
  • Developer Portal (Integrated)
  • API Design
  • APIM on Istio
  • Extensions
  • Business of APIs
  • Academy/Certification
  • Adapter for Envoy
  • Analytics
  • Events
  • Hybrid
  • Integration (AWS, PCF, Etc.)
  • Microgateway
  • Monetization
  • Private Cloud Deployment
  • 日本語コミュニティ
  • Insights
  • IoT Apigee Link
  • BaaS/Usergrid
  • BaaS Transition/Migration
  • Apigee-127
  • New Customers
  • Explore
  • Topics
  • Questions
  • Articles
  • Ideas
  • Badges