Appearance
Compatible Addons
Out of the box the Webservice module supports all fieldtypes that save their data to the channel data of ExpressionEngine. Other add-ons that use their own table or do something with files, for example, are not supported, unless they are listed below.
If you found an addon that has no support for the Webservice, you can send me an email.
Grid
Natively: The following syntax is needed.
array(
'grid' => array(
'rows' => array(
array(
'cell_1' => 'row 1',
'cell_2' => 'row 11'
),
array(
'cell_1' => 'row 2',
'cell_2' => 'row 22'
),
),
),
);or in a query string
data[grid][rows][0][cell_1]=row 1&data[grid][rows][0][cell_2]=row 11&data[grid][rows][1][cell_1]=row 2&data[grid][rows][1][cell_2]=row 22Relationship
Natively: The following syntax is needed.
array(
'relationship' => array(
2,3,4,5
),
);or in a query string
data[relationship][]=2&data[relationship][]=3&data[relationship][]=4&data[relationship][]=5Matrix
Natively: the following syntax is needed.
array(
'matrix' => array(
'rows' => array(
array(
'cell_1' => 'row 1',
'cell_2' => 'row 11'
),
array(
'cell_1' => 'row 2',
'cell_2' => 'row 22'
),
),
),
);or in a query string
data[matrix][rows][0][cell_1]=row 1&data[matrix][rows][0][cell_2]=row 11&data[matrix][rows][1][cell_1]=row 2&data[matrix][rows][1][cell_2]=row 22Playa
Natively: The following syntax is needed.
array(
'playa' => array(
2,3,4,5
),
);or in a query string
data[playa][]=2&data[playa][]=3&data[playa][]=4&data[playa][]=5Zoo Visitor
Natively: The following syntax is needed.
On update, you can avoid some values because the Webservice module detect the member based on the entry_id
array(
'member_account' => array(
'email' => 'test@test.com',
'username' => 'John Doe',
'password' => 'test123',
'screen_name' => 'John Doe',
'group_id' => '4',
),
);Store
Store has no own handler, its fields are read with the default handler in read_entry.
Content Elements
All fields, but not all are converted correctly.
Fluid
The fluid field expects an array of objects, where each object contains a field (the field name) and a value (the field value). Nested fieldtypes like Grid are supported by passing an object as the value.
json
"fluid": [
{ "field": "fluid_field_name_wyvern", "value": "<p>Wyvern</p>" },
{ "field": "fluid_field_name_grid", "value": { "rows": [{ "fluid_grid_title": "Test 1" }] } }
]File
Natively: upload a file with the base64 encoded file, the filename and the upload directory. The member needs access to the upload directory.
array(
'file_field' => array(
'filedata' => base64_encode(file_get_contents('path_to_image.jpg')),
'filename' => 'image.jpg',
'dir_id' => 6,
),
);On read, the field returns the data of the file, like the file field of ExpressionEngine (e.g. the url and the file name).
Ansel
Only on read: the field returns the images with their urls (url, sourceUrl, highQualityUrl, thumbUrl, originalUrl etc.).
Simple S3 Uploader
On read, the stored data of the field is returned as an array, also in a Grid or Matrix field.
Rich Text Editor
On read, the file paths in the text are replaced by their urls and the text is formatted with the formatting settings of the channel, also in a Grid or Matrix field.
Publisher
Webservice is compatible with Publisher
//add the publisher_lang_id to your entry request
array('publisher_lang_id' => 1)Structure
Added in 9.1.0
Webservice is compatible with the Structure add-on. You can set Structure page data by adding a structure key to your entry data.
There are two page types supported:
Structure Channel (page)
Use this for a full Structure page. Supports uri, parent_id, hidden, template_id and listing_channel.
json
{
"auth": {
"shortkey": "testing123"
},
"data": {
"channel_name": "structure_channel",
"title": "Test",
"status": "open",
"structure": {
"uri": "my-page-uri",
"parent_id": 4616,
"hidden": true
}
}
}| Parameter | Type | Description |
|---|---|---|
uri | string | The URI/slug for the page |
parent_id | int | The entry ID of the parent page |
hidden | bool | Whether the page is hidden in the Structure nav |
template_id | int | The template of the page |
listing_channel | int | The listing channel of the page |
Structure Listing
Use this for a Structure listing page. Supports uri and template_id.
json
{
"auth": {
"shortkey": "testing123"
},
"data": {
"channel_name": "structure_listing",
"title": "Test",
"status": "open",
"structure": {
"uri": "my-listing-uri"
}
}
}| Parameter | Type | Description |
|---|---|---|
uri | string | The URI/slug for the listing page |
template_id | int | The template of the listing |
SEO Lite
Added in 9.1.0
Webservice is compatible with SEO Lite. You can set SEO Lite data by adding a seo_lite key to your entry data.
json
{
"auth": {
"shortkey": "testing123"
},
"data": {
"channel_name": "my_channel",
"title": "Test",
"status": "open",
"seo_lite": {
"title": "My page title",
"keywords": "foo, bar",
"description": "Meta description",
"robots_directive": "INDEX, FOLLOW",
"og_title": "OG title",
"og_description": "OG description",
"og_type": "website",
"og_url": "https://example.com",
"og_image": "https://example.com/image.jpg",
"twitter_title": "Twitter title",
"twitter_description": "Twitter description",
"twitter_type": "summary",
"twitter_image": "https://example.com/image.jpg"
}
}
}| Parameter | Type | Description |
|---|---|---|
title | string | The SEO page title |
keywords | string | Meta keywords |
description | string | Meta description |
robots_directive | string | Robots meta directive, one of the following options: INDEX, FOLLOW, NOINDEX, FOLLOW, INDEX, NOFOLLOW, NOINDEX, NOFOLLOW |
og_title | string | Open Graph title |
og_description | string | Open Graph description |
og_type | string | Open Graph type, e.g. website |
og_url | string | Open Graph URL |
og_image | string | Open Graph image URL |
twitter_title | string | Twitter card title |
twitter_description | string | Twitter card description |
twitter_type | string | Twitter card type, e.g. summary |
twitter_image | string | Twitter card image URL |
On update_entry only the given fields change, the other SEO Lite fields stay the same.
