/services/websites/v1/components/set-content
Auth
| Field | Type | Required | Description | Example |
|---|---|---|---|---|
type |
string | Yes | The target type: page, header, footer, or secured. | page |
id |
string | Yes | The post_name (slug) of the page/block, or the template ID for header/footer types. | / |
component_id |
string | Yes | The component connection ID to update content for. | 6120 |
meta |
mixed[] | No | Additional metadata key-value pairs for the component (content, custom code, local overrides). | {"section_content":"{\"time\":1594475302702,\"blocks\":[{\"type\":\"paragraph\",\"data\":{\"text\":\"Lorem ipsum dolor sit amet, consectetur adipiscing elit.\"},\"block_id\":\"3oq97n\"}],\"version\":\"2.18.0\"}"} |
page_slug |
string|null | No | The page slug or page ID used to store local overrides when saving partial content. | / |
| Header | Type | Description | Example |
|---|---|---|---|
X-RateLimit-Limit |
integer | Maximum number of requests allowed per minute | 60 |
X-RateLimit-Remaining |
integer | Number of requests remaining in the current window | 57 |
| Field | Type | Description |
|---|---|---|
error |
boolean | |
message |
string | |
data |
mixed[] |
| Header | Type | Description | Example |
|---|---|---|---|
X-RateLimit-Limit |
integer | Maximum number of requests allowed per minute | 60 |
X-RateLimit-Remaining |
integer | Number of requests remaining in the current window | 57 |
| Field | Type | Description |
|---|---|---|
error |
boolean |
| Field | Type | Description |
|---|---|---|
message |
string | Errors overview. |
errors |
object | A detailed description of each field that failed validation. |
| Header | Type | Description | Example |
|---|---|---|---|
X-RateLimit-Limit |
integer | Maximum number of requests allowed per minute | 60 |
X-RateLimit-Remaining |
integer | Number of requests remaining in the current window | 57 |
| Field | Type | Description |
|---|---|---|
error |
boolean | |
message |
string |
| Header | Type | Description | Example |
|---|---|---|---|
X-RateLimit-Limit |
integer | Maximum number of requests allowed per minute | 60 |
X-RateLimit-Remaining |
integer | Number of requests remaining in the current window | 57 |
| Field | Type | Description |
|---|---|---|
error |
boolean | |
message |
string |
| Header | Type | Description | Example |
|---|---|---|---|
X-RateLimit-Limit |
integer | Maximum number of requests allowed per minute | 60 |
X-RateLimit-Remaining |
integer | Number of requests remaining in the current window | 57 |
Retry-After |
integer | Seconds until the rate limit resets | 60 |
| Field | Type | Description |
|---|---|---|
error |
boolean | |
message |
string |
curl -X POST "https://api.wemasy.nl/api/services/websites/v1/components/set-content" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"type": "page",
"id": "/",
"component_id": "6120",
"meta": {
"section_content": "{\"time\":1594475302702,\"blocks\":[{\"type\":\"paragraph\",\"data\":{\"text\":\"Lorem ipsum dolor sit amet, consectetur adipiscing elit.\"},\"block_id\":\"3oq97n\"}],\"version\":\"2.18.0\"}"
},
"page_slug": "/"
}'
fetch('https://api.wemasy.nl/api/services/websites/v1/components/set-content', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_TOKEN',
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify({
"type": "page",
"id": "/",
"component_id": "6120",
"meta": {
"section_content": "{\"time\":1594475302702,\"blocks\":[{\"type\":\"paragraph\",\"data\":{\"text\":\"Lorem ipsum dolor sit amet, consectetur adipiscing elit.\"},\"block_id\":\"3oq97n\"}],\"version\":\"2.18.0\"}"
},
"page_slug": "/"
})})
.then(r => r.json())
.then(data => console.log(data));
$response = Http::withToken('YOUR_API_TOKEN')
->accept('application/json')
->post('https://api.wemasy.nl/api/services/websites/v1/components/set-content', {
"type": "page",
"id": "/",
"component_id": "6120",
"meta": {
"section_content": "{\"time\":1594475302702,\"blocks\":[{\"type\":\"paragraph\",\"data\":{\"text\":\"Lorem ipsum dolor sit amet, consectetur adipiscing elit.\"},\"block_id\":\"3oq97n\"}],\"version\":\"2.18.0\"}"
},
"page_slug": "/"
});
$data = $response->json();
import requests
headers = {
"Authorization": "Bearer YOUR_API_TOKEN",
"Accept": "application/json"
}
data = {
"type": "page",
"id": "/",
"component_id": "6120",
"meta": {
"section_content": "{\"time\":1594475302702,\"blocks\":[{\"type\":\"paragraph\",\"data\":{\"text\":\"Lorem ipsum dolor sit amet, consectetur adipiscing elit.\"},\"block_id\":\"3oq97n\"}],\"version\":\"2.18.0\"}"
},
"page_slug": "/"
}
r = requests.post("https://api.wemasy.nl/api/services/websites/v1/components/set-content", headers=headers, json=data)
print(r.json())
{
"error": false
}