Is it possible to Add default header parameter in request to End API

Not applicable

Hi All,

Is it possible to Add default header parameter in all my request to EndPoint API?

For Example,

I have a Parameter called &notification=1(Parameter=Value), which will be sent to EndPoint API in my all request via ApiGee proxy. But, I want ApiGee to add the 'notification=1' parameter in it's end whenever I request EndPoint API though ApiGee proxy. Can anyone please help with this?

Solved Solved
0 6 7,843
1 ACCEPTED SOLUTION

Yes, you can use the Assign Message policy to set this custom header in Target Endpoint Flow.

<AssignMessage name="assignMessage-4">
  <AssignTo createNew="false" type="request"></AssignTo>
  <Add>
    <Headers>
      <Header name="CUSTOM_HEADER_NAME">CUSTOM_HEADER_VALUE</Header>
    </Headers>
  </Add>
  <IgnoreUnresolvedVariables>false</IgnoreUnresolvedVariables>
</AssignMessage>

This will be set for all out going request from Apigee to your backend.

View solution in original post

6 REPLIES 6

Yes, you can use the Assign Message policy to set this custom header in Target Endpoint Flow.

<AssignMessage name="assignMessage-4">
  <AssignTo createNew="false" type="request"></AssignTo>
  <Add>
    <Headers>
      <Header name="CUSTOM_HEADER_NAME">CUSTOM_HEADER_VALUE</Header>
    </Headers>
  </Add>
  <IgnoreUnresolvedVariables>false</IgnoreUnresolvedVariables>
</AssignMessage>

This will be set for all out going request from Apigee to your backend.

Thank you so much, Sudheendra. Is there anyway to set body field data(to attach in all request) also the same way like header?

Yes, use the same policy. Checkout the docs page for examples - http://apigee.com/docs/api-services/reference/assign-message-policy

Thanks a lot Sudheendra. Just checked the doc and it is working fine 🙂

Hi,

I am new in APIGEE. As part of this, we need to add a header component "Authorization" with value with a header. When we do this in direct API it works but when we trying to give this through APIGEE its doesn't. we have added a header value using 'Assign message policy'. But the added header value is not getting in our end point.I have added like this.

<AssignMessage async="false" continueOnError="false" enabled="true" name="Assign-Message-1">
    <DisplayName>Assign Message-1</DisplayName>
    <AssignTo createNew="false" type="request"></AssignTo>
    <Properties/>
    <Add>
        <Headers>
            <Header name="Authorization">123456</Header>
        </Headers>
    </Add>
  
    <IgnoreUnresolvedVariables>true</IgnoreUnresolvedVariables>
    
</AssignMessage>

@Sudhee Sreedhara

How can we add consumer information such as name in the header in the target request.