ServiceCallout / LocalTargetConnection return 403

Not applicable

Hello,

I want to put a Service Callout policy to make a local call between two APIs proxy <apiproxy1> and <apiproxy2>. Both proxy APIs are in the same organization and environment.

I want to make a call from <apiproxy1> to <apiproxy2>

The url to call <apiproxy1> is as follows:

Get https://gateway.apigee.as8677.net/fat/apiproxy1/vehicles/{id}?param1={param1_value}¶m2={param2_value...

And url to call <apiproxy2> is as follows:

https://gateway.apigee.as8677.net/fat/apiproxy2/vehicles/{id}?apikey=GkdC0GZnFkrGuJ6aTs

From the <apiproxy1> EndPoints PreFlow proxy I put Service-Callout-policy :

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ServiceCallout async="false" continueOnError="false" enabled="true" name="Service-Callout-Policy">
    <DisplayName>Service Callout-Policy</DisplayName>
    <Properties/>
    <Request clearPayload="false" variable="myRequest">
        <Set>
            <QueryParams>
                <QueryParam name="apikey">GkdC0GZnFkrGuJ6aTs</QueryParam>
            </QueryParams>
            <Path>/vehicles/{flow.vehicle.id}</Path>
            <Verb>GET</Verb>
        </Set>
        <IgnoreUnresolvedVariables>false</IgnoreUnresolvedVariables>
    </Request>
    <Response>Response</Response>
    <LocalTargetConnection>
        <APIProxy>apiproxy2</APIProxy>
        <ProxyEndpoint>GetVehicle</ProxyEndpoint>
    </LocalTargetConnection>
</ServiceCallout>

I get a 403 error:

{
    "fault": {
        "faultstring": "Execution of ServiceCallout Service-Callout-Policy failed. Reason: ResponseCode 403 is treated as error",
        "detail": {
            "errorcode": "steps.servicecallout.ExecutionFailed"
        }
    }
}

Can you help me fix this problem?

Thank you

0 4 478
4 REPLIES 4

A 403 is Forbidden.

Are you sure that both proxies are in the Product that is associated with that Developer App/API Key?

The proxies are in the same Product.

When I check the API separately it works very well.

Does the API key you are passing subscribes to a product which includes apiproxy2 ?

Not applicable

We use a proxy to connect to the internet from our internal network. According to the visible error of the callout policy service the error comes from this proxy.

So we think that the requests in localhost are sent to this proxy instead of being processed directly on the machine.

Can you tell us how configure Apigee for urls in localhost /127.0.0.1 not forwarded to the proxy ?

Thanks for your help.