How can I update an existing Location Segment through the API?

This article will walk you through updating existing Location Segments through the API.
For all of the examples below, please use your app key and master secret for your application.
Please also fill in the segment ID when needed.

Step 1: Get list of Segments

This will provide a list of all segments made on your application.


curl -X GET -u "<appkey>:<Secret>" -H "Content-Type: application/json"


{"segments":[{"id":"2005f63c-541a-4141-b598-35b826800aaa","display_name":"Test","creation_date":1387559344243,"modification_date":1387560894985},{"id":"8e1a0668-0e09-4f7d-b22e-4516f954be4e","display_name":"Austin TX 78750","creation_date":1387554776052,"modification_date":1387554776052},{"id":"c4774338-89d8-49f1-8124-79c9c9022656","display_name":"Test","creation_date":1387467286345,"modification_date":1387467286345}]}


Step 2: Get specific details about Segment

This request will allow you to see details about a specific segment. Just add in the Segment ID from the Step 1 response.


curl -X GET -u "<appkey>:<Secret>" -H "Content-Type: application/json"<segment ID>



Step 3: Update Segment

This request will update the segment. Make sure you copy the response from Step 2  to add in the data parameter, then change the needed information from here.


curl -X PUT -u "<appkey>:<Secret>" -H "Content-Type: application/json" --data '{"display_name":"Test","criteria":{"and":[{"location":{"id":"5Wwxd2b4EAexYxsJbTQGUr","date":{"recent":{"hours":1}}}}]}}'<segment>





Was this article helpful?
0 out of 0 found this helpful
Submit a request