Grant

Introduction

The Grant API enables you to apply a visibility tag to a design in order to provide a filter for visibility. This is typically used for creating custom permissions in the Embed use case, and as a flexible tagging system, permissions can be as simple or complex as needed.

By default, a standard user will be able to see all of the designs that they have created themselves. However, many Foursquare Targeting partners have requirements for more granular, complex permissions on designs. For example, perhaps a Foursquare Targeting partner wants all users from the same company to see any design created by a user from that same company. This can be done using visibility tags in conjunction with server side API calls made by a Admin level user. See Management APIs for a more complete example of how to use visibility tags to retrieve lists of designs filtered by visibility tag.

Example workflow:

Note: Maintaining the mapping between which users should be associated with which visibility tags is dependent on the Foursquare Targeting partner system. Foursquare Targeting does not maintain mappings of users to visibility tags.

Endpoint

https://api.targeting.foursquare.com/geopulse/designs/(design id)/grant

Syntax

Example

HTTP

POST /geopulse/designs/8d7d2d1f-7ee8-428e-9d27-23d7cfbf6c5d/grant HTTP/1.1
Host: api.targeting.foursquare.com
Content-Type: application/x-www-form-urlencoded
Content-Length: 67

visibility=pepsi%2Cdiet_coke&KEY=my_api_key

Request Parameters

Parameter Name Description Datatype Example
visibility Set of sluggified tags that you are assigning visibility for this design for. comma-delimited array of Strings visibility=pepsi,diet_coke
*KEY Your API Key. Note the KEY parameter name must be declared in all caps. String KEY=1Z88ulxbtb3jZnV7Gqlm9AcPwM6OojtSGbv98t6c

Notes on the visibility parameter:

Response Parameters

Parameter Name Description Datatype Example
version The version of the API response. Number 4
status The status of the API response. String "OK"

Example Response

JSON

{
  "version": 4,
  "status": "ok"
}