• Prachi Gadewar SFDC
  • NEWBIE
  • 5 Points
  • Member since 2013
  • Cognizant

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 4
    Replies
Hello!
I created a new project with manifest in VS Code, but I am not able to authorize an Org(sandbox) to it. When I run:

sfdx force:auth:web:login --setalias <alias> --instanceurl <sanboxURL> --setdefaultusername

, it opens the authentication screen, then I insert login + password and it redirects me to localhost:1717 with the following error: 

Error authenticating with auth code due to: authentication failure
This is most likely not an error with the Salesforce CLI. Please ensure all information is accurate and try again.

,in vsc it shows me the following error:

ERROR running auth:web:login:  Invalid client credentials. Verify the OAuth client secret and ID. Error authenticating with auth code due to: authentication failure

VS Code Version: 1.56.2
SFDX CLI Version: sfdx-cli/7.102.0 win32-x64 node-v16.1.0
Salesforce Extension Pack: 51.14.0
 
I've gone through Salesforce Analytics Rest Api (http://www.salesforce.com/us/developer/docs/api_analytics/salesforce_analytics_rest_api.pdf)and implemented an apex class which will make rest call
services/data/v32.0/analytics/reports/<reportId>?includeDetails=true and get report data of a given report id, It is retrieving all the records containing in the report but my requirement is to retrieve the report data which is visible to a particular user.
Please help me out.

Thanks !
Hi,
     I have created a new user and provided the password and tried logging in to SFDC. I was able to login for the very first time.Once I logout from the application and log in to SFDC from the next time it displays me an error 'Your login attempt has failed. The username or password may be incorrect, or your location or login time may be restricted. Please contact the administrator at your company for help.'

As I am the system admin and am able to login I can say that there is no downtime also.

I am sure that the password is correct and there are no login hours/ IP restrictions. 

Could any one explain why this might be happening.

Thanks,
Karthik

 Hi,

I'm trying to call the Analytics REST API in my Apex code. I'm getting an Read Time Out exception. Can someone look at it and let me know what can be the issue.

The code snippet and debug log is given below:

   HttpRequest req = new HttpRequest();
  //Set HTTPRequest header properties
  req.setMethod('GET');


  req.setHeader('content-type', 'application/json.');
  req.setHeader('Content-Length','1024');
  req.setEndpoint( URL.getSalesforceBaseUrl().toExternalForm() + '/services/data/v29.0/analytics/reports/00OQ0000000epc5');
  req.setHeader('Authorization', 'Bearer ' + UserInfo.getSessionID());

  Http http = new Http();
 
   try {
 
        //Execute web service call here    
        HTTPResponse res = http.send(req); 


       
} catch(System.CalloutException e) {
   
}  

Debug Log:

   
21:27:35.060 (60501282)|CALLOUT_REQUEST|[28]|System.HttpRequest[Endpoint=https://test.salesforce.com/services/data/v29.0/analytics/reports/00OQ0000000epc5, Method=GET]
21:27:45.079 (10079369700)|EXCEPTION_THROWN|[28]|System.CalloutException: Read timed out