I am using as reference this documentation: https://developer.salesforce.com/docs/atlas.en-us.uiapi.meta/uiapi/ui_api_resources_favorites.htm And it says that by doing an HTTP GET request to this url "/ui-api/favorites" it should retrieve "all of a user’s favorites.". But it seems it doesn't work. I tried the following code in Execute Anonymous and received the error "System.HttpResponse[Status=Unauthorized, StatusCode=401]"
This is the code I tried in the sandbox, by the way I included some favorites to my user so it should retrieve something.
HttpRequest req = new HttpRequest();
req.setHeader('Content-Type','application/json');
string host = 'https://AAAAA.my.salesforce.com';
String endpoint = host +'/services/data/v45.0/ui-api/favorites';
req.setMethod('GET');
req.setEndpoint(endpoint);
Http http = new Http();
HTTPResponse res = http.send(req);
system.debug(res);
Does anyone know if the Favorite API is still in use? Thanks!