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 Checkins in Foursquare
Overview
The following operations allow you to work with checkins. Click an operation name to see details on how to use it.
For a sample proxy service that illustrates how to work with user details, see Sample configuration.
Operation | Description |
---|---|
getCheckinDetails | Retrieves details of a check-in. |
addCheckins | Allows you to check in to a place. |
getRecentCheckins | Retrieves a list of recent checkins from friends. |
addCheckinComment | Adds comment on a checkin-in. |
deleteCheckinComment | Removes a comment from a checkin, if the acting user is the author or the owner of the checkin. |
Operation Details
This section provides further details on the operations related to checkins.
Get User Details
The getCheckinDetails
operation retrieves details of a check-in.
<foursquare.getCheckinDetails> <checkinId>{$ctx:checkinId}</checkinId> </foursquare.getCheckinDetails>
Properties
checkinId
: The ID of the check-in to retrieve additional information for.
Sample request
Following is a sample REST/JSON request that can be handled by the getCheckinDetails operation.
{ "apiUrl":"%https://api.foursquare.com", "checkinId":"53bb9a72498ed11efcbed4b4", "accessToken":"VCNCLT0LGPHREG5CFWGWKBCY0T5HOSWYALVOFOQC24IPMM4U" }
Related Foursquare documentation
https://developer.foursquare.com/docs/checkins/checkins
Add CheckinsÂ
The addCheckins  operation allows you to check in to a place.
<foursquare.addCheckins> <venueId>{$ctx:venueId}</venueId> <broadcast>{$ctx:broadcast}</broadcast> <eventId>{$ctx:eventId}</eventId> <shout>{$ctx:shout}</shout> <ll>{$ctx:ll}</ll> <llAcc>{$ctx:llAcc}</llAcc> <alt>{$ctx:alt}</alt> <altAcc>{$ctx:altAcc}</altAcc> <foursquare.addCheckins>
Properties
venueId
: The venue where the user is checking in.broadcast
: Who to broadcast this check-in to.eventId
: The event the user is checking in to.shout
: A message about your check-in.ll
: Latitude and longitude of the user's location.llAcc
: Accuracy of the user's latitude and longitude, in meters.alt
: Altitude of the user's location, in meters.altAcc
: Vertical accuracy of the user's location, in meters.
Sample Request
Following is a sample REST/JSON request that can be handled by the addCheckinsÂ
operation.
{ "apiUrl":"%https://api.foursquare.com", "venueId":"4d6728f6a88a6ea8aa9fe072", "eventId":"UHR8THISVNT", "broadcast":"public", "shout":"There are crayons!Crayons!", "accessToken":"VCNCLT0LGPHREG5CFWGWKBCY0T5HOSWYALVOFOQC24IPMM4U" }
Related Foursquare documentation
https://developer.foursquare.com/docs/checkins/add
Get Friend Details
The getCheckinRecent
operation retrieves recent check-ins of friends.
<foursquare.getCheckinRecent> <ll>{$ctx:ll}</ll> <limit>{$ctx:limit}</limit> <afterTimeStamp>{$ctx:afterTimeStamp}</afterTimeStamp> </foursquare.getCheckinRecent>
properties
ll
: Latitude and longitude of the user's location.limit
: Number of results to be returned, up to 500.afterTimeStamp
: Seconds after which to look for checkins.
Sample Request
Following is a sample REST/JSON request that can be handled by the  getCheckinRecentÂ
operation.
{ "apiUrl":"%https://api.foursquare.com", "ll":"10.23,114.54", "accessToken":"VCNCLT0LGPHREG5CFWGWKBCY0T5HOSWYALVOFOQC24IPMM4U", "limit":"20" }
Related Foursquare documentation
https://developer.foursquare.com/docs/checkins/recent
Add Checkin Comment
The addCheckinComment
operation allows you to comment on a checkin-in.
<foursquare.addCheckinComment> <checkinId>{$ctx:checkinId}</checkinId> <comment>{$ctx:comment}</comment> </foursquare.addCheckinComment>
properties
checkinId
: The ID of the checkin to add a comment to.comment
: The text of the comment.
Sample requestÂ
Following is a sample REST/JSON request that can be handled by the addCheckinComment
 operation.
{ "apiUrl":"%https://api.foursquare.com", "checkinId":"53bb9a72498ed11efcbed4b4", "comment":"Awesome........" "accessToken":"VCNCLT0LGPHREG5CFWGWKBCY0T5HOSWYALVOFOQC24IPMM4U" }
Related Foursquare documentation
https://developer.foursquare.com/docs/checkins/addcomment
Delete Checkin Comment
The deleteCheckinComment
operation deletes checkin comment.
<foursquare.deleteCheckinComment> <checkinId>{$ctx:checkinId}</checkinId> <commentId>{$ctx:commentId}</commentId> </foursquare.deleteCheckinComment>
properties
checkinId
: The ID of the checkin to remove a comment from.commentId
: The id of the comment to remove.
Sample requestÂ
Following is a sample REST/JSON request that can be handled by the deleteCheckinComment
 operation.
{ "apiUrl":"%https://api.foursquare.com", "checkinId":"53bb9a72498ed11efcbed4b4", "accessToken":"VCNCLT0LGPHREG5CFWGWKBCY0T5HOSWYALVOFOQC24IPMM4U", "commentId":"53bb9ab2498e527bd3993304" }
Related Foursquare documentation
https://developer.foursquare.com/docs/checkins/deletecomment
Sample Configuration
Following is a sample proxy service that illustrates how to connect to Foursquare with the init operation and use the deleteCheckinComment operation. The sample request for this proxy can be found in  deleteCheckinComment sample request. You can use this sample as a template for using other operations in this category.
<proxy xmlns="http://ws.apache.org/ns/synapse" name="deleteCheckinComment" 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="checkinId" expression="json-eval($.checkinId)"/> <property name="commentId" expression="json-eval($.commentId)"/> <foursquare.init> <apiUrl>{$ctx:apiUrl}</apiUrl> <accessToken>{$ctx:accessToken}</accessToken> </foursquare.init> <foursquare.deleteCheckinComment> <checkinId>{$ctx:checkinId}</checkinId> <commentId>{$ctx:commentId}</commentId> </foursquare.deleteCheckinComment> <respond/> </inSequence> <outSequence> <log/> <send/> </outSequence> </target> <description/> </proxy>