Skip to content

Instantly share code, notes, and snippets.

@RSpace
Created June 14, 2012 19:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RSpace/2932380 to your computer and use it in GitHub Desktop.
Save RSpace/2932380 to your computer and use it in GitHub Desktop.
Podio app auth + read item example (Restsharp reference required)
using System;
using RestSharp;
using RestSharp.Deserializers;
namespace Podio
{
class Program
{
static void Main(string[] args)
{
var client = new RestClient();
client.BaseUrl = "https://api.podio.com/";
var request = new RestRequest();
request.Resource = "/oauth/token?grant_type=app&app_id=XXXXX&app_token=XXXXX&client_id=XXXXX&client_secret=XXXXX";
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/XXXXX";
var response2 = client.Execute(request);
Console.WriteLine(response2.Content);
Console.ReadKey();
}
}
class OauthToken
{
public string access_token { get; set; }
}
}
@nickbarnwell
Copy link

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment