メニュー

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?

ListItem resource

A Sync ListItem is an object you have added to a Sync List.

You need to create a List first before you can use this resource to create, read, update, and delete items.

Sync Lists generally behave like arrays in most programming languages, but when working with ListItems keep these details in mind:

  • Items can be appended, updated, removed and iterated, but not inserted at random position.
  • Each item is limited to 16KB of data.
  • Item read or update access is performed using an item index that is internally generated.
  • The index is not guaranteed to be contiguous.
  • Full list modification history is maintained with every change triggering new revision.
  • Strict ordering of all list mutation events and all contained items is guaranteed.
  • Lists expire and are deleted automatically, if you included a TTL parameter when creating your List. By default, a List and its items are persisted permanently.

ListItem properties

Names in PHP format
index
integer Not PII

Contains the automatically generated index of this List Item. Positive integer or zero, guaranteed to be always incrementing. Not guaranteed to be contiguous; the list may have gaps as items are deleted.

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 List object.

listSid
sid<ES> Not PII

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

url
url Not PII

The absolute URL for this item.

revision
文字列 Not PII

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

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

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

dateExpires
date_time<iso8601> Not PII

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

dateCreated
date_time<iso8601> Not PII

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

dateUpdated
date_time<iso8601> Not PII

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

createdBy
文字列 PII MTL: 30 DAYS

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

Create a ListItem resource

post
https://sync.twilio.com/v1/Services/{ServiceSid}/Lists/{ListSid}/Items
パラメーター
Names in None format
data
必須
post オブジェクト PII MTL: 7 DAYS

Contains arbitrary user-defined, schema-less data that this List 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.

item_ttl
オプション
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 list 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
オプション
post integer Not PII

Time-to-live of this item's parent List 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 list item's data or ttl is updated in the same request.

        
        
        
        

        Fetch a ListItem resource

        GET
        https://sync.twilio.com/v1/Services/{ServiceSid}/Lists/{ListSid}/Items/{Index}
              
              
              
              

              Read a ListItem resource

              GET
              https://sync.twilio.com/v1/Services/{ServiceSid}/Lists/{ListSid}/Items

              Retrieve all items belonging to a List.

              By default, this will return the first 50 List items. Supply a PageSize argument to fetch up to 100 items at once.

              See paging for more information.

              パラメーター
              Names in None format
              order
              オプション
              GET enum:query_result_order Not PII

              A string; asc or desc

              from
              オプション
              GET 文字列 Not PII

              An integer representing Item index offset (inclusive). If not present, query is performed from the start or end, depending on the Order query parameter.

                    
                    
                    
                    

                    Update a ListItem resource

                    post
                    https://sync.twilio.com/v1/Services/{ServiceSid}/Lists/{ListSid}/Items/{Index}
                    パラメーター
                    Names in None format
                    data
                    オプション
                    post オブジェクト PII MTL: 7 DAYS

                    Contains arbitrary user-defined, schema-less data that this List 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.

                    item_ttl
                    オプション
                    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 list 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
                    オプション
                    post integer Not PII

                    Time-to-live of this item's parent List 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 list item's data or ttl is updated in the same request.

                          
                          
                          
                          

                          Delete a ListItem resource

                          削除する
                          https://sync.twilio.com/v1/Services/{ServiceSid}/Lists/{ListSid}/Items/{Index}
                                
                                
                                
                                
                                Rate this page:

                                ヘルプが必要ですか?

                                誰しもが一度は考える「コーディングって難しい」。そんな時は、お問い合わせフォームから質問してください。 または、Stack Overflow でTwilioタグのついた情報から欲しいものを探してみましょう。