Sales force showing custom objects via REST API

I am new to sales and I have a problem. I would like to manipulate (create, update, delete and select) data from my user objects using the REST API.

I managed to get the sample to work, and it sends me account information. Details

Now I would like to do the same for the created custom object.

I tried this code but it does not work.

HttpClient httpclient = new HttpClient(); GetMethod get = new GetMethod(instanceUrl + "/services/data/v22.0/sobjects/Employee__c/EC-1000"); get.setRequestHeader("Authorization", "OAuth " + accessToken); httpclient.executeMethod(get); System.out.println("Status:" + get.getStatusCode()); System.out.println("Status Text:" + get.getStatusText()); 

Exit: Status: 404 Status Text: not found

I created an object named employee and ID EC-1000.

The above works for default objects that are an account.

+7
source share
1 answer

It works exactly the same, except that instead of using the name of the standard object, you use your custom object API name, for example. If you have a custom object called Handsets, its api name will be Handsets__c, and you can POST on /services/data/v22.0/sobjects/Handsets__c to create a new one.

To access a specific record, you will need a record identifier of 18 characters, just like for an account (or you need to configure the external interface).

+11
source

All Articles