-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | Bindings to Instagram's API.
--
-- This package exports bindings to Instagram's APIs (see
-- http://instagram.com/developer/).
--
-- While we would like to have a complete binding to Instagram's API,
-- this package is being developed on demand. If you need something that
-- has not been implemented yet, please send a pull request or file an
-- issue on GitHub (https://github.com/prowdsponsor/ig/issues).
--
-- A sample Yesod application demonstrating the API can be found at
-- https://github.com/prowdsponsor/ig-testapp.
@package ig
@version 0.7
-- | the public API for Instagram access
module Instagram
-- | the instagram monad transformer this encapsulates the data necessary
-- to pass the app credentials, etc
data InstagramT m a
-- | Run a computation in the InstagramT monad transformer with your
-- credentials.
runInstagramT :: Credentials -> Manager -> InstagramT m a -> m a
-- | Run a ResourceT inside a InstagramT.
runResourceInIs :: (MonadResource m, MonadBaseControl IO m) => InstagramT (ResourceT m) a -> InstagramT m a
-- | an exception that a call to instagram may throw
data IGException
-- | JSON parsingError
JSONException :: String -> IGException
-- | application exception
IGAppException :: IGError -> IGException
-- | an error returned to us by Instagram
data IGError
IGError :: Int -> Maybe Text -> Maybe Text -> IGError
[igeCode] :: IGError -> Int
[igeType] :: IGError -> Maybe Text
[igeMessage] :: IGError -> Maybe Text
-- | the URI to redirect the user after she accepts/refuses to authorize
-- the app
type RedirectUri = Text
-- | get the authorize url to redirect your user to
getUserAccessTokenURL1 :: Monad m => RedirectUri -> [Scope] -> InstagramT m Text
-- | second step of authorization: get the access token once the user has
-- been redirected with a code
getUserAccessTokenURL2 :: (MonadBaseControl IO m, MonadResource m) => RedirectUri -> Text -> InstagramT m OAuthToken
-- | the app credentials
data Credentials
Credentials :: Text -> Text -> Credentials
-- | client id
[cClientID] :: Credentials -> Text
-- | client secret
[cClientSecret] :: Credentials -> Text
-- | the oauth token returned after authentication
data OAuthToken
OAuthToken :: AccessToken -> User -> OAuthToken
-- | the access token
[oaAccessToken] :: OAuthToken -> AccessToken
-- | the user structure returned
[oaUser] :: OAuthToken -> User
-- | the access token is simply a Text
newtype AccessToken
AccessToken :: Text -> AccessToken
-- | the User partial profile returned by the authentication
data User
User :: UserID -> Text -> Text -> Maybe Text -> Maybe Text -> Maybe Text -> Maybe UserCounts -> User
[uID] :: User -> UserID
[uUsername] :: User -> Text
[uFullName] :: User -> Text
[uProfilePicture] :: User -> Maybe Text
[uWebsite] :: User -> Maybe Text
[uBio] :: User -> Maybe Text
[uCounts] :: User -> Maybe UserCounts
-- | the User counts info returned by some endpoints
data UserCounts
UserCounts :: Int -> Int -> Int -> UserCounts
[ucMedia] :: UserCounts -> Int
[ucFollows] :: UserCounts -> Int
[ucFollowedBy] :: UserCounts -> Int
-- | the scopes of the authentication
data Scope
Basic :: Scope
PublicContent :: Scope
FollowerList :: Scope
Comments :: Scope
Relationships :: Scope
Likes :: Scope
-- | envelope for Instagram OK response
data Envelope d
Envelope :: IGError -> d -> Maybe Pagination -> Envelope d
-- | this should only say 200, no error, but put here for completeness
[eMeta] :: Envelope d -> IGError
-- | data, garanteed to be present (otherwise we get an ErrEnvelope)
[eData] :: Envelope d -> d
[ePagination] :: Envelope d -> Maybe Pagination
-- | Use the pagination links in an Envelope to fetch the next page
-- of results.
--
-- If the Envelope has no pagination, or we have reached the final page
-- (indicated by the pNextUrl field being missing), returns Nothing.
getNextPage :: (MonadBaseControl IO m, MonadResource m, FromJSON v) => Envelope v -> InstagramT m (Maybe (Envelope v))
-- | pagination info for responses that can return a lot of data
data Pagination
Pagination :: Maybe Text -> Maybe Text -> Maybe Text -> Maybe Text -> Maybe Text -> Pagination
[pNextUrl] :: Pagination -> Maybe Text
[pNextMaxID] :: Pagination -> Maybe Text
[pNextMinID] :: Pagination -> Maybe Text
[pNextMaxTagID] :: Pagination -> Maybe Text
[pMinTagID] :: Pagination -> Maybe Text
-- | instagram media object
data Media
Media :: MediaID -> Maybe Comment -> Text -> User -> POSIXTime -> Images -> Text -> [UserPosition] -> Maybe Text -> [Text] -> Maybe Location -> Collection Comment -> Collection User -> Bool -> Maybe Object -> Media
[mID] :: Media -> MediaID
[mCaption] :: Media -> Maybe Comment
[mLink] :: Media -> Text
[mUser] :: Media -> User
[mCreated] :: Media -> POSIXTime
[mImages] :: Media -> Images
[mType] :: Media -> Text
[mUsersInPhoto] :: Media -> [UserPosition]
[mFilter] :: Media -> Maybe Text
[mTags] :: Media -> [Text]
[mLocation] :: Media -> Maybe Location
[mComments] :: Media -> Collection Comment
[mLikes] :: Media -> Collection User
[mUserHasLiked] :: Media -> Bool
-- | seems to be open format
-- https://groups.google.com/forum/?fromgroups#!topic/instagram-api-developers/KvGH1cnjljQ
[mAttribution] :: Media -> Maybe Object
-- | position in picture
data Position
Position :: Double -> Double -> Position
[pX] :: Position -> Double
[pY] :: Position -> Double
-- | position of a user
data UserPosition
UserPosition :: Position -> User -> UserPosition
[upPosition] :: UserPosition -> Position
[upUser] :: UserPosition -> User
-- | geographical location info
data Location
Location :: Maybe LocationID -> Maybe Double -> Maybe Double -> Maybe Text -> Maybe Text -> Location
[lID] :: Location -> Maybe LocationID
[lLatitude] :: Location -> Maybe Double
[lLongitude] :: Location -> Maybe Double
[lStreetAddress] :: Location -> Maybe Text
[lName] :: Location -> Maybe Text
-- | data for a single image
data ImageData
ImageData :: Text -> Integer -> Integer -> ImageData
[idURL] :: ImageData -> Text
[idWidth] :: ImageData -> Integer
[idHeight] :: ImageData -> Integer
-- | different images for the same media
data Images
Images :: ImageData -> ImageData -> ImageData -> Images
[iLowRes] :: Images -> ImageData
[iThumbnail] :: Images -> ImageData
[iStandardRes] :: Images -> ImageData
-- | Commenton on a medium
data Comment
Comment :: CommentID -> POSIXTime -> Text -> User -> Comment
[cID] :: Comment -> CommentID
[cCreated] :: Comment -> POSIXTime
[cText] :: Comment -> Text
[cFrom] :: Comment -> User
-- | a collection of items (count + data) data can only be a subset
data Collection a
Collection :: Integer -> [a] -> Collection a
[cCount] :: Collection a -> Integer
[cData] :: Collection a -> [a]
-- | Instagram returns data:null for nothing, but Aeson considers that ()
-- maps to an empty array... so we model the fact that we expect null via
-- NoResult
data NoResult
-- | User ID
type UserID = Text
-- | Get basic information about a user.
getUser :: (MonadBaseControl IO m, MonadResource m) => UserID -> Maybe OAuthToken -> InstagramT m (Envelope (Maybe User))
-- | Parameters for call to self feed
data SelfFeedParams
SelfFeedParams :: Maybe Integer -> Maybe Text -> Maybe Text -> SelfFeedParams
[sfpCount] :: SelfFeedParams -> Maybe Integer
[sfpMaxID] :: SelfFeedParams -> Maybe Text
[sfpMinId] :: SelfFeedParams -> Maybe Text
-- | See the authenticated user's feed.
getSelfFeed :: (MonadBaseControl IO m, MonadResource m) => OAuthToken -> SelfFeedParams -> InstagramT m (Envelope [Media])
-- | Parameters for call to recent media
data RecentParams
RecentParams :: Maybe Integer -> Maybe POSIXTime -> Maybe POSIXTime -> Maybe Text -> Maybe Text -> RecentParams
[rpCount] :: RecentParams -> Maybe Integer
[rpMaxTimestamp] :: RecentParams -> Maybe POSIXTime
[rpMinTimestamp] :: RecentParams -> Maybe POSIXTime
[rpMaxID] :: RecentParams -> Maybe Text
[rpMinId] :: RecentParams -> Maybe Text
-- | Get the most recent media published by a user.
getRecent :: (MonadBaseControl IO m, MonadResource m) => UserID -> Maybe OAuthToken -> RecentParams -> InstagramT m (Envelope [Media])
-- | parameters for self liked call
data SelfLikedParams
SelfLikedParams :: Maybe Integer -> Maybe Text -> SelfLikedParams
[slpCount] :: SelfLikedParams -> Maybe Integer
[slpMaxLikeID] :: SelfLikedParams -> Maybe Text
-- | See the authenticated user's list of media they've liked.
getSelfLiked :: (MonadBaseControl IO m, MonadResource m) => OAuthToken -> SelfLikedParams -> InstagramT m (Envelope [Media])
-- | parameters for self liked call
data UserSearchParams
UserSearchParams :: Text -> Maybe Integer -> UserSearchParams
[uspQuery] :: UserSearchParams -> Text
[uspCount] :: UserSearchParams -> Maybe Integer
-- | Search for a user by name.
searchUsers :: (MonadBaseControl IO m, MonadResource m) => Maybe OAuthToken -> UserSearchParams -> InstagramT m (Envelope [User])
-- | notification aspect
data Aspect
-- | the media Aspect, the only one supported for now
media :: Aspect
-- | the URL to receive notifications to
type CallbackUrl = Text
-- | a subscription to a real time notification
data Subscription
Subscription :: Text -> Text -> Text -> Maybe Text -> Aspect -> CallbackUrl -> Maybe Double -> Maybe Double -> Maybe Integer -> Subscription
[sID] :: Subscription -> Text
[sType] :: Subscription -> Text
[sObject] :: Subscription -> Text
[sObjectID] :: Subscription -> Maybe Text
[sAspect] :: Subscription -> Aspect
[sCallbackUrl] :: Subscription -> CallbackUrl
[sLatitude] :: Subscription -> Maybe Double
[sLongitude] :: Subscription -> Maybe Double
[sRadius] :: Subscription -> Maybe Integer
-- | create a subscription
createSubscription :: (MonadBaseControl IO m, MonadResource m) => SubscriptionParams -> InstagramT m (Envelope Subscription)
-- | list all subscriptions for the application
listSubscriptions :: (MonadBaseControl IO m, MonadResource m) => InstagramT m (Envelope [Subscription])
-- | delete subscriptions based on criteria
deleteSubscriptions :: (MonadBaseControl IO m, MonadResource m) => DeletionParams -> InstagramT m (Envelope Value)
-- | details of subscription request
data SubscriptionRequest
-- | when a user uploads a picture
UserRequest :: SubscriptionRequest
-- | when a picture is tagged with the given tag
TagRequest :: Text -> SubscriptionRequest
[trTag] :: SubscriptionRequest -> Text
-- | when a picture is tagged with a specific location
LocationRequest :: Text -> SubscriptionRequest
[lrID] :: SubscriptionRequest -> Text
-- | when a picture is tagged with a location inside the given region
GeographyRequest :: Double -> Double -> Integer -> SubscriptionRequest
[grLatitude] :: SubscriptionRequest -> Double
[grLongitude] :: SubscriptionRequest -> Double
[grRadius] :: SubscriptionRequest -> Integer
-- | parameters for the subscription creation
data SubscriptionParams
SubscriptionParams :: SubscriptionRequest -> CallbackUrl -> Aspect -> Maybe Text -> SubscriptionParams
-- | the actual subscription request
[spRequest] :: SubscriptionParams -> SubscriptionRequest
-- | the url Instagram will post notifications to
[spCallback] :: SubscriptionParams -> CallbackUrl
-- | the subscription aspect
[spAspect] :: SubscriptionParams -> Aspect
-- | the verification token
[spVerifyToken] :: SubscriptionParams -> Maybe Text
-- | deletion parameters
data DeletionParams
-- | delete all subscriptions
DeleteAll :: DeletionParams
-- | delete one subscription, given its ID
DeleteOne :: Text -> DeletionParams
[doID] :: DeletionParams -> Text
-- | delete all user subscriptions
DeleteUsers :: DeletionParams
-- | delete all tag subscriptions
DeleteTags :: DeletionParams
-- | delete all location subscriptions
DeleteLocations :: DeletionParams
-- | delete all geography subscriptions
DeleteGeographies :: DeletionParams
-- | an update from a subscription
data Update
Update :: Integer -> Text -> Text -> Aspect -> POSIXTime -> Update
[uSubscriptionID] :: Update -> Integer
[uObject] :: Update -> Text
[uObjectID] :: Update -> Text
[uChangedAspect] :: Update -> Aspect
[uTime] :: Update -> POSIXTime
-- | verify the signature with the content, using the secret as the key
verifySignature :: Monad m => ByteString -> ByteString -> InstagramT m Bool
-- | a Tag
data Tag
Tag :: TagName -> Integer -> Tag
[tName] :: Tag -> TagName
[tMediaCount] :: Tag -> Integer
-- | Tag Name
type TagName = Text
-- | Get information about a tag object.
getTag :: (MonadBaseControl IO m, MonadResource m) => TagName -> Maybe OAuthToken -> InstagramT m (Envelope (Maybe Tag))
-- | parameters for recent tag pagination
data RecentTagParams
RecentTagParams :: Maybe Text -> Maybe Text -> RecentTagParams
[rtpMaxID] :: RecentTagParams -> Maybe Text
[rtpMinID] :: RecentTagParams -> Maybe Text
-- | Get a list of recently tagged media.
getRecentTagged :: (MonadBaseControl IO m, MonadResource m) => TagName -> Maybe OAuthToken -> RecentTagParams -> InstagramT m (Envelope [Media])
-- | Search for tags by name.
searchTags :: (MonadBaseControl IO m, MonadResource m) => TagName -> Maybe OAuthToken -> InstagramT m (Envelope [Tag])
-- | outgoing relationship status
data OutgoingStatus
Follows :: OutgoingStatus
Requested :: OutgoingStatus
OutNone :: OutgoingStatus
-- | incoming relationship status
data IncomingStatus
FollowedBy :: IncomingStatus
RequestedBy :: IncomingStatus
BlockedByYou :: IncomingStatus
InNone :: IncomingStatus
-- | a relationship between two users
data Relationship
Relationship :: OutgoingStatus -> IncomingStatus -> Bool -> Relationship
[rOutgoing] :: Relationship -> OutgoingStatus
[rIncoming] :: Relationship -> IncomingStatus
-- | not present in doc
[rTargetUserPrivate] :: Relationship -> Bool
-- | Get the list of users this user follows.
getFollows :: (MonadBaseControl IO m, MonadResource m) => UserID -> Maybe OAuthToken -> InstagramT m (Envelope [User])
-- | Get the list of users this user is followed by.
getFollowedBy :: (MonadBaseControl IO m, MonadResource m) => UserID -> Maybe Int -> Maybe OAuthToken -> InstagramT m (Envelope [User])
data FollowParams
FollowParams :: Int -> FollowParams
[fpCount] :: FollowParams -> Int
-- | Get the list of users this user follows.
getFollowsParams :: (MonadBaseControl IO m, MonadResource m) => UserID -> Maybe OAuthToken -> FollowParams -> InstagramT m (Envelope [User])
-- | Get the list of users this user is followed by.
getFollowedByParams :: (MonadBaseControl IO m, MonadResource m) => UserID -> Maybe OAuthToken -> FollowParams -> InstagramT m (Envelope [User])
-- | List the users who have requested this user's permission to follow.
getRequestedBy :: (MonadBaseControl IO m, MonadResource m) => OAuthToken -> InstagramT m (Envelope [User])
-- | Get information about a relationship to another user.
getRelationship :: (MonadBaseControl IO m, MonadResource m) => UserID -> OAuthToken -> InstagramT m (Envelope Relationship)
-- | Modify the relationship between the current user and the target user.
setRelationShip :: (MonadBaseControl IO m, MonadResource m) => UserID -> OAuthToken -> RelationShipAction -> InstagramT m (Envelope (Maybe Relationship))
-- | relationship action
data RelationShipAction
Follow :: RelationShipAction
Unfollow :: RelationShipAction
Block :: RelationShipAction
Unblock :: RelationShipAction
Approve :: RelationShipAction
Deny :: RelationShipAction
-- | Media ID
type MediaID = Text
-- | Get information about a media object.
getMedia :: (MonadBaseControl IO m, MonadResource m) => MediaID -> Maybe OAuthToken -> InstagramT m (Envelope (Maybe Media))
-- | Get a list of what media is most popular at the moment.
getPopularMedia :: (MonadBaseControl IO m, MonadResource m) => Maybe OAuthToken -> InstagramT m (Envelope [Media])
-- | Parameters for call to media search
data MediaSearchParams
MediaSearchParams :: Maybe Double -> Maybe Double -> Maybe Integer -> Maybe POSIXTime -> Maybe POSIXTime -> MediaSearchParams
[mspLatitude] :: MediaSearchParams -> Maybe Double
[mspLongitude] :: MediaSearchParams -> Maybe Double
[mspDistance] :: MediaSearchParams -> Maybe Integer
[mspMaxTimestamp] :: MediaSearchParams -> Maybe POSIXTime
[mspMinTimestamp] :: MediaSearchParams -> Maybe POSIXTime
-- | Search for media in a given area.
searchMedia :: (MonadBaseControl IO m, MonadResource m) => Maybe OAuthToken -> MediaSearchParams -> InstagramT m (Envelope [Media])
-- | comment id
type CommentID = Text
-- | Get a full list of comments on a media.
getComments :: (MonadBaseControl IO m, MonadResource m) => MediaID -> Maybe OAuthToken -> InstagramT m (Envelope [Comment])
-- | Create a comment on a media.
postComment :: (MonadBaseControl IO m, MonadResource m) => MediaID -> OAuthToken -> Text -> InstagramT m (Envelope NoResult)
-- | Remove a comment either on the authenticated user's media or authored
-- by the authenticated user.
deleteComment :: (MonadBaseControl IO m, MonadResource m) => MediaID -> CommentID -> OAuthToken -> InstagramT m (Envelope NoResult)
-- | Get a list of users who have liked this media.
getLikes :: (MonadBaseControl IO m, MonadResource m) => MediaID -> Maybe OAuthToken -> InstagramT m (Envelope [User])
getLikesMaxId :: (MonadBaseControl IO m, MonadResource m) => MediaID -> Maybe UserID -> Maybe OAuthToken -> InstagramT m (Envelope [User])
-- | Set a like on this media by the currently authenticated user.
like :: (MonadBaseControl IO m, MonadResource m) => MediaID -> OAuthToken -> InstagramT m (Envelope NoResult)
-- | Remove a like on this media by the currently authenticated user.
unlike :: (MonadBaseControl IO m, MonadResource m) => MediaID -> OAuthToken -> InstagramT m (Envelope NoResult)
-- | location ID
type LocationID = Text
-- | Get information about a location.
getLocation :: (MonadBaseControl IO m, MonadResource m) => LocationID -> Maybe OAuthToken -> InstagramT m (Envelope (Maybe Location))
-- | Parameters for call to recent media in location search
data LocationMediaParams
LocationMediaParams :: Maybe POSIXTime -> Maybe POSIXTime -> Maybe Text -> Maybe Text -> LocationMediaParams
[lmspMaxTimestamp] :: LocationMediaParams -> Maybe POSIXTime
[lmspMinTimestamp] :: LocationMediaParams -> Maybe POSIXTime
[lmspMaxID] :: LocationMediaParams -> Maybe Text
[lmspMinId] :: LocationMediaParams -> Maybe Text
-- | Get a list of recent media objects from a given location.
getLocationRecentMedia :: (MonadBaseControl IO m, MonadResource m) => LocationID -> Maybe OAuthToken -> LocationMediaParams -> InstagramT m (Envelope [Media])
-- | Parameters for call to media search
data LocationSearchParams
LocationSearchParams :: Maybe Double -> Maybe Double -> Maybe Integer -> Maybe Text -> Maybe Text -> LocationSearchParams
[lspLatitude] :: LocationSearchParams -> Maybe Double
[lspLongitude] :: LocationSearchParams -> Maybe Double
[lspDistance] :: LocationSearchParams -> Maybe Integer
[lspFoursquareIDv2] :: LocationSearchParams -> Maybe Text
[lspFoursquareID] :: LocationSearchParams -> Maybe Text
-- | Search for a location by geographic coordinate.
searchLocations :: (MonadBaseControl IO m, MonadResource m) => Maybe OAuthToken -> LocationSearchParams -> InstagramT m (Envelope [Location])
-- | geography ID
type GeographyID = Text
-- | Parameters for call to recent media in geography search
data GeographyMediaParams
GeographyMediaParams :: Maybe Integer -> Maybe Text -> GeographyMediaParams
[gmpCount] :: GeographyMediaParams -> Maybe Integer
[gmpMinId] :: GeographyMediaParams -> Maybe Text
-- | Get very recent media from a geography subscription that you created
getGeographyRecentMedia :: (MonadBaseControl IO m, MonadResource m) => GeographyID -> GeographyMediaParams -> InstagramT m (Envelope [Media])