salesforce-marketingcloud / SFDC-MC-REST-Style-Guide

REST style guidelines
31 stars 9 forks source link

Multiple Identifiers #31

Open ncorn opened 9 years ago

ncorn commented 9 years ago

Many things in the MC are retrievable by a numeric ID and by a string ID (Customer Key). Currently if the numer ID is the one and only "id" then the only way to retrieve but CustomerKey is doing a filter.

IMHO we should define a pattern or convenience edge for this. How the previous style guide did this:

/{api}/users/{id} /{api}/users/CustKey:{custkey}

One ID is essentially the primary way to retrieve the resource but there can be any number of secondary methods. Filter will work but I believe convenience edges will have the following value add:

  1. Obvious URLs that will: a. represent well in our swagger document and resulting documentation b. provide automatic convenience methods in generated SDKs based on the swagger document