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


[ Overview ] [ Operation details ] [ Sample configuration ]


Overview

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

Operation

Description

getMediaInfo

Retrieves information about a media object.

getMediaSearch

Search for media in a given area.

Operation in details

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

Retrieving Media Information    

The getMediaInfo  operation is used to retrieve  information about a media object.

getMediaInfo
<instagram.getMediaInfo> <mediaId>{$ctx:mediaId}</mediaId> </instagram.getMediaInfo>
Properties
  • mediaId  : Media id

Sample request

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

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

http://instagram.com/developer/endpoints/media/#get_media

Searching User Media

The getMediaSearch operation is used to  retrieve  information about a particular media in a given area . The default time span is set to 5 days. The time span must not exceed 7 days. It will return mix of image and video types.

getMediaSearch
<instagram.getMediaSearch> <lng>{$ctx:lng}</lng> <lat>{$ctx:lat}</lat> <maxTimestamp>{$ctx:maxTimestamp}</maxTimestamp> <minTmestamp>{$ctx:minTmestamp}</minTmestamp> <distance>{$ctx:distance}</distance> </instagram.getMediaSearch>
Properties  
Sample request

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

Sample Request for getMediaSearch
{ "apiUrl":"https://api.instagram.com/v1", "accessToken":"1392352686.f59def8.8093ea32008743cb8f4275eb20c5423d", "lat":"48.858844", "lng":"2.294351", "maxTimestamp":"34532", "minTtimestamp":"12453", "distance":"5000" }
Related API documentation

http://instagram.com/developer/endpoints/media/#get_media_search

Sample configuration

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