function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Marin ZaimovMarin Zaimov 

Creating a REST API errors and debugging - An unexpected error occurred. Please include this ErrorId if you contact support:

Hi guys,

I am creating my own REST API.
I was able to succesfully do @HttpPost

I am now working on @HttpGet and getting the following error from my curl request:

[][{"message":"An unexpected error occurred. Please include this ErrorId if you contact support: 22838684-12976 (2061038835)","errorCode":"UNKNOWN_EXCEPTION"}]

What does this mean and how can you guys use it to help me get my API running?

Also, how can i test and debug my Web service without having to contact support every time?
Here is my curl command:

curl --request GET -H 'Authorization: OAuth 00Do0000000KyIg!ASAAQAUD3IsQkLkjFArVq6RvMadk41WNticN9ZgGHa7Iozs0euGa9XVG7LMEysX6C_SIVcCNrr4NA5a62k2lrGgNTLtyXepJ' 'https://na17.salesforce.com/services/apexrest/QuotePreview?quoteId=a0Fo00000026dOXEAY'

and Php code used to run a get:

$quoteId = 'a0Fo00000026dOXEAY';
  $quoteurl = "https://na17.salesforce.com/services/apexrest/QuotePreview?quoteId=".$quoteId;
  $curl = curl_init();
  curl_setopt($curl, CURLOPT_URL, $quoteurl);
  curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
  curl_setopt($curl, CURLOPT_HTTPHEADER,
          array("Authorization: Bearer $accessCode",
           "Content-type: application/json"));
  curl_setopt($curl, CURLOPT_HTTPGET, true);

  $json_response = curl_exec($curl);


AshwaniAshwani
The most possible reason can be the Apex class has some compile errors. Please check apex class by compile all classs in organisation. Enable debug log for Salesforce user on behalf you are calling out. You should see debugs for the class. I hope you are using connected apps. Look at the following post to identify debug: http://salesforce.stackexchange.com/questions/38825/debug-log-application-unknown
Pramod_SFDCPramod_SFDC
Hi,

Is there an Error Id, which you have received in a EMAIL by Salesforce. ?

Regards
Pramod