Glympse REST API - expired tickets

160 Views Asked by At

I have two questions on the Glympse API:

  1. I am sharing my location by (initially creating a ticket,) uploading location data (/v2/tickets/ticketID/append_location) and appending data (/v2/tickets/ticketID/append_data). If there is already a ticket existing, I am just uploading more recent data (append_location + append_data) and update the ticket (/v2/tickets/ticketID/update?duration=ticketDuration). Now, once the ticket has expired how can I make it active again? Currently I am creating a new ticket which makes the "same user" (but with different ticket) appear again in the Glympse mobile app.
  2. In a group, I can see expired users for a very long time. Once they do not share their location anymore, it takes one or two days until they are removed from the group. How can I remove them instantly once their ticket has become expired?

Thank you

2

There are 2 best solutions below

6
Nick Glickenhouse On
  1. Once a ticket is expired it cannot be reactivated. Small snippet from the Glympse programming guide: https://developer.glympse.com/docs/core/client-sdk/guides/common/programming-guide

Tickets can only transition into GC::TICKET_EXPIRED state once. A ticket is considered immutable after it transitions into the expired state. It leaves the expired state only if being deleted explicitly. This is the only operation that is allowed for expired tickets.

  1. A group member can remove themselves immediately from a group by sending a POST groups/[group_id]/leave

Otherwise, as you noticed the member's ticket information will remain in the group for 48 hours following their ticket's expiration. Group members cannot remove another member from a group.

0
perihel On

For others who are interested: The answer to my question is very simple. If a ticket for a user has expired, this very user needs to delete his ticket "/v2/tickets/ticketID/delete?oauth_token=oauth". With the deletion of the ticket, the expired position will vanish immediately.