Working with Relationship in Instagram

This site contains the documentation that is relevant to older WSO2 product versions and offerings.
For the latest WSO2 documentation, visit https://wso2.com/documentation/.

Working with Relationship in Instagram


[ Overview ] [ Operation details ] [ Sample configuration ]


Overview

The following operations allow you to work with relationship in Instagram.Click an operation name to see details on how to use it. For sample proxy service which illustrates how to deal with relationship,see Sample configuration.

Operation

Description

getUserFollows

Retrieves the list of users this user follows.

getUserFollowedBy

Retrieves the list of users this user is followed by.

getSelfRequestedBy

List the users who have requested this user's permission.

getUserRelationship

Retrieves information about a relationship to another user.

Operation in details

This section provides further details on the operations related to relationship.

Retrieving User Follows

The getUserFollows operation is used to  retrieve the list of users this user follows.You need to specify the user id. This relationship is expressed as outgoing_status. That indicates your relationship to the user.

getUserFollows
<instagram.getUserFollows>   <userId>{$ctx:userId}</userId> </instagram.getUserFollows>
Properties
  • userId : Specifies the userId.

Sample request

Following is a sample request that can be handled by the getUserFollows operation.

Sample Request for getUserFollows
{ "accessToken":"1392352686.f59def8.8093ea32008743cb8f4275eb20c5423d", "userId":"13" }
Related API documentation

http://instagram.com/developer/endpoints/users/#get_users

Retrieving User Followed By

The getUserFollowedBy operation is used  to  retrieve the list of users this user is followed by. You need to specify the user id.This relationship is expressed as incoming_status.That indicates a user's relationship

to you.

getUserFollowedBy
<instagram.getUserFollowedBy> <userId>{$ctx:userId}</userId> </instagram.getUserFollowedBy>
Properties
  • userId : Specifies the userId.

Sample request

Following is a sample request that can be handled by the getUserFollowedBy operation.

Sample Request for getUserFollowedBy
{ "apiUrl":"https://api.instagram.com/v1", "accessToken":"1392352686.f59def8.8093ea32008743cb8f4275eb20c5423d", "userId":"13" }
Related API documentation

http://instagram.com/developer/endpoints/relationships/#get_users_followed_by

Retrieving Self Requested By

The getSelfRequestedBy operation is used to retrieve list of users who have requested this user's permission to follow.This relationship is expressed as incoming_status. That indicates a user's relationship to you.

getSelfRequestedBy
<instagram.getSelfRequestedBy/>
Sample request

Following is a sample request that can be handled by the getSelfRequestedBy operation.

Sample Request for getSelfRequestedBy
{ "apiUrl":"https://api.instagram.com/v1", "accessToken":"1392352686.f59def8.8093ea32008743cb8f4275eb20c5423d" }
Related API documentation

http://instagram.com/developer/endpoints/relationships/#get_incoming_requests

Retrieving User Relationship    

The getUserRelationship operation is used to  retrieve the information about a relationship to another user.

getUserRelationship
<instagram.getUserRelationship> <userId>{ctx:userId}</userId> </instagram.getUserRelationship>
Properties
  • userId : Specifies the userId.   

Sample request

Following is a sample request that can be handled by the getUserRelationship operation.

Sample Request for getUserRelationship
{ "apiUrl":"https://api.instagram.com/v1", "access_token":"1392352686.f59def8.8093ea32008743cb8f4275eb20c5423d", "userId":"13" }
Related API documentation

http://instagram.com/developer/endpoints/relationships/#get_relationship

 
Sample configuration

Following is a sample proxy service that illustrates how to connect to Nimble and use the getUserFollows operation.The sample request for this proxy can be found in Sample Request for getUserFollows. You can use this sample as a template for using other operations in this category.

Sample Proxy
<proxy xmlns="http://ws.apache.org/ns/synapse" name="getUserFollows" transports="https,http" statistics="disable" trace="disable" startOnLoad="true"> <target> <inSequence> <property name="apiUrl" expression="json-eval($.apiUrl)"/> <property name="accessToken" expression="json-eval($.accessToken)"/> <property name="userId" expression="json-eval($.userId)"/> <instagram.init> <apiUrl>{$ctx:apiUrl}</apiUrl> <accessToken>{$ctx:accessToken}</accessToken> </instagram.init> <instagram.getUserFollows> <userId>{$ctx:userId}</userId> </instagram.getUserFollows> <respond/> </inSequence> <outSequence> <log/> <send/> </outSequence> </target> <description/> </proxy>