{ 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 /
  • Edge/API Management /
avatar image
0
Question by sumiya · Dec 21, 2017 at 07:57 AM · 1.7k Views javascriptextractvariablesassign message policy

How to Append dynamic request path to target end point based on request method.

Hi,

I would like to send the dynamic path in the request uri to target.

1.something like this

/abc(dynamicvalue)?apikey=<apikey>

How can I do this ??

Dynamic value is fetched in extract variable.

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
0

Answer by Dino   · Dec 21, 2017 at 05:45 PM

What you describe happens automatically. For example, suppose the basepath for your API proxy is /svc1 . Suppose there is a single target endpoint with URL https://internal-server.com/foo . Then, for these given inbound requests, the pass-through API Proxy will send these outbound requests:

inbound outbound
https://org-env.apigee.net/svc1 https://internal-server.com/foo
https://org-env.apigee.net/svc1/abc https://internal-server.com/foo/abc
https://org-env.apigee.net/svc1/abc?q=def https://internal-server.com/foo/abc?q=def

You don't need to configure anything, beyond a reverse proxy, to make that happen.

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 sumiya · Dec 26, 2017 at 11:02 AM 0
Link

Hi Dino,

Thanks for the response.

I got the answer for my question.

I have done adding the dynamic path adding to the target in Javascript and it works.

avatar image NirupanchakravarthyKa sumiya · May 14, 2018 at 03:14 AM 0
Link

Can you tell me how u achieved it? I am doing the below scenario

1) i have below setup in PROXY endpoint flow (note:- * , it will be customer id)

<HTTPProxyConnection>

<BasePath>/application/tworder/v1/ip-customers/*/ip-users/</BasePath> <Properties/> <VirtualHost>secure</VirtualHost>

</HTTPProxyConnection>

2) i have below setup in TARGET endpoint flow (need to get the above cusomer id and pass in the target end point)

<HTTPTargetConnection>

<LoadBalancer>

<Server name="appTargetURL"/> </LoadBalancer>

<Path>/application/tworder/v1/ip-customers/{need to replace id value from the proxy URI value}/ip-users/</Path></HTTPTargetConnection>

ineed to cosntruct like:

https://hostName/application/tworder/v1/ip-customers/1234567890/ip-users/

How do i replace the value 1234567890 dynamically? i tried with java-script policy

var a=context.getVariable("apigee.customerId");

var b="/application/ipss/v1/ip-customers/"+a+"/ip-users/";

context.setVariable("target.url", b);

Extract Policy

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

<ExtractVariables async="false" continueOnError="false" enabled="true" name="Extract-path-variable-from-request">

<DisplayName>Extract-Path-Variable-From-Request</DisplayName> <Properties/>

<URIPath name="customerId">

<Pattern ignoreCase="true">/{customerId}</Pattern> </URIPath>

<Source clearPayload="false">request</Source>

<VariablePrefix>apigee</VariablePrefix>

</ExtractVariables>

Output:- customer is still null

http://ip-userms.sdpamp.com/application/tworder/v1/ip-customers/null/ip-users/
avatar image Dino-at-Google ♦♦ NirupanchakravarthyKa   · May 14, 2018 at 03:12 PM 0
Link

hi - Can you post your question as a new question, please?

I don't answer new questions that are posted as comments on answers to old questions.

ask-a-question.png (106.5 kB)

Follow this Question

Answers Answers and Comments

65 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 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

How to extract SOAP response attachment? 3 Answers

ExtractVariables with line break in json is not working. 2 Answers

How can i convert Xml data to Json and Json to Xml using Extract Variable or Assign Message Policy? 1 Answer

How to Extent the time to get the response from the target to make service callout request. 1 Answer

String Tokenizing the XML Text() and combination of substring decides the Flow-XPATH based 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