forcedotcom / postman-salesforce-apis

Salesforce API Postman Collection
Creative Commons Zero v1.0 Universal
1.07k stars 651 forks source link

Suggestion: Use Path Variables instead of placeholders in URL's #48

Closed cmatos23 closed 3 years ago

cmatos23 commented 3 years ago

Hi,

This is a suggestion for every API call with a path parameter that might change from request to request (ex. SObject, Record Id, etc.). Currently, there are placeholders in every URL with this type of path parameter (ex. ). This suggestion is to use path variables instead of placeholders (https://learning.postman.com/docs/sending-requests/requests/#sending-parameters)

Ex. Describe SObject Layouts Per Record Type

URL is as follows: {{_endpoint}}/services/data/v{{version}}/sobjects/<SOBJECT_API_NAME>/describe/layouts/<RECORD_TYPE_ID>

with this suggestion URL would be: {{_endpoint}}/services/data/v{{version}}/sobjects/:SOBJECT_API_NAME/describe/layouts/:RECORD_TYPE_ID image

With suggestion, user would not have to directly the modify the URL to update the SOBJECT_API_NAME or RECORD_TYPE_ID and can use Path Variables in the "Params" tab of the request. Using this method, another benefit would be the ability to add a description for each path variable

pozil commented 3 years ago

Hi @cmatos23, thanks for reaching out, that's a great idea. We'll work on it. I'll leave this issue open in the meantime.

pozil commented 3 years ago

Hi @cmatos23, we just implemented that and updated the collection. Thanks again for the great idea.