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 Location in Instagram
[ Overview ] [ Operation details ] [ Sample configuration ]
Overview
The following operations allow you to work with location in Instagram.Click an operation name to see details on how to use it. For sample proxy service which illustrates how to deal with location, see Sample configuration.
Operation | Description |
|---|---|
Get information about a location. | |
Get a list of recent media objects from a given location. | |
Search for a location by geographic coordinate. |
Operation in details
This section provides further details on the operations related to location.
Retrieving location Information
The getULocationInfo operation is used to retrieve information about a location.
getLocationInfo
<instagram.getLocationInfo>
<locationId>{$ctx:locationId}<locationId>
</instagram.getLocationInfo>Properties
locationId : Specifies the location id.
Sample request
Following is a sample request that can be handled by the getLocationInfo operation.
Sample Request for getLocationInfo
{
"apiUrl":"https://api.instagram.com/v1",
"accessToken":"1391658604.1fb234f.7da9292145e642d496570602aa6be322",
"locationId":"514276"
}Related API documentation
http://instagram.com/developer/endpoints/locations/#get_locations
Retrieving Recent location
The getLocationRecent operation is used to retrieve list of recent media objects from a given location. It may return a mix of both image and video types .
getLocationRecent
<instagram.getLocationRecent>
<locationId>{$ctx:locationId}<locationId>
<minTimestamp>{$ctx:minTimestamp}<minTimestamp>
<maxTimestamp>{$ctx:maxTimestamp}<maxTimestamp>
<minId>{$ctx:minId}</minId>
<maxId>{$ctx:maxId}</maxId>
</instagram.getLocationRecent>Properties
locationId : Specifies the location id
minTimestamp : Return media after this UNIX timestamp
maxTimestamp : Returns media before this UNIX timestamp
minId : Return media later than this minId.
maxId : Return media earlier than this maxId.
Sample request
Following is a sample request that can be handled by the getLocationRecent operation.
Sample Request for getLocationRecent
{
"apiUrl":"https://api.instagram.com/v1",
"accessToken":"1391658604.1fb234f.7da9292145e642d496570602aa6be322",
"locationId":"514276",
"maxTimestamp":"2147515932",
"minTimestamp":"946684800"
}Related API documentation
http://instagram.com/developer/endpoints/locations/#get_locations_media_recent
Retrieving Location Search
The locationSearch operation is used to search for a location by geographic coordinate. Here you need to specify the longitude and latitude values.
locationSearch
<instagram.locationSearch>
<lat>{$ctx:lat}</lat>
<lng>{$ctx:lng}</lng>
<foursquareId>{$ctx:foursquareId}</foursquareId>
<foursquareV2Id>{$ctx:foursquareV2Id}</foursquareV2Id>
<facebookPlacesId>{$ctx:facebookPlacesId}</facebookPlacesId>
<distance>{$ctx:distance}</distance>
</instagram.locationSearch>Properties
lat : Latitude of the center search coordinate. If used, lng is required.
lng : Longitude of the center search coordinate. If used, lat is required.
foursquareId : Returns a location mapped off of a foursquare v1 api location id. If used, you are not required to use lat and lng. Note that this method is deprecated; you should use the new foursquare IDs with V2 of their API.
foursquareV2Id : Returns a location mapped off of a foursquare v2 api location id. If used, you are not required to use lat and lng.
facebookPlacesId : Returns a location mapped off of a Facebook places id.
distance : Search distance, in meters. Default is 1km (distance=1000), max distance is 5km (5000)"/>
Sample request
Following is a sample request that can be handled by the locationSearch operation.
Sample Request for locationSearch
{
"apiUrl":"https://api.instagram.com/v1",
"accessToken":"1391658604.1fb234f.7da9292145e642d496570602aa6be322",
"lat":"48.858844",
"lng":"2.294351"
}Related API documentation
http://instagram.com/developer/endpoints/locations/#get_locations_search
Sample configuration
Following is a sample proxy service that illustrates how to connect to Nimble and use the getLocationInfo operation. The sample request for this proxy can be found in Sample Request for getLocationInfo. 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="getLocationInfo"
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="locationId" expression="json-eval($.locationId)"/>
<instagram.init>
<apiUrl>{$ctx:apiUrl}</apiUrl>
<accessToken>{$ctx:accessToken}</accessToken>
</instagram.init>
<instagram.getLocationInfo>
<locationId>{$ctx:locationId}<locationId>
</instagram.getLocationInfo>
<respond/>
</inSequence>
<outSequence>
<log/>
<send/>
</outSequence>
</target>
<description/>
</proxy>