Level up your Twilio API skills in TwilioQuest, an educational game for Mac, Windows, and Linux. Download Now

Menu

Expand
Rate this page:

Thanks for rating this page!

We are always striving to improve our documentation quality, and your feedback is valuable to us. How could this documentation serve you better?

Map Resource

A Sync Map is an unordered collection of individual Map items.

You can find the full API reference documentation for Sync Map Items here.

A few notes about Sync Maps:

  • Full map modification history persists with every change that triggers a new revision.
  • Strict ordering of map mutation events is guaranteed, but the map item order is not defined.
  • By default, data persists permanently, but maps will expire and be deleted automatically if eviction is configured via the TTL parameter.

Map properties

Each Map object root resource has the following properties.

Unique name and expiration date attributes are optional and may be null.

Names in PHP format
sid
sid<MP> Not PII

The unique string that we created to identify the Sync Map resource.

uniqueName

An application-defined string that uniquely identifies the resource. It can be used in place of the resource's sid in the URL to address the resource.

accountSid
sid<AC> Not PII

The SID of the Account that created the Sync Map resource.

serviceSid
sid<IS> Not PII

The SID of the Sync Service the resource is associated with.

url
url Not PII

The absolute URL of the Sync Map resource.

links
uri_map Not PII

The URLs of the Sync Map's nested resources.

revision
string Not PII

The current revision of the Sync Map, represented as a string.

dateExpires
date_time<iso8601> Not PII

The date and time in GMT when the Sync Map expires and will be deleted, specified in ISO 8601 format. If the Sync Map does not expire, this value is null. The Sync Map might not be deleted immediately after it expires.

dateCreated
date_time<iso8601> Not PII

The date and time in GMT when the resource was created specified in ISO 8601 format.

dateUpdated
date_time<iso8601> Not PII

The date and time in GMT when the resource was last updated specified in ISO 8601 format.

createdBy

The identity of the Sync Map's creator. If the Sync Map is created from the client SDK, the value matches the Access Token's identity field. If the Sync Map was created from the REST API, the value is system.

Create a SyncMap resource

post
https://sync.twilio.com/v1/Services/{ServiceSid}/Maps

Create a new Map in this Service Instance, optionally giving it a unique name and assigning an expiration deadline.

Parameters
Names in None format
service_sid
Required
post sid_like<IS> Not PII

The SID of the Sync Service to create the Sync Map in.

unique_name
Optional
post string PII MTL: 30 DAYS

An application-defined string that uniquely identifies the resource. It can be used as an alternative to the sid in the URL path to address the resource.

ttl
Optional
post integer Not PII

An alias for collection_ttl. If both parameters are provided, this value is ignored.

collection_ttl
Optional
post integer Not PII

How long, in seconds, before the Sync Map expires (time-to-live) and is deleted. Can be an integer from 0 to 31,536,000 (1 year). The default value is 0, which means the Sync Map does not expire. The Sync Map will be deleted automatically after it expires, but there can be a delay between the expiration time and the resources's deletion.

Example 1
        
        
        
        
        Example 2
              
              
              
              
              Example 3
                    
                    
                    
                    
                    Set TTL (in seconds) for expiring this Map instance

                    Create a Map with an expiration deadline

                    Set TTL (in seconds) for expiring this Map instance

                    Fetch a SyncMap resource

                    get
                    https://sync.twilio.com/v1/Services/{ServiceSid}/Maps/{Sid}
                    Parameters
                    Names in None format
                    service_sid
                    Required
                    get sid_like<IS> Not PII

                    The SID of the Sync Service with the Sync Map resource to fetch.

                    sid
                    Required
                    get sid_like<MP> Not PII

                    The SID of the Sync Map resource to fetch.

                    Example
                          
                          
                          
                          

                          Read multiple SyncMap resources

                          get
                          https://sync.twilio.com/v1/Services/{ServiceSid}/Maps

                          Retrieve a list of all Maps belonging to this Service Instance.

                          By default, this will return the first 50 Maps. Supply a PageSize parameter to fetch up to 100 items at once. See paging for more information.

                          Parameters
                          Names in None format
                          service_sid
                          Required
                          get sid_like<IS> Not PII

                          The SID of the Sync Service with the Sync Map resources to read.

                          Example
                                
                                
                                
                                

                                Update a SyncMap resource

                                post
                                https://sync.twilio.com/v1/Services/{ServiceSid}/Maps/{Sid}
                                Parameters
                                Names in None format
                                service_sid
                                Required
                                post sid_like<IS> Not PII

                                The SID of the Sync Service with the Sync Map resource to update.

                                sid
                                Required
                                post sid_like<MP> Not PII

                                The SID of the Sync Map resource to update.

                                ttl
                                Optional
                                post integer Not PII

                                An alias for collection_ttl. If both parameters are provided, this value is ignored.

                                collection_ttl
                                Optional
                                post integer Not PII

                                How long, in seconds, before the Sync Map expires (time-to-live) and is deleted. Can be an integer from 0 to 31,536,000 (1 year). The default value is 0, which means the Sync Map does not expire. The Sync Map will be deleted automatically after it expires, but there can be a delay between the expiration time and the resources's deletion.

                                Example
                                      
                                      
                                      
                                      

                                      Delete a Map resource

                                      delete
                                      https://sync.twilio.com/v1/Services/{ServiceSid}/Maps/{Sid}

                                      Permanently delete a specific Map along with all items belonging to it from a given Sync Service Instance.

                                      Parameters
                                      Names in None format
                                      service_sid
                                      Required
                                      delete sid_like<IS> Not PII

                                      The SID of the Sync Service with the Sync Map resource to delete.

                                      sid
                                      Required
                                      delete sid_like<MP> Not PII

                                      The SID of the Sync Map resource to delete.

                                      Example 1
                                            
                                            
                                            
                                            
                                            Rate this page:

                                            Need some help?

                                            We all do sometimes; code is hard. Get help now from our support team, or lean on the wisdom of the crowd browsing the Twilio tag on Stack Overflow.