API Documentation

Locations

/{iid}/locations

GET

Retrieve a batched collection of locations.

This resource returns a batched list of locations. The location information returned depends on the 'fields' parameter.

Sample Call

>>> GET("/123/locations?fields=uuid-title-url-urlname&rpp=2")
{'items': [['461f3763-00bd-11e0-8d19-001ec21bff9e',
            'Sample Book Store',
            'https://api.metropublisher.com/123/locations/461f3763-00bd-11e0-8d19-001ec21bff9e',
            'sample-book-store'],
           ['fe23ac30-00bf-11e0-a955-001ec21bff9e',
            'Sample Nightclub',
            'https://api.metropublisher.com/123/locations/fe23ac30-00bf-11e0-a955-001ec21bff9e',
            'sample-nightclub']],
 'next': 'fields=uuid-title-url-urlname&page=2&rpp=2'}

Parameters

page:

The page number to retrieve.

optional

Default: 1

Values must not be lower than 1

rpp:

The number of results per page.

optional

Default: 20

Values must not be lower than 1 or higher than 100

state:

optional

Default: 'live' if the user is a public user else None.

Example value: "draft"

Values must be any of the following

published:

Only published

draft:

Only draft

Access is restricted to users with these roles:

type:

Filter the results by whether the location is a location, a standard listing or a sponsored listing.

Note

Only applies if the instance has the Directory Add-On.

optional

Default: None

Values must obey all the conditions

  • be any of the following

    listing:

    Listings only

    sponsored:

    Sponsored Listings only

    location:

    Locations only

  • instance has the Directory Add-On

fields:

A dash-separated list of fields to return.

optional

Default: ['url']

Example value: 'coords-uuid'

Every element of the list must be any of the following

coords:The location's coordinates (latitude/longitude).
title:The title
url:URL to the location
urlname:The urlname
uuid:The UUID of the location
order:

A dash-separated list of orderings to apply

optional

Default: []

Example value: 'sort_title-urlname.desc'

Every element of the list must be any of the following

sort_title:Sort by sort_title (if exists) or title ascending
sort_title.asc:Sort by sort_title (if exists) or title ascending
sort_title.desc:Sort by sort_title (if exists) or title descending
title:Sort by title ascending
title.asc:Sort by title ascending
title.desc:Sort by title descending
urlname:Sort by urlname ascending
urlname.asc:Sort by urlname ascending
urlname.desc:Sort by urlname descending
uuid:Sort by uuid ascending
uuid.asc:Sort by uuid ascending
uuid.desc:Sort by uuid descending

/{iid}/locations/{uuid}

DELETE

Deletes a location.

Sample Call

>>> DELETE("/123/locations/799d6c73-fe75-11df-837b-001ec21bff9e")
{'msg': 'deleted'}

GET

Retrieve one location.

This resource returns information about one specific location. The information it returns depends on the role of the API key. Some attributes are not publicly available.

Sample Call

>>> GET("/123/locations/14c68945-00ca-11e0-a6cf-001ec21bff9e")
{'closed': False,
 'content': '<p>Sed elit. In blandit sapien at nisi. ... Nam convallis tristique justo.</p>',
 'coords': [37.7981976, -122.4073589],
 'created': '2010-12-05T15:47:55.118294',
 'description': 'This is descriptive text for a location. ...',
 'email': None,
 'fax': None,
 'fb_headline': None,
 'fb_show_faces': True,
 'fb_show_stream': True,
 'fb_url': None,
 'geoname_id': 5391959,
 'lat': 37.7981976,
 'location_types': [],
 'long': -122.4073589,
 'modified': '2010-12-05T15:47:55.118294',
 'opening_hours': 'Tuesday through Sunday 6PM - 11PM',
 'pcode': '94133',
 'phone': '(415) 123-4563',
 'price_index': 'Moderate',
 'print_description': None,
 'sort_title': None,
 'state': 'published',
 'street': 'Columbus Avenue',
 'streetnumber': '325',
 'thumb_url': None,
 'title': 'Sample Restaurant',
 'twitter_username': None,
 'urlname': 'sample-restaurant',
 'uuid': '14c68945-00ca-11e0-a6cf-001ec21bff9e',
 'website': 'http://www.sample.com'}

Return Value

closed:

If true, the location is no longer in business.

contact_email:

The email address of the person to contact regarding the listing, for internal use only.

Note

only available for instances with Directory Add-On

contact_person:

The name of the person to contact regarding the listing, for internal use only.

Note

only available for instances with Directory Add-On

content:

see HTML-XML

coords:

The coordinates of the location consisting of latitude and longitude.

Note

If set to None, the location has no physical address. The fields street, streetnumber, pcode and geoname_id will be ignored/automatically set to None.

coupon_description:

Description of the coupon.

Note

only available for instances with Directory Add-On

coupon_expires:

The date/time when the coupon expires. A date/time in ISO 8601 format. See Dates and Times.

Note

only available for instances with Directory Add-On

coupon_img_url:

API url to the coupon image.

Note

only available for instances with Directory Add-On

coupon_img_uuid:

UUID of a linked coupon image.

Note

only available for instances with Directory Add-On

coupon_start:

The start date/time when the coupon becomes valid. A date/time in ISO 8601 format. See Dates and Times.

Note

only available for instances with Directory Add-On

coupon_title:

Title of the coupon.

Note

only available for instances with Directory Add-On

created:

The creation date/time in ISO 8601 format. See Dates and Times.

Access is restricted to users with these roles:

description:

A short description of the location.

email:

Email of the location.

fax:

Fax number of the location.

fb_headline:

Headline for the location's Facebook widget.

fb_show_faces:

Defines whether people's photos appear in the Facebook widget.

fb_show_stream:

Defines whether the Facebook stream appears in the Facebook widget.

fb_url:

Facebook URL of the location.

geoname_id:

The location's GeoName ID, see GeoNames.

If a location has an address, then the address's city is defined using the geoname_id.

The GeoName ID 3513090, for example, is the ID for Willemstad, the capital city of Curaçao.

Note

If not provided, the default geoname_id of the MP instance will be used.

Note

Ignored/automatically set to None if coords == None.

is_listing:

Defines whether this location is a standard location or a listing.

Note

only available for instances with Directory Add-On

lat:
listing_expires:

The date/time when the listing reverts to a normal location again, i.e. when the listing expires. A date/time in ISO 8601 format. See Dates and Times.

Note

only available for instances with Directory Add-On

listing_start:

The start date/time when the location becomes a listing. A date/time in ISO 8601 format. See Dates and Times.

Note

only available for instances with Directory Add-On

long:
modified:

The date/time of last modification in ISO 8601 format. See Dates and Times.

Access is restricted to users with these roles:

opening_hours:

The opening hours of the location

pcode:

Postal/Zip Code of the location.

Note

Ignored/automatically set to None if coords == None.

phone:

Phone number of the location.

price_index:

A general definer of the location price, e.g. how expensive a restaurant is.

print_description:
sort_title:
sponsored:

Defines whether a listing is a standard or an sponsored listing.

Note

only available for instances with Directory Add-On

state:
street:

The location's street.

Note

Ignored/automatically set to None if coords == None.

streetnumber:

The street/house number of the location.

Note

Ignored/automatically set to None if coords == None.

thumb_url:

The API url to the location's thumbnail image.

title:

The title of the location.

twitter_username:

Twitter username (without @) for the location.

urlname:

The location's urlname.

uuid:

The UUID of the location

website:

Website of the location.

PUT

Create/update a location.

Sending data to this resource does one of two things:

  • creates a new location if no location with the given UUID was found, or
  • updates the location with the given UUID.

Sample Call

>>> PUT("/123/locations/12345678-1234-1234-1234-123456789abc", {"urlname": "location-a",
...                                                             "coords": [40.1965, -74.16848],
...                                                             "geoname_id": 5097844,
...                                                             "title": "Location A"})
{'url': 'https://api.metropublisher.com/123/locations/12345678-1234-1234-1234-123456789abc',
 'uuid': '12345678-1234-1234-1234-123456789abc'}
>>> PUT("/123/locations/12345678-1234-1234-1234-123456789ccc", {"urlname": "location-c",
...                                                             "coords": [40.1965, -74.16848],
...                                                             "geoname_id": 5097844,
...                                                             "title": "Location C",
...                                                             "is_listing": "true",
...                                                             "contact_person": "Peter Parker",
...                                                             "listing_start": "2014-03-05"})
{'url': 'https://api.metropublisher.com/123/locations/12345678-1234-1234-1234-123456789ccc',
 'uuid': '12345678-1234-1234-1234-123456789ccc'}

Parameters

urlname:

see urlname

required

Example value: "biblioteka-públiko-kórsou"

Values must obey all the conditions

  • match the following regular expression:

    ^[^/@+][^/]*$

    Info: may not start with either @ or + and may not contain /.

  • be unique

title:

The location title

required

Example value: "Biblioteka Públiko Kórsou"

description:

A short description of the location.

optional

Default: None

Values must not be longer than 250

coords:

The coordinates of the location consisting of latitude and longitude.

Note

If set to None, the location has no physical address. The fields street, streetnumber, pcode and geoname_id will be ignored/automatically set to None.

optional

Default: None

Example value: [12.1084, -68.93365]

Element 0:

The latitude of the location.

required

Example value: 12.1084

Values must not be lower than -90.0 or higher than 90.0

Element 1:

The longitude of the location.

required

Example value: -68.93365

Values must not be lower than -180.0 or higher than 180.0

state:

optional

Default: 'draft'

Values must be any of the following

draft:

This object is a draft and is not visible on the public website.

published:

This object is published and is visible on the public website.

thumb_uuid:

The UUID of the location image.

optional

Default: None

Example value: '123456578-1234-1234-1234-123456789abc'

Values must obey all the conditions

  • be existing image UUID

  • be UUID or None

street:

The location's street.

Note

Ignored/automatically set to None if coords == None.

optional

Default: None

streetnumber:

The street/house number of the location.

Note

Ignored/automatically set to None if coords == None.

optional

Default: None

pcode:

Postal/Zip Code of the location.

Note

Ignored/automatically set to None if coords == None.

optional

Default: None

geoname_id:

The location's GeoName ID, see GeoNames.

If a location has an address, then the address's city is defined using the geoname_id.

The GeoName ID 3513090, for example, is the ID for Willemstad, the capital city of Curaçao.

Note

If not provided, the default geoname_id of the MP instance will be used.

Note

Ignored/automatically set to None if coords == None.

optional

Example value: 3513090

Must be a geoname id (see GeoNames)

phone:

Phone number of the location.

optional

Default: None

fax:

Fax number of the location.

optional

Default: None

email:

Email of the location.

optional

Default: None

Values must match the following regular expression:

^[A-Za-z0-9!#$%&'*+/=?^_`{|}~.-]+@[A-Za-z0-9.-]+\.[A-Za-z]*$

Info: The regular expression tries to verify the following pattern:

<string of characters>@<string of characters>.<string of characters>

The first string may contain a number of different special characters besides letters and numbers, such as an underscore (_) or asterisk (*), while the second string must contain only letters, numbers, dashes (-) and dots (.).

website:

Website of the location.

optional

Default: None

Example value: "http://www.curacaopubliclibrary.an/"

Values must obey all the conditions

  • match the following regular expression:

    ^[A-Za-z][-A-Za-z0-9+\.]*:

    Info: The value should be a URL with a scheme. The regular expression does a simple check to make sure the value starts with a letter, is followed by zero or more letters, numbers, or the plus-sign (+), minus-sign (-) or dot (.), and then a colon (:).

  • Value must be more than just the URL scheme (i.e. more than just 'http://').

price_index:

A general definer of the location price, e.g. how expensive a restaurant is.

optional

Default: None

Example value: "free"

Values must be any of the following

expensive:
free:
inexpensive:
moderate:
very_expensive:
opening_hours:

The opening hours of the location

optional

Default: None

content:

see HTML-XML

optional

Default: None

Example value: "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.<p>"

Values must obey all the conditions

  • Value must not contain unicode characters x00-x08 or x0b-x1f

  • XML-compliant HTML, see HTML-XML for restrictions on HTML tags

created:

The creation date/time in ISO 8601 format. See Dates and Times.

optional

Default: <current timestamp>

Example value: '2012-01-01T11:30:45'

Values must restricted to users with these roles:

modified:

The date/time of last modification in ISO 8601 format. See Dates and Times.

optional

Default: <current timestamp>

Example value: '2012-01-01T11:30:45'

Values must restricted to users with these roles:

location_types:

Deprecated since MP 3.x:

As of MP 3.0, all location types have been converted to tags. Please see the tagging resources to assign tags to locations.

(also see ChangeLog)

optional

Default: None

closed:

If true, the location is no longer in business.

optional

Default: False

Values must be any of the following

False:

Location is open for business.

True:

Location is closed for business.

print_description:

optional

Default: None

sort_title:

optional

Default: None

fb_headline:

Headline for the location's Facebook widget.

optional

Default: None

Values must not be longer than 255

fb_url:

Facebook URL of the location.

optional

Default: None

Values must obey all the conditions

  • match the following regular expression:

    ^[A-Za-z][-A-Za-z0-9+\.]*:

    Info: The value should be a URL with a scheme. The regular expression does a simple check to make sure the value starts with a letter, is followed by zero or more letters, numbers, or the plus-sign (+), minus-sign (-) or dot (.), and then a colon (:).

  • Value must be more than just the URL scheme (i.e. more than just 'http://').

fb_show_faces:

Defines whether people's photos appear in the Facebook widget.

optional

Default: True

Values must be any of the following

False:

do not show photos

True:

show photos

fb_show_stream:

Defines whether the Facebook stream appears in the Facebook widget.

optional

Default: True

Values must be any of the following

False:

do not show stream

True:

show stream

twitter_username:

Twitter username (without @) for the location.

optional

Default: None

must be the username without @ and must contain only letters, numbers or underscore (_); no longer than 15 characters

is_listing:

Defines whether this location is a standard location or a listing.

optional

Default: False

Values must obey all the conditions

  • instance has the Directory Add-On

  • be any of the following

    False:

    This is a standard location, not a listing.

    True:

    This is a listing, which will show up in the directory.

  • instance has the Directory Add-On

Additional parameters for type: is_listing = True

coupon_img_uuid:

UUID of a linked coupon image.

optional

Default: None

Example value: '123456578-1234-1234-1234-123456789abc'

Values must obey all the conditions

  • instance has the Directory Add-On

  • be UUID or None

  • be existing image UUID

  • must not be used if is_listing is False

coupon_title:

Title of the coupon.

optional

Default: None

Values must obey all the conditions

  • instance has the Directory Add-On

  • must not be longer than 255

  • must not be used if is_listing is False

coupon_description:

Description of the coupon.

optional

Default: None

Values must obey all the conditions

coupon_start:

The start date/time when the coupon becomes valid. A date/time in ISO 8601 format. See Dates and Times.

optional

Default: None

Example value: '2012-01-01T11:30:45'

Values must obey all the conditions

coupon_expires:

The date/time when the coupon expires. A date/time in ISO 8601 format. See Dates and Times.

optional

Default: None

Example value: '2012-01-01T11:30:45'

Values must obey all the conditions

sponsored:

Defines whether a listing is a standard or an sponsored listing.

optional

Default: False

Values must obey all the conditions

  • instance has the Directory Add-On

  • be any of the following

    False:

    This is a standard listing.

    True:

    This is a sponsored listing.

  • must not be used if is_listing is False

contact_person:

The name of the person to contact regarding the listing, for internal use only.

optional

Default: None

Values must obey all the conditions

contact_email:

The email address of the person to contact regarding the listing, for internal use only.

optional

Default: None

Values must obey all the conditions

  • instance has the Directory Add-On

  • match the following regular expression:

    ^[A-Za-z0-9!#$%&'*+/=?^_`{|}~.-]+@[A-Za-z0-9.-]+\.[A-Za-z]*$

    Info: The regular expression tries to verify the following pattern:

    <string of characters>@<string of characters>.<string of characters>

    The first string may contain a number of different special characters besides letters and numbers, such as an underscore (_) or asterisk (*), while the second string must contain only letters, numbers, dashes (-) and dots (.).

  • must not be used if is_listing is False

listing_start:

The start date/time when the location becomes a listing. A date/time in ISO 8601 format. See Dates and Times.

optional

Example value: '2012-01-01T11:30:45'

Values must obey all the conditions

listing_expires:

The date/time when the listing reverts to a normal location again, i.e. when the listing expires. A date/time in ISO 8601 format. See Dates and Times.

optional

Default: None

Example value: '2012-01-01T11:30:45'

Values must obey all the conditions

/{iid}/locations/{uuid}

PATCH

Update specific attributes of a location.

Sample Call

>>> PATCH("/123/locations/799d6c73-fe75-11df-837b-001ec21bff9e",
...            {'title': 'NEW TITLE'})
{'url': 'https://api.metropublisher.com/123/locations/799d6c73-fe75-11df-837b-001ec21bff9e',
 'uuid': '799d6c73-fe75-11df-837b-001ec21bff9e'}

Parameters

urlname:

see urlname

optional

Example value: "biblioteka-públiko-kórsou"

Values must obey all the conditions

  • match the following regular expression:

    ^[^/@+][^/]*$

    Info: may not start with either @ or + and may not contain /.

  • be unique

title:

The location title

optional

Example value: "Biblioteka Públiko Kórsou"

description:

A short description of the location.

optional

Values must not be longer than 250

coords:

The coordinates of the location consisting of latitude and longitude.

Note

If set to None, the location has no physical address. The fields street, streetnumber, pcode and geoname_id will be ignored/automatically set to None.

optional

Example value: [12.1084, -68.93365]

Element 0:

The latitude of the location.

required

Example value: 12.1084

Values must not be lower than -90.0 or higher than 90.0

Element 1:

The longitude of the location.

required

Example value: -68.93365

Values must not be lower than -180.0 or higher than 180.0

state:

optional

Values must be any of the following

draft:

This object is a draft and is not visible on the public website.

published:

This object is published and is visible on the public website.

thumb_uuid:

The UUID of the location image.

optional

Example value: '123456578-1234-1234-1234-123456789abc'

Values must obey all the conditions

  • be existing image UUID

  • be UUID or None

street:

The location's street.

Note

Ignored/automatically set to None if coords == None.

optional

streetnumber:

The street/house number of the location.

Note

Ignored/automatically set to None if coords == None.

optional

pcode:

Postal/Zip Code of the location.

Note

Ignored/automatically set to None if coords == None.

optional

geoname_id:

The location's GeoName ID, see GeoNames.

If a location has an address, then the address's city is defined using the geoname_id.

The GeoName ID 3513090, for example, is the ID for Willemstad, the capital city of Curaçao.

Note

If not provided, the default geoname_id of the MP instance will be used.

Note

Ignored/automatically set to None if coords == None.

optional

Example value: 3513090

Must be a geoname id (see GeoNames)

phone:

Phone number of the location.

optional

fax:

Fax number of the location.

optional

email:

Email of the location.

optional

Values must match the following regular expression:

^[A-Za-z0-9!#$%&'*+/=?^_`{|}~.-]+@[A-Za-z0-9.-]+\.[A-Za-z]*$

Info: The regular expression tries to verify the following pattern:

<string of characters>@<string of characters>.<string of characters>

The first string may contain a number of different special characters besides letters and numbers, such as an underscore (_) or asterisk (*), while the second string must contain only letters, numbers, dashes (-) and dots (.).

website:

Website of the location.

optional

Example value: "http://www.curacaopubliclibrary.an/"

Values must obey all the conditions

  • match the following regular expression:

    ^[A-Za-z][-A-Za-z0-9+\.]*:

    Info: The value should be a URL with a scheme. The regular expression does a simple check to make sure the value starts with a letter, is followed by zero or more letters, numbers, or the plus-sign (+), minus-sign (-) or dot (.), and then a colon (:).

  • Value must be more than just the URL scheme (i.e. more than just 'http://').

price_index:

A general definer of the location price, e.g. how expensive a restaurant is.

optional

Example value: "free"

Values must be any of the following

expensive:
free:
inexpensive:
moderate:
very_expensive:
opening_hours:

The opening hours of the location

optional

content:

see HTML-XML

optional

Example value: "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.<p>"

Values must obey all the conditions

  • Value must not contain unicode characters x00-x08 or x0b-x1f

  • XML-compliant HTML, see HTML-XML for restrictions on HTML tags

created:

The creation date/time in ISO 8601 format. See Dates and Times.

optional

Example value: '2012-01-01T11:30:45'

Values must restricted to users with these roles:

modified:

The date/time of last modification in ISO 8601 format. See Dates and Times.

optional

Example value: '2012-01-01T11:30:45'

Values must restricted to users with these roles:

location_types:

Deprecated since MP 3.x:

As of MP 3.0, all location types have been converted to tags. Please see the tagging resources to assign tags to locations.

(also see ChangeLog)

optional

closed:

If true, the location is no longer in business.

optional

Values must be any of the following

False:

Location is open for business.

True:

Location is closed for business.

print_description:

optional

sort_title:

optional

fb_headline:

Headline for the location's Facebook widget.

optional

Values must not be longer than 255

fb_url:

Facebook URL of the location.

optional

Values must obey all the conditions

  • match the following regular expression:

    ^[A-Za-z][-A-Za-z0-9+\.]*:

    Info: The value should be a URL with a scheme. The regular expression does a simple check to make sure the value starts with a letter, is followed by zero or more letters, numbers, or the plus-sign (+), minus-sign (-) or dot (.), and then a colon (:).

  • Value must be more than just the URL scheme (i.e. more than just 'http://').

fb_show_faces:

Defines whether people's photos appear in the Facebook widget.

optional

Values must be any of the following

False:

do not show photos

True:

show photos

fb_show_stream:

Defines whether the Facebook stream appears in the Facebook widget.

optional

Values must be any of the following

False:

do not show stream

True:

show stream

twitter_username:

Twitter username (without @) for the location.

optional

must be the username without @ and must contain only letters, numbers or underscore (_); no longer than 15 characters

is_listing:

Defines whether this location is a standard location or a listing.

optional

Values must obey all the conditions

  • instance has the Directory Add-On

  • be any of the following

    False:

    This is a standard location, not a listing.

    True:

    This is a listing, which will show up in the directory.

  • instance has the Directory Add-On

Additional parameters for type: is_listing = True

coupon_img_uuid:

UUID of a linked coupon image.

optional

Example value: '123456578-1234-1234-1234-123456789abc'

Values must obey all the conditions

  • instance has the Directory Add-On

  • be UUID or None

  • be existing image UUID

  • must not be used if is_listing is False

coupon_title:

Title of the coupon.

optional

Values must obey all the conditions

  • instance has the Directory Add-On

  • must not be longer than 255

  • must not be used if is_listing is False

coupon_description:

Description of the coupon.

optional

Values must obey all the conditions

coupon_start:

The start date/time when the coupon becomes valid. A date/time in ISO 8601 format. See Dates and Times.

optional

Example value: '2012-01-01T11:30:45'

Values must obey all the conditions

coupon_expires:

The date/time when the coupon expires. A date/time in ISO 8601 format. See Dates and Times.

optional

Example value: '2012-01-01T11:30:45'

Values must obey all the conditions

sponsored:

Defines whether a listing is a standard or an sponsored listing.

optional

Values must obey all the conditions

  • instance has the Directory Add-On

  • be any of the following

    False:

    This is a standard listing.

    True:

    This is a sponsored listing.

  • must not be used if is_listing is False

contact_person:

The name of the person to contact regarding the listing, for internal use only.

optional

Values must obey all the conditions

contact_email:

The email address of the person to contact regarding the listing, for internal use only.

optional

Values must obey all the conditions

  • instance has the Directory Add-On

  • match the following regular expression:

    ^[A-Za-z0-9!#$%&'*+/=?^_`{|}~.-]+@[A-Za-z0-9.-]+\.[A-Za-z]*$

    Info: The regular expression tries to verify the following pattern:

    <string of characters>@<string of characters>.<string of characters>

    The first string may contain a number of different special characters besides letters and numbers, such as an underscore (_) or asterisk (*), while the second string must contain only letters, numbers, dashes (-) and dots (.).

  • must not be used if is_listing is False

listing_start:

The start date/time when the location becomes a listing. A date/time in ISO 8601 format. See Dates and Times.

optional

Example value: '2012-01-01T11:30:45'

Values must obey all the conditions

listing_expires:

The date/time when the listing reverts to a normal location again, i.e. when the listing expires. A date/time in ISO 8601 format. See Dates and Times.

optional

Example value: '2012-01-01T11:30:45'

Values must obey all the conditions

/{iid}/locations/{uuid}/tags

GET

Get all tags for a location.

Sample Call

>>> GET("/123/locations/461f3763-00bd-11e0-8d19-001ec21bff9e/tags")
{'items': [{'predicate': 'describes',
            'title': 'Sample Tag',
            'url': 'https://api.metropublisher.com/123/tags/60183d70-a998-11e1-afa6-0800200c9a66',
            'uuid': '60183d70-a998-11e1-afa6-0800200c9a66'},
           {'predicate': 'describes',
            'title': 'Restaurant',
            'url': 'https://api.metropublisher.com/123/tags/7fbbe910-a998-11e1-afa6-0800200c9a66',
            'uuid': '7fbbe910-a998-11e1-afa6-0800200c9a66'}]}

Parameters

state:

optional

Default: 'approved' if the user is a public user else None.

Values must be any of the following

internal:

Only internal tags

Access is restricted to users with these roles:

approved:

Only approved tags

provisional:

Only provisional tags

Access is restricted to users with these roles:

/{iid}/locations/{uuid}/path_history

GET

Get the path history of a location.

Sample Call

>>> GET("/123/locations/799d6c73-fe75-11df-837b-001ec21bff9e/path_history")
{'items': [{'path': '/locations/loc-01/'},
           {'path': '/locations/locaton-01/'},
           {'path': '/locations/location-01/'}]}

/{iid}/locations/{uuid}/path_history

POST

Create new path history entry for the location.

This resource creates a new path history entry and adds it to the existing list of path history entries for the location.

Sample Call

Add a new path history entry:

>>> POST("/123/locations/799d6c73-fe75-11df-837b-001ec21bff9e/path_history",
...                      {"path": "/old/path/to/location/index.html?loc_id=1234"})
{'msg': 'path added'}

Parameters

path:

The unquoted, utf-8-decoded old path to the location.

required

Example value: "/old/path/to/location/loc_1234.html"

must be an absolute path

/{iid}/locations/{uuid}/path_history

PUT

Create/update the path_history of the location.

This resource creates/replaces the path_history of the location.

Sample Call

Set the path history of a location:

>>> PUT("/123/locations/799d6c73-fe75-11df-837b-001ec21bff9e/path_history",
...            {'items': [{"path": "/location.php?id=1234"},
...                       {"path": "/locations/index.html?item=54321&show_details=1"}]})
{'msg': 'path history updated'}

Remove a location's path history:

>>> PUT("/123/locations/799d6c73-fe75-11df-837b-001ec21bff9e/path_history",
...            {'items': []})
{'msg': 'path history updated'}

Parameters

items:

required

Every element of the list is a dictionary, each consisting of the following fields:

path:

The unquoted, utf-8-decoded old path to the location.

required

Example value: "/old/path/to/location/loc_1234.html"

must be an absolute path