Using C# to connect with Podio App
AnsweredWe are working on creating an internal application and we want to have a vendor interface in Podio. I am using C# and I started with some code sample I found on "https://gist.github.com/2932380". I am able to connect to the application, and able to get items by item id. I have not been able to get all items.When I use the following.
RestClient client = new RestClient();
client.BaseUrl = "https://api.podio.com/";
RestRequest request = new RestRequest();
request.Resource = "/oauth/token?grant_type=app" +
"&app_id=" + APP_ID +
"&app_token=" + APP_TOKEN +
"&client_id=" + CLIENT_ID +
"&client_secret=" + CLIENT_SECRET;
request.Method = Method.POST;
request.RequestFormat = DataFormat.Json;
var response = client.Execute<OauthToken>(request);
var token = response.Data;
request = new RestRequest();
request.Method = Method.GET;
request.RequestFormat = DataFormat.Json;
request.AddParameter("oauth_token", token.access_token);
request.Resource = "/item/app/" + APP_ID +"/";
var response2 = client.Execute(request);
string content = response2.Content;
I get this responsse :
"{\"error_propagate\":false,\"error_parameters\"{},\"error_detail\":null,\"error_description\":\"Authentication as an app is not allowed for this method\",\"error\":\"forbidden\"}".
I would also like some sample code for updating items in podio using C#.
Thank you
Alejandro Carrasquilla
-
Try adding another backslash to the end of your resource path, so it looks like:
request.Resource = "/item/app/" + APP_ID +"//";
RestSharp has some weirdnesses and bugs, and this is one of them. For this reason we are also looking for another .NET library that can consume REST/JSON based API's - ideas are welcome.
-
I'm afraid the best I can offer right now is this thread from the old API mailing list:
https://groups.google.com/d/topic/podio-api/FRwKEQptcOY/discussion
Please sign in to leave a comment.
Comments
3 comments