Assign a variable value to a parameter in proxy chaining

cboyd
Participant II

Hello All,

Another newbie question here....

I have two APIs ("A" and "B").

Someone makes a call to "A".

Apigee extracts one of the JSON elements (Extract Variable) and calls API "B" to make sure that value is valid.

So I know how to extract the variable and I am using a Service Callout to make the call to "B".

My question is how do I assign that extracted variable from the call to "A" to the query parameter of the call to "B"?

Thanks.

Solved Solved
0 2 311
1 ACCEPTED SOLUTION

sidd-harth
Participant V

Well one way is to pass the extracted variables as request queryParams using Service callout policy Request >> Set variables.

<ServiceCallout async="false" continueOnError="false" enabled="true" name="Service-Callout-1">
    <DisplayName>Custom label used in UI</DisplayName>
    <Request clearPayload="true" variable="myRequest">
        <IgnoreUnresolvedVariables>false</IgnoreUnresolvedVariables>
        
        <Set>
            
            <QueryParams>
<></>            
</QueryParams>
            
        </Set>
    </Request>
    <Response>calloutResponse</Response>
    <Timeout>30000</Timeout>
   
    <LocalTargetConnection>
        <APIProxy/>
        <ProxyEndpoint/>
        <Path/>
    </LocalTargetConnection>
</ServiceCallout>

View solution in original post

2 REPLIES 2

sidd-harth
Participant V

Well one way is to pass the extracted variables as request queryParams using Service callout policy Request >> Set variables.

<ServiceCallout async="false" continueOnError="false" enabled="true" name="Service-Callout-1">
    <DisplayName>Custom label used in UI</DisplayName>
    <Request clearPayload="true" variable="myRequest">
        <IgnoreUnresolvedVariables>false</IgnoreUnresolvedVariables>
        
        <Set>
            
            <QueryParams>
<></>            
</QueryParams>
            
        </Set>
    </Request>
    <Response>calloutResponse</Response>
    <Timeout>30000</Timeout>
   
    <LocalTargetConnection>
        <APIProxy/>
        <ProxyEndpoint/>
        <Path/>
    </LocalTargetConnection>
</ServiceCallout>

Thanks @Siddharth Barahalikar ~ I appreciate the helpful answers and your explanations.

Sincerely,

Craig