Hi guys,I am working on Smartdocs, I am trying to display a resource from my proxy which has an Apikey validation and hence I want to set the apikey and its value in custom token under Authentication Settings for API.
@Barahalikar Siddharth , What type of Authentication are you using to authenticate API Calls ? It should be one of Basic, OAuth, Custom Token . Are you using custom token based authentication ?
It’s a feature to set Authentication once and play with APIs instead of manually setting it in query param every time you make an API call while playing with API in smartdocs. Please use popup form to set authentication instead of query param.
As explained in SmartDocs documentation, You need to send the custom token value in the popup form provided by smartdocs. The value you give in the popup will be added to Header Or Query based on your choice in the popup form.
No need to send the custom token value separately in the query param. Once you submit popup form with value, the same will be used in further calls. It’s a feature in smartdocs so that you don’t need to send the token value in further requests while playing with APIs.
Not really @Barahalikar Siddharth, the only thing I can think of is whether the method has correctly persisted the authentication type as “custom” when you saved it. Can you see the custom check-box when you click on “Edit method”?
Thanks @Anil Sagar for remembering this issue, I have just tried this thing, it no longer asks to set custom token, but when I’m sending the request I get this error.
Can you try with new api key.. Are you sure API Key is still valid ? Are you sure you are using right policy ? Can you see trace of the API what is going on In Apigee Edge ?
@Barahalikar Siddharth The error above (“Failed to resolve API Key variable request.queryparam.apikey”) is caused when the api key is not sent as a query parameter. I usually get it when I put my API key in the headers when I should actually send it as a query parameter.