Sync MapItem Resource
You need to create a Map first before you can use this resource to create, read, update, and delete items.
Sync MapItems:
- can be inserted, updated, removed and iterated
- are limited to 16KB of data
Sync MapItem properties
Resource Properties in REST API format | |
---|---|
key
|
The unique, user-defined key for the Map Item. |
account_sid
|
The SID of the Account that created the Map Item resource. |
service_sid
|
The SID of the Sync Service the resource is associated with. |
map_sid
|
The SID of the Sync Map that contains the Map Item. |
url
|
The absolute URL of the Map Item resource. |
revision
|
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 16 KiB in length. |
date_expires
|
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 |
date_created
|
The date and time in GMT when the resource was created specified in ISO 8601 format. |
date_updated
|
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 |
Create a MapItem resource
https://sync.twilio.com/v1/Services/{ServiceSid}/Maps/{MapSid}/Items
パラメーター
Parameters in REST API format | |
---|---|
service_sid
Path
|
The SID of the Sync Service to create the Map Item in. |
map_sid
Path
|
The SID of the Sync Map to add the new Map Item to. Can be the Sync Map resource's |
key
必須
|
The unique, user-defined key for the Map Item. Can be up to 320 characters long. |
data
必須
|
A JSON string that represents an arbitrary, schema-less object that the Map Item stores. Can be up to 16 KiB in length. |
ttl
オプション
|
An alias for |
item_ttl
オプション
|
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 |
collection_ttl
オプション
|
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 |
例 1
例 2
Please note: You can also use the set
method to update data in existing JSON data in a Map. However, using set
will overwrite any existing data in a MapItem.
例 3
Fetch a MapItem resource
https://sync.twilio.com/v1/Services/{ServiceSid}/Maps/{MapSid}/Items/{Key}
パラメーター
Parameters in REST API format | |
---|---|
service_sid
Path
|
The SID of the Sync Service with the Sync Map Item resource to fetch. |
map_sid
Path
|
The SID of the Sync Map with the Sync Map Item resource to fetch. Can be the Sync Map resource's |
key
Path
|
The |
例 1
例 2
Read all MapItem resources
https://sync.twilio.com/v1/Services/{ServiceSid}/Maps/{MapSid}/Items
MapItem 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 MapItems. Supply a PageSize parameter to fetch up to 100 items at once. See paging for more information.
パラメーター
Parameters in REST API format | |
---|---|
service_sid
Path
|
The SID of the Sync Service with the Map Item resources to read. |
map_sid
Path
|
The SID of the Sync Map with the Sync Map Item resource to fetch. Can be the Sync Map resource's |
order
オプション
|
How to order the Map Items returned by their |
from
オプション
|
The |
bounds
オプション
|
Whether to include the Map Item referenced by the |
例 1
例 2
例 3
Update a MapItem resource
https://sync.twilio.com/v1/Services/{ServiceSid}/Maps/{MapSid}/Items/{Key}
MapItem update access is performed using the key
that provided as an arbitrary string to identify the item.
パラメーター
Parameters in REST API format | |
---|---|
service_sid
Path
|
The SID of the Sync Service with the Sync Map Item resource to update. |
map_sid
Path
|
The SID of the Sync Map with the Sync Map Item resource to update. Can be the Sync Map resource's |
key
Path
|
The |
data
オプション
|
A JSON string that represents an arbitrary, schema-less object that the Map Item stores. Can be up to 16 KiB in length. |
ttl
オプション
|
An alias for |
item_ttl
オプション
|
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 |
collection_ttl
オプション
|
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 |
if_match
ヘッダー
|
The If-Match HTTP request header |
例 1
例 2
例 3
例 4
For more details on mutate and conflict resolution read up on Mutation and Conflict Resolution.
例 5
Delete a MapItem resource
https://sync.twilio.com/v1/Services/{ServiceSid}/Maps/{MapSid}/Items/{Key}
Permanently delete a specific item from an existing Map.
パラメーター
Parameters in REST API format | |
---|---|
service_sid
Path
|
The SID of the Sync Service with the Sync Map Item resource to delete. |
map_sid
Path
|
The SID of the Sync Map with the Sync Map Item resource to delete. Can be the Sync Map resource's |
key
Path
|
The |
if_match
ヘッダー
|
The If-Match HTTP request header |
例 1
例 2
例 3
ヘルプが必要ですか?
誰しもが一度は考える「コーディングって難しい」。そんな時は、お問い合わせフォームから質問してください。 または、Stack Overflow でTwilioタグのついた情報から欲しいものを探してみましょう。