You need to sign in to do that
Don't have an account?
Shazib Mahmood
Tooling API query not working for non system administrator
Hello,
In order to grab custom field IDs, I added a tooling API query. Any profile without "View All Data" gets the following response for HTTP Request.
The standard profile does have API enabled permission and full CRED access on any involved object. The Apex class has "Without Sharing" tag as well.
CALLOUT_RESPONSE|[58]|System.HttpResponse[Status=Bad Request, StatusCode=400]
Sample Code:
I need to either:
1. Adjust the non-system admin profile, so that its SessionId gets a proper response like a profile with "View All Data" e.g system admin.
2. Somehow use a sessionId that doesnt belong to current session's profile holder. Use a system admin's sessionid WITHOUT embedding their username and password anywhere.
3. Get further debugging information from the HTTP response. I am not really sure about the specifics of why its a "bad request".
Any guidance would be appreciated. Thanks
In order to grab custom field IDs, I added a tooling API query. Any profile without "View All Data" gets the following response for HTTP Request.
The standard profile does have API enabled permission and full CRED access on any involved object. The Apex class has "Without Sharing" tag as well.
CALLOUT_RESPONSE|[58]|System.HttpResponse[Status=Bad Request, StatusCode=400]
Sample Code:
String query = 'SELECT Id From CustomObject Where DeveloperName = \'' + objectName + '\''; String endpoint = Url.getSalesforceBaseUrl().toExternalForm(); endpoint += '/services/data/v29.0/tooling/query/?q='; endpoint += EncodingUtil.urlEncode(query, 'UTF-8'); HttpRequest request = new HttpRequest(); request.setMethod('GET'); request.setHeader('Authorization', 'Bearer ' + UserInfo.getSessionId());
I need to either:
1. Adjust the non-system admin profile, so that its SessionId gets a proper response like a profile with "View All Data" e.g system admin.
2. Somehow use a sessionId that doesnt belong to current session's profile holder. Use a system admin's sessionid WITHOUT embedding their username and password anywhere.
3. Get further debugging information from the HTTP response. I am not really sure about the specifics of why its a "bad request".
Any guidance would be appreciated. Thanks
All Answers
Thanks for sharing amazing post
mobile mechanic reading (https://smartservicingcentre.co.uk)
celebritiesdata (https://celebritiesdata.com/)
Thanks for sharing
https://etisalatspeedtest.site (https://etisalatspeedtest.site/)
https://speed.ptclbill.info/ptcl-speed-test (https://speed.ptclbill.info/ptcl-speed-test/)
airtel balance check (https://mybalancetoday.com)
airtel ussd codes (https://mybalancetoday.com/airtel-ussd-codes)
https://ptclbill.info/ptcl-duplicate-bill