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
seth dorris 7seth dorris 7 

Custom REST API Unauthorized Issue PLEASE HELP!

So I have created a custom REST API that I have tested and validated in workbench.. 

I have successfully parsed the OAuth Access Token from the URL in order to set headers to make an HTTP Call to my custom REST API.

Why then.. am I still getting a 401 Unauthorized Access error when making the HTTP request?

Here is my http request (using angular's http service)
 
$http({
        	method: "GET",
        	url: "https://na30.salesforce.com/services/apexrest/activities",
        	headers: {
            	"Authorization": "Bearer " + token
        	}
    	}).then(function (data) {
        	console.log("data", data)
    	})

 
pconpcon
If you try the same call using cURL (example below) does that call work?
 
curl -v -H "Authorization: Bearer token" https://na30.salesforce.com/services/apexrest/activities