Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Salesforce by (13.1k points)
I was trying to create a case in Amount object using REST API. How can I go about doing this?

1 Answer

0 votes
by (26.7k points)
edited by

Basically, first of all you need to login and get your session ID after that, try the below code:

POST to 

    https://yourinstance.my.salesforce.com/services/data/v48.0/sobjects/Case

with header 

    Authorization Bearer <session id goes here, sometimes called "access token" too>

and body

    {

        "Subject": "Hello world",

        "Description": "Lorem ipsum dolor sit amet...",

        "Origin":"Web",

        "AccountId" :"0010g00001mbqU4"

    }

Also, use python libraries for Salesforce.

I hope this will help.

Want to become a Salesforce Expert? join Salesforce Apex Training now!!

Want to know more about Salesforce Apex? Watch this video on Apex in Salesforce | Salesforce Tutorial:

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...