メニュー

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

The automatically generated index of the List Item. The index values of the List Items in a Sync List can have gaps in their sequence.

accountSid
sid<AC> Not PII

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

serviceSid
sid<IS> Not PII

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

listSid
sid<ES> Not PII

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

url
url Not PII

The absolute URL of the List Item resource.

revision
文字列 Not PII

The current revision of the item, represented as a string.

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

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

dateExpires
date_time<iso8601> Not PII

The date and time in GMT when the List Item expires and will be deleted, specified in ISO 8601 format. If the List Item does not expire, this value is null. The List Item resource 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
文字列 PII MTL: 30 DAYS

The identity of the List Item's creator. If the item is created from the client SDK, the value matches the Access Token's identity field. If the item 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
service_sid
必須
post sid_like<IS> Not PII

The SID of the Sync Service to create the new List Item in.

list_sid
必須
post sid_like<ES> Not PII

The SID of the Sync List to add the new List Item to. Can be the Sync List resource's sid or its unique_name.

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

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

ttl
オプション
post integer Not PII

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

item_ttl
オプション
post integer Not PII

How long, in seconds, before the List 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 List Item does not expire. The List 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
オプション
post integer Not PII

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

        
        
        
        

        Fetch a ListItem resource

        GET
        https://sync.twilio.com/v1/Services/{ServiceSid}/Lists/{ListSid}/Items/{Index}
        パラメーター
        Names in None format
        service_sid
        必須
        GET sid_like<IS> Not PII

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

        list_sid
        必須
        GET sid_like<ES> Not PII

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

        index
        必須
        GET integer Not PII

        The index of the Sync List Item resource to fetch.

              
              
              
              

              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
              service_sid
              必須
              GET sid_like<IS> Not PII

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

              list_sid
              必須
              GET sid_like<ES> Not PII

              The SID of the Sync List with the List Items to read. Can be the Sync List resource's sid or its unique_name.

              order
              オプション
              GET enum:query_result_order Not PII

              How to order the List Items returned by their index value. Can be: asc (ascending) or desc (descending) and the default is ascending.

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

              The index of the first Sync List Item resource to read. See also bounds.

              bounds
              オプション
              GET enum:query_from_bound_type Not PII

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

                    
                    
                    
                    

                    Update a ListItem resource

                    post
                    https://sync.twilio.com/v1/Services/{ServiceSid}/Lists/{ListSid}/Items/{Index}
                    パラメーター
                    Names in None format
                    service_sid
                    必須
                    post sid_like<IS> Not PII

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

                    list_sid
                    必須
                    post sid_like<ES> Not PII

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

                    index
                    必須
                    post integer Not PII

                    The index of the Sync List Item resource to update.

                    data
                    オプション
                    post オブジェクト PII MTL: 7 DAYS

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

                    ttl
                    オプション
                    post integer Not PII

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

                    item_ttl
                    オプション
                    post integer Not PII

                    How long, in seconds, before the List 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 List Item does not expire. The List 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
                    オプション
                    post integer Not PII

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

                          
                          
                          
                          

                          Delete a ListItem resource

                          削除する
                          https://sync.twilio.com/v1/Services/{ServiceSid}/Lists/{ListSid}/Items/{Index}
                          パラメーター
                          Names in None format
                          service_sid
                          必須
                          削除する sid_like<IS> Not PII

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

                          list_sid
                          必須
                          削除する sid_like<ES> Not PII

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

                          index
                          必須
                          削除する integer Not PII

                          The index of the Sync List Item resource to delete.

                                
                                
                                
                                
                                Rate this page:

                                ヘルプが必要ですか?

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