Search code examples
glympse

How to share location with public tag with Glympse REST API


I am trying to share a location to a public tag in Glympse with their REST API. My application is creating a ticket with
/v2/users/self/create_ticket

After that I am trying to add that ticket to the public tag/group (which is already available). /v2/tickets/${ticketid}/append_data

{ 
  [
    "t": ${timestamp},
    "pid": 0,
    "n": "card_id",
    "v": card_id  // I am putting the group ID here
  ]
}

After that I have no clue how to proceed. I find the Glympse API description very confusing, so I tried several API functions but none of them worked, like updating the card /v2/cards/${groupdid}/ticket

error: { result: 'failure',   response: {},   meta:     { error: 'invalid_access',
     error_detail: 'Error processing request',
     time: 1506944558077 } }

or simply just adding location data (no error but nothing visible in the tag) /v2/tickets/${ticketid}/append_location.

Can you help me with the flow how to share the data to a public tag? I cannot find anything like that for the REST API. I could find this link: https://developer.glympse.com/docs/core/client-sdk/guides/common/groups but it does not help me with JavaScript and REST.

Thank you


Solution

  • Cards are only for private groups. To share to a public group (public tag) after you create the ticket, you create an invite of type "group" where the address is the name of the tag.

    https://developer.glympse.com/docs/core/api/reference/tickets/id/create_invite/post

    The group type appears to be missing from that reference page, but that is the type to use.

    For example, to share to a tag named "testtag123": tickets/[ticket_id]/create_invite?locale=en_US&region=en_US&type=group&send=server&address=testtag123&name=testtag123