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 REST API format
key

The unique, user-defined key for the Map Item.

account_sid
sid<AC> Not PII

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

service_sid
sid<IS> Not PII

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

map_sid
sid<MP> Not PII

The SID of the Sync Map that contains the Map Item.

url
url Not PII

The absolute URL of the Map Item resource.

revision
string Not PII

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

data

An arbitrary, schema-less object that the Map Item stores. Can be up to 16KB in length.

date_expires
date_time<iso8601> Not PII

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

date_created
date_time<iso8601> Not PII

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

date_updated
date_time<iso8601> Not PII

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

created_by

The identity of the Map Item's creator. If the Map Item is created from the client SDK, the value matches the Access Token's identity field. If the Map Item 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 REST API format
service_sid
Path
post sid_like<IS> Not PII

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

map_sid
Path
post sid_like<MP> Not PII

The SID of the Sync Map to add the new Map Item to.

key
Required
post string PII MTL: 30 DAYS

The unique, user-defined key for the Map Item. Can be up to 320 characters long.

data
Required
post object PII MTL: 7 DAYS

A JSON string that represents an arbitrary, schema-less object that the Map Item stores. Can be up to 16KB in length.

ttl
Optional
post integer Not PII

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

item_ttl
Optional
post integer Not PII

How long, in seconds, before the Map Item 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 Map Item does not expire. The Map Item will be deleted automatically after it expires, but there can be a delay between the expiration time and the resources's deletion.

collection_ttl
Optional
post integer Not PII

How long, in seconds, before the Map Item's parent 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 parent 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
        
        
        
        

        Fetch a MapItem resource

        get
        https://sync.twilio.com/v1/Services/{ServiceSid}/Maps/{MapSid}/Items/{Key}
        Parameters
        Names in REST API format
        service_sid
        Path
        get sid_like<IS> Not PII

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

        map_sid
        Path
        get sid_like<MP> Not PII

        The SID of the Sync Map with the Sync Map Item resource to fetch. Can be the Sync Map's sid or its unique_name.

        key
        Path
        get string PII MTL: 30 DAYS

        The key value of the Sync Map Item resource to fetch.

        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 REST API format
              service_sid
              Path
              get sid_like<IS> Not PII

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

              map_sid
              Path
              get sid_like<MP> Not PII

              The SID of the Sync Map with the Sync Map Item resource to fetch. Can be the Sync Map's sid or its unique_name.

              order
              Optional
              get enum:query_result_order Not PII

              How to order the Map Items returned by their key value. Can be: asc (ascending) or desc (descending) and the default is ascending. Map Items are ordered lexicographically by Item key.

              from
              Optional
              get string Not PII

              The key of the first Sync Map Item resource to read. See also bounds.

              bounds
              Optional
              get enum:query_from_bound_type Not PII

              Whether to include the Map Item referenced by the from parameter. Can be: inclusive to include the Map Item referenced by the from parameter or exclusive to start with the next Map Item. The default value is inclusive.

              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 REST API format
                          service_sid
                          Path
                          post sid_like<IS> Not PII

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

                          map_sid
                          Path
                          post sid_like<MP> Not PII

                          The SID of the Sync Map with the Sync Map Item resource to update. Can be the Sync Map's sid or its unique_name.

                          key
                          Path
                          post string PII MTL: 30 DAYS

                          The key value of the Sync Map Item resource to update.

                          data
                          Optional
                          post object PII MTL: 7 DAYS

                          A JSON string that represents an arbitrary, schema-less object that the Map Item stores. Can be up to 16KB in length.

                          ttl
                          Optional
                          post integer Not PII

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

                          item_ttl
                          Optional
                          post integer Not PII

                          How long, in seconds, before the Map Item 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 Map Item does not expire. The Map Item will be deleted automatically after it expires, but there can be a delay between the expiration time and the resources's deletion.

                          collection_ttl
                          Optional
                          post integer Not PII

                          How long, in seconds, before the Map Item's parent 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 parent Sync Map does not expire. This parameter can only be used when the Map Item's data or ttl is updated in the same request. 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
                                
                                
                                
                                

                                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.

                                Parameters
                                Names in REST API format
                                service_sid
                                Path
                                delete sid_like<IS> Not PII

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

                                map_sid
                                Path
                                delete sid_like<MP> Not PII

                                The SID of the Sync Map with the Sync Map Item resource to delete. Can be the Sync Map's sid or its unique_name.

                                key
                                Path
                                delete string PII MTL: 30 DAYS

                                The key value of the Sync Map Item 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.