I'm trying to expose a method to be accessed through HTTP Post.
@RestResource(urlMapping='/exampleURL')
global with sharing class Listener {
//Object jsonObj = JSON.deserializeUntyped(RestContext.request.requestBody);
@HttpPost
global static void someMethod(String id) {
System.debug('Got info:' + id);
}
}
I think everything looks alright with the code, and I can test it within the system and outside of the system properly. It's very simple. However, I am trying to integrate a service that does not allow me to control the headers or body of the request. They only allow me to control the endpoint.
Is there any way I can still create a HTTP api without being able to include the session ID within the headers (no control over headers). Can I somehow integrate required credentials into the endpoint so that Salesforce is happy, or somehow remove credential requirements altogether (of course I would have a way to add them back manually, no naked endpoints).
Code: 401, [ { "message": "Session expired or invalid", "errorCode": "INVALID_SESSION_ID" } ]
I can post the HTTP POST request if you'd like, but I don't see how it will matter. You can assume there are no credentials within it and I cannot put any within it.