How can I append a query parameter in the Target Url

Not applicable

I am a beginner in apigee.

I have a very basic question: I will have to append a query parameter in my target endpoint URL.

For example: A Get operation

http://abc-company-api/v1/data/sales?authcode=yuozerrt

Also please note, this is not a dynamic parameter. It will remain same until my vendor changes it. My questions:

  1. how should I add this authcode query parameter when I consume the target endpoint? This is not a header parameter.
  2. What is the best practice when deal with similar type of query parameter.

Thank you.

1 1 4,482
1 REPLY 1

  1. how should I add this authcode query parameter when I consume the target endpoint? This is not a header parameter.

Use an AssignMessage policy. Configure it like this:

<AssignMessage name='AM-ApplyAuthCode'>
  <Set>
    <QueryParams>
      <QueryParam name='authcode'>yuozerrt</QueryParam>
    </QueryParams>
  </Set>
</AssignMessage>

Attach this policy to the Request flow (PreFlow or PostFlow or whatever) of the Target Endpoint.

This is the best practice.