• Gabriel Costa 13
  • NEWBIE
  • 15 Points
  • Member since 2023

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 2
    Replies
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"
Hi,

I have custom objects created by PropertyBase and I'm making a query via REST api through this get request: 

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

When I put the auth token that is generated via OAuth2 Authorization with the web popup to login with my account, I can see the records. But when I tried to use the token generated with Client Credentials Flow for Server-to-Server I receive this 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"

I see that if I call default objects from Salesforce with this token I got results with no problem. 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. 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.
Hi,

I have a 'Property' object that has some images and other media attached to it. How can I get the images/files associated with this object in SOQL?

This is the section where the files are stored

User-added image
Hi,

I have a 'Property' object that has some images and other media attached to it. How can I get the images/files associated with this object in SOQL?

This is the section where the files are stored

User-added image