-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathREADME
More file actions
78 lines (49 loc) · 3.21 KB
/
README
File metadata and controls
78 lines (49 loc) · 3.21 KB
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
The start of a VERY simple Python library for working with the AngelList api ( http://angel.co/api )
DISCLAIMER:
Note: This code is a quick hack for a personal project I'm playing around with. There are obvious holes (for example the delete stuff isn't working yet) and there are most certainly much cleaner/better/faster ways to interact with the AngelList api, but this version basically gave me quick access to the functionality that I needed at the time.
If you have questions, comments, or updates you would like me to include please feel free to email me any time at info@falicon.com or ping me via Twitter at http://twitter.com/falicon
OAUTH:
The AngelList api requires authentication via OAuth2 ( http://angel.co/api/oauth/faq ). This process is started by sending users to a specific angel.co url to authorize your app. You generate that url like this:
auth_url = "https://angel.co/api/oauth/authorize?client_id=%s&response_type=code" % 'YOUR_CLIENT_ID_ASSIGNED_BY_ANGEL_LIST'
Then you just redirect your user to the generated URL. Once a user validates your app on AngelList, AngelList will send them back to the endpoint your specified when you set up your app along with a URL param of code. It will look something like this:
http://localhost?code=08a6502cb3199adf9f7d50c85254a0f1
The next step is to use this returned code, along with your client_id, and client_secret to obtain a valid access_token. You do that like this:
import angellist
al = angellist.AngelList()
al.client_id = 'YOUR_CLIENT_ID_ASSIGNED_BY_ANGEL_LIST'
al.client_secret = 'YOUR_CLIENT_SECRET_ASSIGNED_BY_ANGEL_LIST'
access_token = al.getAccessToken(code='THE_CODE_YOU_JUST_GOT_IN_THE_AUTH_RESPONSE_URL')
and if all goes well, you should now have a valid access_token that you can store along with this users account details and make valid AngelList api calls for.
ACTUALLY ACCESSING THE API -- THE BASICS:
If you have a valid access token, you should be able to something like the following:
import angellist
al = angellist.AngelList()
al.access_token = 'YOUR_VALID_ACCESS_TOKEN_FROM_OAUTH_PROCESS'
my_angel_list_profile = al.getMe()
-- IMPORTANT NOTE -- All requests expect a valid access_token to be set (see the OAuth section for details on obtaining a valid access_token).
AVAILABLE METHODS:
- getFeed()
- deleteFollows(follow_type='', follow_id='') - currently known issues
- addFollows(follow_type='', follow_id='')
- getFollowers(user_id='')
- getFollowersIds(user_id='')
- getFollowing(user_id='')
- getFollowingIds(user_id='')
- getStartupsFollowers(startup_id='')
- getReviews(user_id='')
- getStartups(startup_id='')
- getStartupsSearch(slug='', domain='')
- getTagsStartups(tag_id='')
- getStartupRoles(user_id='', startup_id='')
- getStatusUpdates(user_id='', startup_id='')
- postStatusUpdates(startup_id='', message='')
- deleteStatusUpdates(status_id='') - currently known issues
- getTags(tag_id='')
- getTagsChildren(tag_id='')
- getTagsParents(tag_id='')
- getTagsStartups(tag_id='')
- getUsers(user_id='')
- getUsersSearch(slug = '', email = '')
- getMe()
KNOWN ISSUES:
- DELETE requests (deleteFollows and deleteStatusUpdates) are not currently working (I have not yet been able to debug just how AngelList is expecting DELETE requests to be submitted).