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 Item Resource

A Sync Map Item is an individual item that belongs to one or more of your Sync Maps.

See the full API reference documentation for the Sync Map resource here.

Map Items:

  • can be inserted, updated, removed and iterated
  • are limited to 16KB of data

MapItem properties

Names in PHP format
key

The unique user-defined key of this Map Item. Up to 320 characters long.

accountSid
sid<AC> Not PII

The unique SID identifier of the Twilio Account.

serviceSid
sid<IS> Not PII

The unique SID identifier of the Service Instance that hosts this Map object.

mapSid
sid<MP> Not PII

The unique 34-character SID identifier of the Map containing this Item.

url
url Not PII

The absolute URL for this Map.

revision
string Not PII

Contains the current revision of this Map, represented by a string identifier.

data

Contains arbitrary user-defined, schema-less data that this Map Item stores, represented by a JSON object, up to 16KB.

dateExpires
date_time<iso8601> Not PII

Contains the date this Map expires and gets deleted automatically. Contains null if the Map persists permanently.

dateCreated
date_time<iso8601> Not PII

The date this Map was created, given in UTC ISO 8601 format.

dateUpdated
date_time<iso8601> Not PII

Specifies the date this Map was last updated, given in UTC ISO 8601 format.

createdBy

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

Create a MapItem resource

post
https://sync.twilio.com/v1/Services/{ServiceSid}/Maps/{MapSid}/Items
Parameters
Names in None format
key
Required
post string PII MTL: 30 DAYS

The unique user-defined key of this Map Item. Up to 320 characters long.

data
Required
post object PII MTL: 7 DAYS

Contains arbitrary user-defined, schema-less data that this Map Item stores, represented by a JSON object, up to 16KB.

ttl
Optional
post integer Not PII

Alias for item_ttl. If both are provided, this value is ignored.

item_ttl
Optional
post integer Not PII

Time-to-live of this item in seconds, defaults to no expiration. In the range [1, 31 536 000 (1 year)], or 0 for infinity. Upon expiry, the map item will be cleaned up at least in a matter of hours, and often within seconds, making this a good tool for garbage management.

collection_ttl
Optional
post integer Not PII

Time-to-live of this item's parent Map in seconds, defaults to no expiration. In the range [1, 31 536 000 (1 year)], or 0 for infinity. This parameter can only be used when the map item's data or ttl is updated in the same request.

Example 1
        
        
        
        

        Fetch a MapItem resource

        get
        https://sync.twilio.com/v1/Services/{ServiceSid}/Maps/{MapSid}/Items/{Key}
        Example 1
              
              
              
              
              Request a MapItem by the key you defined when you created the item

              Fetch a MapItem

              Request a MapItem by the key you defined when you created the item

              Read all MapItem resources

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

              Map Item read access is performed using the key that provided as an arbitrary string to identify the item.

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

              Parameters
              Names in None format
              order
              Optional
              get enum:query_result_order Not PII

              A string; asc or desc. Map Items are ordered lexicographically by Item key.

              from
              Optional
              get string Not PII

              The Item key offset (including the specified key). If not present, query is performed from the start or end, depending on the Order query parameter.

              Example 1
                    
                    
                    
                    
                    Example 2
                          
                          
                          
                          

                          Update a MapItem resource

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

                          Map Item update access is performed using the key that provided as an arbitrary string to identify the item.

                          Parameters
                          Names in None format
                          data
                          Optional
                          post object PII MTL: 7 DAYS

                          Contains an arbitrary JSON object to be stored in this Map Item. Serialized to string to respect HTTP form input, up to 16KB.

                          ttl
                          Optional
                          post integer Not PII

                          Alias for item_ttl. If both are provided, this value is ignored.

                          item_ttl
                          Optional
                          post integer Not PII

                          Time-to-live of this item in seconds, defaults to no expiration. In the range [1, 31 536 000 (1 year)], or 0 for infinity. Upon expiry, the map item will be cleaned up at least in a matter of hours, and often within seconds, making this a good tool for garbage management.

                          collection_ttl
                          Optional
                          post integer Not PII

                          Time-to-live of this item's parent Map in seconds, defaults to no expiration. In the range [1, 31 536 000 (1 year)], or 0 for infinity. This parameter can only be used when the map item's data or ttl is updated in the same request.

                          Example 1
                                
                                
                                
                                

                                Delete a MapItem resource

                                delete
                                https://sync.twilio.com/v1/Services/{ServiceSid}/Maps/{MapSid}/Items/{Key}

                                Permanently delete a specific item from an existing Map.

                                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.