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
Gabriel Costa 13Gabriel Costa 13 

Custom Object not showing on Rest API

Hi,

I have custom objects that aren't showing when I make requests via REST api with server-to-server credentials.

If I make requests to https://MYORG.my.salesforce.com/services/data/v56.0/sobjects using the oauth2 token that is generated via logining my account in the popup shown, I can see all the objects. But when I use the token generated by server-to-server authentication (https://help.salesforce.com/s/articleView?id=sf.remoteaccess_oauth_client_credentials_flow.htm&type=5) the custom objects are not shown. 

What could be the reason? The 'Run as' user that is used for generate the token is different than the user that I use in the web popup to login, this user has the API Only permission and my user has PB Superuser. Could it be that? If so, where should I allow this user to see these custom objects? From what I searched the permissions seems to be the same that those that I have and I cannot put any other profile besides API Only in the 'Run as' user to server-to-server auth.

I'm also making this request that returns success with the token generated via my personal user but returns error with the token via server-to-server.

Request: https://MYORG.my.salesforce.com/services/data/v56.0/query?q=SELECT FIELDS(ALL) FROM pba__Property__c WHERE RecordTypeId='ID' LIMIT 200

Error:
"message": "\nSELECT FIELDS(ALL) FROM pba__Property__c WHERE RecordTypeId='ID'\n                        ^\nERROR at Row:1:Column:25\nsObject type 'pba__Property__c' is not supported. If you are attempting to use a custom object, be sure to append the '__c' after the entity name. Please reference your WSDL or the describe call for the appropriate names.",
        "errorCode": "INVALID_TYPE"
VinayVinay (Salesforce Developers) 
Hi Gabriel,

Is this 'pba__Property__c' object based on packag,  Do you have access package?

Thanks,