REST API parameters should use IDs instead of Names

Subscribe

REST API parameters should use IDs instead of Names

It would be great if API parameters took an ID instead of a name for parameters, specifically where program name is a parameter. Program IDs don't change, the UI allows a user (likely in a completely different department) to change a program name and break something they may know nothing about.

This is a common principle of REST, is there a compelling reason to use name?

3 Comments
Kenny_Elkington
Marketo Employee

To answer your question, no there really isn't a compelling reason.  Are there specific endpoints that you're referring to that accept name, but not ID?

Ryan_Hagg
Level 1

Hi Kenny, thanks for taking the time to ask for specifics. We were using:

POST /rest/v1/leads/push.json

If someone got to our final checkout page (indicating they had successfully completed a transaction) we would push a program status to the lead. We hard coded name into our API call

PushLeadToMarketoRequest {

input (Array[Lead], optional),

lookupField (string, optional),

partitionName (string, optional),

programName (string, optional),

programStatus (string, optional),

reason (string, optional),

source (string, optional)

}

and then the unit that we don't manage changed the program name in Marketo. Thus we had to go in and change the hard coding. I will update this thread with others times we encounter this name vs. id scenario. I know we've run into it at least one other time.

Thanks again!

kh-lschutte
Community Manager
Status changed to: Open Ideas