There is a corner case where, if a user tries to set a relationship using their own id, Instagram API returns a successful response that doesn't include any data, leading to a JSONException.
Running these instructions in a cabal repl:
:set -XOverloadedStrings
:m +Network.HTTP.Conduit
:m +Control.Monad.Trans.Resource
let creds = Credentials "" ""
let userId = "XXX"
let selfId = "YYY"
let user = User "" "" "" Nothing Nothing Nothing Nothing
let oAuthToken = OAuthToken (AccessToken "ZZZ") user
let setSelfRelationShipAction = setRelationShip selfId oAuthToken Follow
manager <- newManager tlsManagerSettings
There is a corner case where, if a user tries to set a relationship using their own id, Instagram API returns a successful response that doesn't include any data, leading to a
JSONException
.Running these instructions in a
cabal repl
:the expression
returned
With this fix the same expression now returns
See also https://instagram.com/developer/endpoints/relationships/#post_relationship