Find User by User Email
AnsweredI am currently working on adding a ContatctItemField to a Podio Item, however I need to know the user profile Id, at the moment I only have the Name and Email of the user, is there an easy way to find the user profile by Email.
By the way I am using the .Net Api
-
You can use https://developers.podio.com/doc/contacts/get-contacts-22400 and filter on "mail"
All the best,
Andreas -
Thanks for your answer, Could you please provide an example, I am not able to filter by mail in the Sand Box.
In addition to this i am get an Unauthorized response when doing the following call. Please helpstring requestUrl = Podio.API.Constants.PODIOAPI_BASEURL + "/contact/" + "?" + "contact_type=user&exclude_self=false&order=name&required=name%2Cmail&type=mini";
// request the api
Podio.API.Utils.PodioRestHelper.PodioResponse response = Podio.API.Utils.PodioRestHelper.Request(requestUrl, client.AuthInfo.AccessToken);var result = response.Data;
-
You need to set a query param with an email address: mail=yourmail@example.com
As for the unauthorized response: You need to authenticate before you can make API calls. More details here: https://developers.podio.com/authentication
/Andreas
-
I am authenticated. When I call to get all Contacts with no attributes I get the first 500 users. Please Help
string requestUrl = Podio.API.Constants.PODIOAPI_BASEURL + @"/contact/";
However when I try to add attributes such as the email I get the unauthorized response.
string requestUrl = Podio.API.Constants.PODIOAPI_BASEURL + @"/contact/?mail=email@sample.com";
-
I figured it out, I had to put the requestData in the request and not in the request Url. Thanks for your help
Dictionary<string, string> requestData = new Dictionary<string,string>();
requestData.Add("mail", email);string requestUrl = Podio.API.Constants.PODIOAPI_BASEURL + @"/contact/";
// request the api
Podio.API.Utils.PodioRestHelper.PodioResponse response = Podio.API.Utils.PodioRestHelper.Request(requestUrl, client.AuthInfo.AccessToken, requestData, Podio.API.Utils.PodioRestHelper.RequestMethod.GET);
Please sign in to leave a comment.
Comments
6 comments