I am trying to pass query parameter in APIM using frontend edit option in respective API. There is no 'example' option in query parameter and in header to set. But in developer portal we are getting option for example field which is blank.

Pandey, Rijul (Developer) 0 Reputation points
2023-11-02T18:17:32.2666667+00:00

I am trying to publish API on developer portal. I am adding query parameter and header from APIM-> respective API->operation->frontend edit.
When I add query parameter and header there are 6 field to fill in APIM console for adding query parameter and header and those are, Name, Description, Type, Value, Required and delete. When I publish changes to developer portal. Query gets added there but there is additional field ''example" before 'description' and it is blank. How to give the value for 'example' field ?

Azure API Management
Azure API Management
An Azure service that provides a hybrid, multi-cloud management platform for APIs.
1,530 questions
{count} votes

1 answer

Sort by: Most helpful
  1. MuthuKumaranMurugaachari-MSFT 18,341 Reputation points
    2023-11-02T21:28:48.45+00:00

    Pandey, Rijul (Developer) Thanks for posting your question in Microsoft Q&A. Based on the description above, you have added a query parameter in APIM and looking to know how to add an example so that it gets displayed in the developer portal.

    Navigate to APIM -> API -> Operations -> Frontend edit -> OpenAPI specification view and then in the parameter section, add an example section (outside schema) like below:

    "get": {
                    "summary": "Retrieve resource",
                    "description": "A demonstration of a GET call on a sample resource. It is handled by an \"echo\" backend which returns a response equal to the request (the supplied headers and body are being returned as received).",
                    "operationId": "retrieve-resource",
                    "parameters": [{
                        "name": "queryparam1",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        },
                        "example": "value1"
                    }],
                    "responses": {
                        "200": {
                            "description": "Returned in all cases."
                        }
                    }
                }
    

    Then save the changes and refresh the developer portal. You should be able to see the value displayed in the Example section like below:

    User's image

    I hope this helps and let me know if any questions. If your scenario is different, please share the screenshot of developer portal, that will help in understanding better.


    If you found the answer to your question helpful, please take a moment to mark it as Yes for others to benefit from your experience. Or simply add a comment tagging me and would be happy to answer your questions.

    0 comments No comments