You need to sign in to do that
Don't have an account?
Bill Mc
unknown exception when inserting Case in REST APEX
am attempting to insert a Case object in response to a REST post request (its a web hook for a customer support chat service).
I can insert a custom object fine.
But when I try to insert a Case I get : UNKNOWN_EXCEPTION, invalid parameter value: [].
I have tried the exact same code outside of the REST Apex class and it works fine.
All help appreciated.
Kind regards, Bill
@RestResource(urlMapping='/test')
global class TestWebHook {
@HttpGet
global static String doGet() {
}
@HttpPost
global static String doPost() {
Case mycase = new Case();
insert mycase;
}
I can insert a custom object fine.
But when I try to insert a Case I get : UNKNOWN_EXCEPTION, invalid parameter value: [].
I have tried the exact same code outside of the REST Apex class and it works fine.
All help appreciated.
Kind regards, Bill
@RestResource(urlMapping='/test')
global class TestWebHook {
@HttpGet
global static String doGet() {
}
@HttpPost
global static String doPost() {
Case mycase = new Case();
insert mycase;
}
Step 2: Go to workbench then utilities --> Apex Rest exporter as shown below
https://workbench.developerforce.com/restExplorer.php
and use this body
Click on Execute it will create a case and you can able to see the response