clj-instagram.requests
authenticate
(authenticate req access-token)
Adds access token to the given request. Depending on the request method, access token is added either to query params
or form params.
create-subscription
(create-subscription client-id client-secret object aspect verify-token callback-url)
Create subscription to given aspect of the given object.
Simultaneously submits a GET request to the provided callback URL to verify its existence with the following
parameters:
* hub.mode - this will be set to "subscribe"
* hub.challenge - this will be set to a random string that your callback URL will need to echo back in order to
verify you'd like to subscribe
* hub.verify_token - this will be set to whatever verify token passed in with the subscription request,
it's helpful to use this to differentiate between multiple subscription requests
In order to verify the subscription, your server must respond to the GET request with the hub.challenge parameter
only.
When new data arrives, the given callback URL will receive a POST request with a payload containing the updates.
Parameters:
client-id - client id
client-secret - client secret
object - the object to subscribe to (e.g. 'user')
aspect - the aspect of the object to subscribe to (e.g. 'media')
verify-token - verify token to use in the Pubsubhubub challenge flow
callback-url - callback URL (must support both GET and POST)
delete-subscription
(delete-subscription client-id client-secret {:keys [object id]})
Delete subscription either by object type or subscription ID. All subscriptions can be deleted by using value "all"
as an object type.
Parameters:
client-id - client id
client-secret - client secret
object - object type or "all" (optional, either object type or id must be given)
id - subscription id (optional, either object type or id must be given)
get-followed-by
(get-followed-by)
Get the list of users this user is followed by.
get-follows
(get-follows)
Get the list of users this user follows.
get-likes
(get-likes media-id)
Get a list of users who have liked this media.
get-location
(get-location location-id)
Get information about a location.
get-relationship
(get-relationship user-id)
Get information about a relationship to another user. Relationships are expressed using the following terms in the
response:
* outgoing_status: Your relationship to the user. Can be 'follows', 'requested', 'none'
* incoming_status: A user's relationship to you. Can be 'followed_by', 'requested_by', 'blocked_by_you', 'none'
get-requested-by
(get-requested-by)
List the users who have requested this user's permission to follow.
get-tag
(get-tag tag)
Get information about a tag object.
get-user
(get-user)
(get-user user-id)
Get information about a user. If user id is omitted returns information about the owner of the access token.
Parameters:
user-id - user id (default: owner of the access token)
list-subscriptions
(list-subscriptions client-id client-secret)
List current subscriptions.
Parameters:
client-id - client id
client-secret - client secret
modify-relationship
(modify-relationship user-id action)
Modify the relationship between the current user and the target user. Relationships are expressed using the following
terms in the response:
* outgoing_status: Your relationship to the user. Can be 'follows', 'requested', 'none'
* incoming_status: A user's relationship to you. Can be 'followed_by', 'requested_by', 'blocked_by_you', 'none'
Parameters:
user-id - user id
action - action to perform: :follow, :unfollow, :approve or :ignore
remove-like
(remove-like media-id)
Remove a like on this media by the currently authenticated user.
request-access-token
(request-access-token client-id client-secret redirect-uri code)
Exchange code received from Instagram for an access token.
Parameters:
client-id - client ID
client-secret - client secret
redirect-uri - the redirect URI used in the authorization request
code - the exact code received during the authorization step
search-locations
(search-locations {:keys [facebook-places-id lat lng distance]})
Search for a location by geographic coordinate or Facebook Places ID.
Parameters:
facebook-places-id - returns a location mapped off of a Facebook places id.
(optional, if used, lat and lng are not required)
lat - latitude of the center search coordinate (optional, if used, lng is required)
lng - longitude of the center search coordinate (optional, if used, lat is required)
distance - distance in meters (optional, default 1000, max 5000)
search-users
(search-users q)
(search-users q count)
Get a list of users matching the query.
Parameters:
q - a query string
count - number of users to return (optional)
set-like
(set-like media-id)
Set a like on this media by the currently authenticated user.
sign
(sign {:keys [url], :as req} client-secret)
Computes and adds signature to the request using given client secret.