-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathREADME
46 lines (33 loc) · 2.15 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
*This is a custom C# implementation of Instagram APIs. *
Has been built with Visual Studio 2010, and .NET 4.0.
It is compatible with .NET 2.0 (just rebuild changing version).
This implementation is based on a base class that handles the basic behaviours
and can be coupled with a caching mechanism to improve the app efficiency.
*Instructions*
1 add the 2 projects to your solution
2 reference Instagram Api from your main project
3 download and reference JSON.net (needed by api base class) http://json.codeplex.com/
4 signup with instagram and create an application http://instagram.com/developer
5 create an API instance
6 create a configuration object and fill all the needed data (app id, secret...)
7 optionally implement the ICache interface (a simple wrapper for asp.net cache would go)
8 use the api
Example
Instagram.api.Configuration config = new Instagram.api.Configuration(
authurl, //url of the authorization request endpoint
clientid, //client id, as created by IG for your app
clientsecret, //client secret, as created by IG for your app
callbackurl, //url of the page, in your app, where the user is redirected after logon
tokenurl, //url of the token request page
instagramapibase, //base url of the instagram api http://instagram.com/api/v1/
webproxy //string representing a web proxy: 127.0.0.1:8080
);
InstagramApiWrapper _api = InstagramApiWrapper.GetInstance(config, cacheManager);
*Authentication Note:*
Instagram uses a OAuth 2 authentication scheme (like twitter, facebook and others), this means that you have to:
1- create an instagram application on instagram website and add the app token to your webapp
2- add your website callback address, the address that their website will send the user after authentication (this means that it should be accessible by internet users)
3- on authentication request, on your site, you have to send your user to IG authentication page
4- the user will come back to your site, from IG site, with an authentication token
5- use this token to do stuff.
read this paper to get more info: http://instagram.com/developer/authentication/