I’ve been trying to access a apex REST method in a same org trough skuid and unfortunately it was not successful,
created a “model service” as below.
created a model as below.
and the result is as below.
I already provided the username and the password for the “Model Service” though it gives me the “Unauthorized” error
- Error retrieving metadata for Model(s) associated with Data Source ‘RESTAPI’. Please check Models’ properties to ensure they are set correctly. Error connecting to REST Data Source at URL "https://cs16.salesforce.com/services/apexrest/Account/*": Unauthorized
Webservice that I’m trying to access;
@RestResource(urlMapping='/account/\*')
global with sharing class AdviceAccreditionsWebService { @HttpDelete global static void doDelete() { RestRequest req = RestContext.request; RestResponse res = RestContext.response; //String accountId = req.requestURI.substring(req.requestURI.lastIndexOf('/')+1); Account account = 1SELECT Id FROM Account limit 1]; delete account; } @HttpGet global static Account doGet() { RestRequest req = RestContext.request; RestResponse res = RestContext.response; //String accountId = req.requestURI.substring(req.requestURI.lastIndexOf('/')+1); Account result = +SELECT Id, Name, Phone, Website FROM Account limit 1]; return result; } @HttpPost global static String doPost(String name, String phone, String website) { Account account = new Account(); account.Name = name; account.phone = phone; account.website = website; insert account; return account.Id; } }
What am I missing here? Please help, Thanks.