You need to sign in to do that
Don't have an account?
SF-NewBie
LoginHistory API - UserName Field
Hi,
I am accessing Login History Object using CuRL to API v27.0. curl https://na15.salesforce.com/services/data/v20.0/sobjects/LoginHistory -H 'Authorization: Bearer access_token' -H "X-PrettyPrint:1". I was hoping to get all the fields as I would get by downloading Excel sheet by going to Manage Users | Login History.
But the API call could yield only USERID as opposed to USERNAME as I would get by downloading Excel Sheet.
1) Is this a limitation of API or am I missing anything??
2) Is there a way to map USERID -> USERNAME ??
Any help would be appreciated.
All Answers
These are the fields that you should be able to access uisng API http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_objects_loginhistory.htm
I guess you can include some thing like User.Name in your query, the object seems to haev relationship with user
Thanks Avi. In the list of fields given at I http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_objects_loginhistory.htm, I cannot see USERNAME, so I was wondering whether Salesforce does not open it??
I tried giving UserName, User.Name in my queries but it does not return anything. I would have hoped salesforce did better job with exposing all fields in API, but would there be a way to atleast map UserID -> UserName??
1. From first call collect all the user ids
2. Query using these userid to SF and map it
I am to able to do step 1. But, it looks like SF doesn't provide any handle for mapping UserID to UserNames. Any idea?
Avidev9. Thanks for the reply but the User Object does not have a UserID field - http://www.salesforce.com/us/developer/docs/api/index_Left.htm#CSHID=sforce_api_objects_loginhistory.htm|StartTopic=Content%2Fsforce_api_objects_loginhistory.htm|SkinName=webhelp
Any comments?