2016-10-04 12:11:58 +08:00
#type: collection
2016-09-22 01:22:40 +08:00
get:
2016-12-18 16:17:51 -05:00
is: [ searchable: { searchFields: "name, desc" }, embeddable: { embedFields: "user,source,topics,synapses,mappings,contributors,collaborators" }, orderable, pageable ]
2017-02-12 09:54:54 -08:00
securedBy: [ null, token, oauth_2_0 ]
2016-10-29 22:07:27 +08:00
queryParameters:
user_id:
description: |
Pass a user_id to only return maps created by that user. For example, `/api/v2/maps?user_id=1` would return maps created by the Metamaps user with id 1.
required: false
type: number
2016-09-22 01:22:40 +08:00
responses:
200:
body:
application/json:
example: !include ../examples/maps.json
post:
body:
application/json:
properties:
name:
description: name
desc:
description: description
permission:
description: commons, public, or private
2016-12-18 16:17:51 -05:00
source_id:
description: the id of the map this map is a fork of
2016-09-22 01:22:40 +08:00
screenshot:
description: url to a screenshot of the map
contributor_ids:
2016-10-05 10:38:16 -04:00
description: the ids of people who have contributed to the map
2016-09-22 01:22:40 +08:00
collaborator_ids:
2016-10-05 10:38:16 -04:00
description: the ids of people who have edit access to the map
2016-09-22 01:22:40 +08:00
responses:
201:
body:
application/json:
example: !include ../examples/map.json
/{id}:
2016-10-04 12:11:58 +08:00
#type: item
2016-09-22 01:22:40 +08:00
get:
2016-12-18 16:17:51 -05:00
is: [ embeddable: { embedFields: "user,source,topics,synapses,mappings,contributors,collaborators" } ]
2017-02-12 09:54:54 -08:00
securedBy: [ null, token, oauth_2_0 ]
2016-09-22 01:22:40 +08:00
responses:
200:
body:
application/json:
example: !include ../examples/map.json
put:
body:
application/json:
properties:
name:
description: name
2016-10-04 15:30:06 +08:00
required: false
2016-09-22 01:22:40 +08:00
desc:
description: description
2016-10-04 15:30:06 +08:00
required: false
2016-09-22 01:22:40 +08:00
permission:
description: commons, public, or private
2016-10-04 15:30:06 +08:00
required: false
2016-09-22 01:22:40 +08:00
screenshot:
description: url to a screenshot of the map
2016-10-04 15:30:06 +08:00
required: false
2016-12-18 16:17:51 -05:00
source_id:
description: the id of the map this map is a fork of
required: false
2016-09-22 01:22:40 +08:00
responses:
200:
body:
application/json:
example: !include ../examples/map.json
patch:
body:
application/json:
properties:
name:
description: name
2016-10-04 15:30:06 +08:00
required: false
2016-09-22 01:22:40 +08:00
desc:
description: description
2016-10-04 15:30:06 +08:00
required: false
2016-09-22 01:22:40 +08:00
permission:
description: commons, public, or private
2016-10-04 15:30:06 +08:00
required: false
2016-09-22 01:22:40 +08:00
screenshot:
description: url to a screenshot of the map
2016-10-04 15:30:06 +08:00
required: false
2016-12-18 16:17:51 -05:00
source_id:
description: the id of the map this map is a fork of
required: false
2016-09-22 01:22:40 +08:00
responses:
200:
body:
application/json:
example: !include ../examples/map.json
delete:
responses:
204:
description: No content
2016-10-05 22:36:03 +08:00
/stars:
post:
responses:
201:
description: Created
body:
application/json:
2016-10-29 22:07:27 +08:00
example: !include ../examples/map_starred.json
2016-10-05 22:36:03 +08:00
delete:
responses:
204:
description: No content