6

Rest API parameter are case-sensitive, Like User_Id and user_id are not interchangeable. But are services URLs also case-sensitive?

Amit Jain
  • 827
  • 1
  • 6
  • 19
Vivek Malpani
  • 670
  • 1
  • 4
  • 15

2 Answers2

5

As per salesforce documentation:

The URL mapping is case-sensitive. A URL mapping for my_url will only match a REST resource containing my_url and not My_Url.

Also if you are packaging your REST Service in a managed package your package namespace prefix is also case-sensitive.

The URL for a namespaced classes contains the namespace. For example, if your class is in namespace abc and the class is mapped to your_url, then the API URL is modified as follows: https://instance.salesforce.com/services/apexrest/abc/your_url/. In the case of a URL collision, the namespaced class is always used.

In above example if your namespace is abc you can't use ABC, Abc or any other variation of upper/lower case namespace.

Amit Jain
  • 827
  • 1
  • 6
  • 19
1

I agree to Amit and its true about custom API.

But for standard API the URI are case insensitive. (except the id part)

For ex: send request to any of following uri and it still returns valid result

  • /services/data/v35.0/sobjects/Account/0019000001AWn2oAAD
  • /services/data/v35.0/sobjects/AccOunt/0019000001AWn2oAAD
  • /services/data/v35.0/sobjects/ACCOUNT/0019000001AWn2oAAD

But if you try with case insensitive ID it will not work. for ex.

  • /services/data/v35.0/sobjects/Account/0019000001AWn2oAAd
  • /services/data/v35.0/sobjects/AccOunt/0019000001aWn2oAAD
  • /services/data/v35.0/sobjects/ACCOUNT/0019000001AWN2o

PS: for this simple test i used workbench but you can use any client and it should work

AtulRajguru9
  • 9,110
  • 3
  • 28
  • 66