can not work "Standard Policy Template -API Key" assertion

Document ID : KB000009115
Last Modified Date : 14/02/2018
Show Technical Document Details
Issue:

Can not work  "Standard Policy Template -API Key" assertion

 

Reappearance process 

01. publish an API on the API proxy 

02. add "Standard Policy Template -API Key" assertion 

But the API doesn't work suitably. 

 

Result: Return the error "Unable to route to API". 

Environment:
API Gateway 9.2API Portal 4.2
Cause:

The policy should also contain the apiLocation and serviceUrl (value: API name) context variables for routing

Resolution:

Work asourd:

01. Add tow "Set Context Varliable" befor "Standard Policy Template -API Key"

02. Set the values as the each parameter.

    . Variable Name : apiLocation Expression :{URL of Back End} 

    .Variable Name : serviceUrl Expression : {API Name}