+ Start a Discussion
Dejan CvetkoskiDejan Cvetkoski 

Restfull Api

Anyone help me. I send json object with webhook to  /services/apexrest/myService/test, but i can't reseve them, my class is 
global class myWeb {
    global static void sayHello() {
        RestRequest request = RestContext.request; 
        RestResponse response = RestContext.response;
        String accountId = request.requestURI.substring(request.requestURI.lastIndexOf('/')+1);

But result after execute is System.NullPointerException: Attempt to de-reference a null object. I need send from woocommerce wordpress plugin with webhooks to salesforce. Anyone help me. Thanks :)
Hi, can you post the example of how are you sending the jSON object, i.e., your URL ?
You might also want to consider getparameter function to get the parameter, rather than requestURI substring ?
Dejan CvetkoskiDejan Cvetkoski
I send from woocommerce (plugin for wordpress). 
User-added imageUser-added image
Dejan CvetkoskiDejan Cvetkoski
User-added image