Skip to content

Instantly share code, notes, and snippets.

@RSpace RSpace/gist:2932380
Created Jun 14, 2012

Embed
What would you like to do?
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

This comment has been minimized.

Copy link

commented Jun 17, 2012

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.