Appearance
Compatible Addons
Out of the box the the Webservice module support all fieldtypes that save their data to the exp_channel_data table. Other addons that using their own table or do something with files for example are not supported, unless they 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: he 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 only adds basic support in the read/search method.
Content Elements
All fields, but not all are converted good (please make a thread here)
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" }] } }
]Publisher
Webservice is compatible with Publisher
//add the publisher_lang_id to your entry request
array('publisher_lang_id' => 1)Searching in older then EE 5.1.0 require to add a fix to a core file of EE due a bug. The following need to be added (https://github.com/ExpressionEngine/ExpressionEngine/issues/31#issuecomment-447055294).
diff --git a/system/ee/EllisLab/ExpressionEngine/Service/Model/Query/Select.php b/system/ee/EllisLab/ExpressionEngine/Service/Model/Query/Select.php
index bb5cff9e1b..b789a89bbb 100644
--- a/system/ee/EllisLab/ExpressionEngine/Service/Model/Query/Select.php
+++ b/system/ee/EllisLab/ExpressionEngine/Service/Model/Query/Select.php
@@ -54,11 +54,7 @@ class Select extends Query {
$aliases = array_merge(array($this->root_alias), array_keys($withs));
foreach ($aliases as $alias)
{
- if (stripos($alias, ' as ') !== FALSE)
- {
- $parts = explode(' ', $alias);
- $alias = end($parts);
- }
+ list($from, $alias) = $this->splitAlias($alias);
$class = $this->getClass($alias);
if ( ! is_null($class::getMetaData('field_data')))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, and hidden.
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 |
Structure Listing
Use this for a Structure listing page. Only uri is required.
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 |
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 |
