Skip to main content
our client is supposed to send us notification after the resuts has been reviewd. 

1) approval notification 

2)Results  are  availble

these are the urls they asked me to  set up in our end 

http://example.com/notif?id={id}&status=approved

http://example.com/notif?id={id}&status=resulted[&result_type={result}]

For that . I need to setup up an apex class as a REST endpoint for an HTTP GET request that an external system is sending notification.

Please le me know is the right way do or please guide me 

@RestResource(urlMapping='/sample/approvalnotifications')

global without sharing class Rest_Approval_Notification {

@HttpGet

global static void doGet() {

System.debug(RestContext.request.requestBody);

restresponse res=restcontext.response;

String notification_id = RestContext.request.params.get('id');

String notification_status = RestContext.request.params.get('status');

System.debug(notification_id);

System.debug(notification_status);

//hadling error code and logic for processing

}

}

 

 
4 个回答
  1. 2018年1月15日 19:17
    Hi Amit ,  Thank you .I cheked that using this test method and postmal as well. it seems woking 

    I have question on this folowwing and how do i use the paarameter for this  [&result_type={result}]. parynot undestanding properly. 

    http://example.com/notif?id={id}&status=resulted[&result_type={result}]
0/9000