Working with Comments 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 Comments in Instagram


[ Overview ] [ Operation details ] [ Sample configuration ]


Overview

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

Operation

Description

getMediaComment

Get a full list of comments on a media object.

setMediaComment

Create a comment on a media object.

Operation in details

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

Retrieving Media Comments    

The getMediaComment  operation is used to retrieve  a full list of comments on a media object .Use  media id to get list of comments

getMediaComment
<instagram.getMediaComment> <mediaId>{$ctx:mediaId}</mediaId> </instagram.getMediaComment>
Properties
  • mediaId:Specifies the media id

Sample request

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

Sample Request for getMediaComment
{ "apiUrl":"https://api.instagram.com/v1", "accessToken":"1376961260.7a10a01.7fbf6e8ab4dbnhj3a2d6b03469a81a93", "mediaId":"53" }
Related API documentation

http://instagram.com/developer/endpoints/comments/#get_media_comments

Creating Media Comments    

The setMediaComment  operation is used to create a comment on a media object.

setMediaComment
<instagram.setMediaComment> <mediaId>{$ctx:mediaId}</mediaId> <text>{$ctx:text}</text> </instagram.setMediaComment>
Properties
  • text:Text to post as a comment on the media object as specified in media-id.

  • mediaId:Specifies the media id.

Sample request

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

Sample Request for setMediaComment
{ "apiUrl":"https://api.instagram.com/v1", "accessToken":"1376961260.7a10a01.7fbf6e8ab4dbnhj3a2d6b03469a81a93", "mediaId":"53", "text":"Testing 124" }
Related API documentation

https://www.instagram.com/developer/endpoints/comments/#post_media_comments

Sample configuration

Following is a sample proxy service that illustrates how to connect to Instagram and use the getMediaComments  operation. The sample request for this proxy can be found in Sample Request for getMediaComments. 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="instagram" 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="mediaId" expression="json-eval($.mediaId)"/> <instagram.init> <apiUrl>{$ctx:apiUrl}</apiUrl> <accessToken>{$ctx:accessToken}</accessToken> </instagram.init> <instagram.getMediaComment> <mediaId>{$ctx:mediaId}</mediaId> </instagram.getMediaComment> <respond/> </inSequence> <outSequence> <log/> <send/> </outSequence> </target> <description/> </proxy>