URL and Parameter question

I don’t know the correct terms but I have been tasked with documenting a 3rd party’s API so we can use it internally.

I’m able to get normal end points done using an URL variable and query string parameters
{{url}}/company?FEIN=

But how do you set it up when part of the path is a variable?
{{url}}/company/{CompanyKey}/planroom/file?CompanyLocationKey=

CompanyKey is not a single value but will change each request - so I didn’t think a variable like URL would be appropriate. Its not a query string parameter like CompanyLocationKey.

I’ve seen this pattern in other APIs but haven’t used Postman to document them so not sure how to set them up. Any suggestions?

Hi @bbrazeauAP,

I think I know what you’re asking for, but I’m not 100% sure.

I know you can do something with path parameter variables by doing “:var”

For example

{{url}}/company/:CompanyKey

That above will allow you to set a path parameter in your postman request. I believe I should then reflect in the documentation.

Hope this helps.

Orest

2 Likes

Perfect! That added a Path Parameter section which is what I needed. Thanks for the help!

1 Like

Glad I can help out :blush:

Hi there,

This is something I’m trying to achieve as well …

How did you set up a path parameter on postman ?

Hey @amygupta7

If you add {{url}}/company/:CompanyKey into the URL field, you should see the Path Variables section.

You should write for their documentation pages because this was what I needed but the docs SUCKED !! —>

  • Path parameters form part of the request URL, and are referenced using placeholders preceded by : as in the following example: /customer/:id
    -----path parameters section doesn’t even show up until you add the “:var”
    Clear like caught in ceiling fan.
    Thanks bro this helped !
1 Like

Welcome to the communtiy @Christianprogrammer!

Thank you, glad I can help :slight_smile:

Hey @Christianprogrammer

The docs are open source and each page has a link where they can be improve, if you feel the information is unclear:

image

PRs are very welcome :smiley: