Skip to content

Instantly share code, notes, and snippets.

@gangstaJS
Last active November 15, 2019 10:50
Show Gist options
  • Save gangstaJS/89327bce0230e179e06472c5fe27edbb to your computer and use it in GitHub Desktop.
Save gangstaJS/89327bce0230e179e06472c5fe27edbb to your computer and use it in GitHub Desktop.
tags.md

Get tags

GET /tags?type=farm

[
  {
    id: 1,
    name: 'My Cool tag for NRx',
  }
]

Get attached to a tag entities

GET /tags/1

Response:

[
      {
        name: 'Landmark Demo',
        id: 10026,
      },
      {
        name: '1000 circles',
        id: 10025,
      }
 ]

Create tag POST /tags

Payload:

{
  name: "My new cool tag"
}

Response:

{
    id: 2,
    name: 'My new cool tag',
    entities: null,
  }

Attach entity

PUT /tags/entities

Payload:

{
  tag_id: 2,
  entity_ids: [10, 20, 10029],
}

Delete entities from tag

DELETE /tags/entities

Payload:

{
  tag_id: 1,
  entity_ids: [10, 20, 10029],
}

Delete tags

Payload:

{
  tag_ids: [1,2],
}

Edit tag name

PUT /tags

Payload

{
  id: 1,
  name: 'new cool name'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment