メニュー

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?

Sync REST: Maps

A map is an unordered collection of individual items, addressable by a key that you define.

  • Items can be inserted, updated, removed and iterated.
  • Each item is limited to 16KB of data minus small internal overhead.
  • Item read or update access is performed using item key that is provided by you as an arbitrary string (up to 256 characters).
  • Full map modification history is maintained with every change triggering new revision.
  • Strict ordering of map mutation events is guaranteed, but the map item ordering is not defined.
  • Expires and gets deleted automatically, if eviction is configured via TTL parameter. By default, data is persisted permanently.

Map Root Properties

Each Map object root resource has the following properties. Unique name and expiration date attributes are optional and allowed to be null.

Names in PHP format
sid
sid<MP> Not PII

The unique 34-character SID identifier of the Map.

uniqueName
文字列 PII MTL: 30 DAYS

The unique and addressable name of this Map. Optional, 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.

url
url Not PII

The absolute URL for this Map.

links
uri_map Not PII

A dictionary of URL links to nested resources of this Map.

revision
文字列 Not PII

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

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
文字列 PII MTL: 30 DAYS

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.

{
  "account_sid": "ACxx",
  "service_sid": "ISxx",
  "sid": "MPxx",
  "unique_name": "MyMap",
  "revision": "1a",
  "date_created": "2015-11-24T22:18:57Z",
  "date_updated": "2015-11-24T22:18:57Z",
  "date_expires": null,
  "created_by": "system",
  "url": "https://sync.twilio.com/v1/Services/ISxx/Maps/MPxx",
  "links": {
    "items": "https://sync.twilio.com/v1/Services/ISxx/Maps/MPxx/Items",
    "permissions": "https://sync.twilio.com/v1/Services/ISxx/Maps/MPxx/Permissions"
  }
}

Map Item Properties

Each Map Item resource is nested under the parent Map root resource and has the following properties.

Names in PHP format
key
文字列 PII MTL: 30 DAYS

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
文字列 Not PII

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

data
オブジェクト PII MTL: 7 DAYS

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
文字列 PII MTL: 30 DAYS

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.

{
  "account_sid": "ACxx",
  "service_sid": "ISxx",
  "map_sid": "MPxx",
  "key": "MyKey",
  "revision": "1b",
  "date_created": "2015-11-24T22:19:58Z",
  "date_updated": "2015-11-24T22:19:58Z",
  "date_expires": null,
  "created_by": "system",
  "url": "https://sync.twilio.com/v1/Services/ISxx/Maps/MPxx/Items/MyKey",
  "data": {
      <user-defined Map Item content>
  }
}

アクション


List All Maps

GET /v1/Services/ISxx/Maps

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

Note: 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.

        
        
        
        

        Create a Map

        POST /v1/Services/ISxx/Maps
        

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

        パラメーター

        Names in PHP format
        uniqueName
        オプション
        post 文字列 PII MTL: 30 DAYS

        Human-readable name for this map

        ttl
        オプション
        post integer Not PII

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

        collectionTtl
        オプション
        post integer Not PII

        Time-to-live of this Map in seconds, defaults to no expiration. In the range [1, 31 536 000 (1 year)], or 0 for infinity.

              
              
              
              

              Retrieve a Map

              GET /v1/Services/ISxx/Maps/MPxx|UniqueName
              

              Fetch information about a specific Map by its SID or unique name.

                    
                    
                    
                    

                    Update a Map

                    POST /v1/Services/ISxx/Maps/MPxx|UniqueName
                    

                    Update the Map expiration deadline, addressed by its SID or unique name.

                    パラメーター

                    Names in PHP format
                    ttl
                    オプション
                    post integer Not PII

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

                    collectionTtl
                    オプション
                    post integer Not PII

                    New time-to-live of this Map in seconds. In the range [1, 31 536 000 (1 year)], or 0 for infinity.

                          
                          
                          
                          

                          Add Item to Map

                          POST /v1/Services/ISxx/Maps/MPxx|UniqueName/Items
                          

                          Insert a new item into this Map, supplying its payload, and optionally providing an item expiration deadline.

                          パラメーター

                          Names in PHP format
                          key
                          必須
                          post 文字列 PII MTL: 30 DAYS

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

                          data
                          必須
                          post オブジェクト 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
                          オプション
                          post integer Not PII

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

                          itemTtl
                          オプション
                          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.

                          collectionTtl
                          オプション
                          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.

                                
                                
                                
                                

                                Get Item From Map

                                GET /v1/Services/ISxx/Maps/MPxx|UniqueName/Items/<KEY>
                                

                                Fetch data of a specific item in the current Map, addressed by Map SID (or unique name) and item key.

                                      
                                      
                                      
                                      

                                      Query Items From Map

                                      GET /v1/Services/ISxx/Maps/MPxx|UniqueName/Items
                                      

                                      Retrieve a list of all items belonging to this Map.

                                      Note: 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.

                                      パラメーター

                                      Names in PHP format
                                      order
                                      オプション
                                      GET enum:query_result_order Not PII

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

                                      from
                                      オプション
                                      GET 文字列 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.

                                            
                                            
                                            
                                            

                                            Update Item In a Map

                                            POST /v1/Services/ISxx/Maps/MPxx|UniqueName/Items/<KEY>
                                            

                                            Update data and/or expiration deadline of a specific item in the current Map, addressed by SID (or unique name) and item key.

                                            パラメーター

                                            Names in PHP format
                                            data
                                            オプション
                                            post オブジェクト 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
                                            オプション
                                            post integer Not PII

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

                                            itemTtl
                                            オプション
                                            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.

                                            collectionTtl
                                            オプション
                                            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.

                                                  
                                                  
                                                  
                                                  

                                                  Remove Item From Map

                                                  DELETE /v1/Services/ISxx/Maps/MPxx|UniqueName/Items/<KEY>
                                                  

                                                  Permanently delete a specific item from the current Map, addressed by SID (or unique name) and item key.

                                                        
                                                        
                                                        
                                                        

                                                        Delete a Map

                                                        DELETE /v1/Services/ISxx/Maps/MPxx|UniqueName
                                                        

                                                        Permanently delete a specific Map along with all items belonging to it from current Service Instance, addressed by SID or unique name.

                                                              
                                                              
                                                              
                                                              
                                                              Rate this page:

                                                              ヘルプが必要ですか?

                                                              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.