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
SF-NewBieSF-NewBie 

Login History API

Now that LoginHistory object is exposed via API I was trying that out and I am running into a problem related to Auth. I am using REST API as per instr given at http://www.salesforce.com/us/developer/docs/api_rest/index_Left.htm#StartTopic=Content/quickstart.ht...

 

I am able to do everything for the Account object as listed in there but when I try to access access LoginHistory object, it throws up an error that the resource does not exsist. I have given FULL scope for the connected app I created.

 

The command I am using is  curl https://na15.salesforce.com/services/data/v20.0/sobjects/LoginHistory -H 'Authorization: Bearer access_token' -H "X-PrettyPrint:1" with access_token replaced with the my own access_token/session id. I am getting the following response, 

 

{
"message" : "The requested resource does not exist",
"errorCode" : "NOT_FOUND"
}

 

PS: I am using a developer edition account 

 

Any inputs?

Best Answer chosen by Admin (Salesforce Developers) 
SuperfellSuperfell

IIRC, LoginHistory was added after API v20, try moving to a new API version.

All Answers

SuperfellSuperfell

IIRC, LoginHistory was added after API v20, try moving to a new API version.

This was selected as the best answer
SF-NewBieSF-NewBie

I used API v27 and that worked. Thanks SimonF.

 

I have one more question, is there an object for SetupAuditTrail that could be accessed via API?? or is the manual download through Your Name > Setup > Security Controls > View Setup Audit Trail the only option ??