Open API v2 / CMS & Content / Snippets
Snippets
→
Every request needs a bearer token: Authorization: Bearer <token>. Base URL https://your-site.webinone.com. New to field types? See the type reference.
Retrieves a list of snippets by using a "where" filtering
Parameters
Wherestring · query
JSON filter expression. Combine operators ($eq, $contains, $gt, $in, …) with $and / $or.
Order_Bystring · query
Sort field. Prefix with - for descending; comma-separate for tie-breakers.
Semantic_Querystring · query
Natural-language search, ranked by relevance.
Min_Scorenumber · query
Lowest relevance score to include when using Semantic_Query.
Offsetinteger · query
Number of items to skip before returning results. Defaults to 0.
Limitinteger · query
Maximum number of items to return. Defaults to 100.
Response
Idinteger
Unique identifier. Technical record number in the database. Read-only.
Namestring · nullable
Internal name. Snippet name for administrators.
Aliasstring · nullable
Technical alias. A unique key used to identify the snippet in the system without being tied to the ID.
Contentstring · nullable
Snippet body. Text or code that is rendered on the page.
FtpPathstring · nullable
File path. Location of the physical.html file on the server, where the snippet content is duplicated for quick system access. Read-only.
LiquidAliasstring · nullable
Insertion code. A ready-made code fragment (Liquid syntax) that an administrator can copy and paste into any page template to display this snippet.
Enabledboolean
Status. If false, the snippet is ignored during page rendering, even if the insertion code (LiquidAlias) is present in the template.
CodeEditorboolean
Editing mode. Indicates to the admin panel interface that the content is program code and requires syntax highlighting (JS/HTML).
curl "https://your-site.webinone.com/api/v2/admin/snippets" \ -H "Authorization: Bearer <token>"
await fetch("https://your-site.webinone.com/api/v2/admin/snippets", { method: "GET", headers: { "Authorization": "Bearer <token>" } });
import requests requests.get( "https://your-site.webinone.com/api/v2/admin/snippets", headers={"Authorization": "Bearer <token>"} )
$client = new GuzzleHttp\Client(); $response = $client->request('GET', 'https://your-site.webinone.com/api/v2/admin/snippets', [ 'headers' => [ 'Authorization' => 'Bearer <token>' ] ]);
using var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Get, "https://your-site.webinone.com/api/v2/admin/snippets"); request.Headers.Add("Authorization", "Bearer <token>"); var response = await client.SendAsync(request);
Response · 200
{
"Items": [
{
"Id": 1,
"Name": "Example",
"Alias": "string",
"Content": "string",
"FtpPath": "string",
"LiquidAlias": "string",
"Enabled": false,
"CodeEditor": false
}
],
"TotalItemsCount": 0
}Creates a new snippet
Body parameters
Namestringrequired
Snippet name. Used to identify the block in the administrator's list (for example: "Footer Contact Block").
Aliasstringrequired
Unique alias (ID). A short text identifier by which the snippet is called in template code (for example: ). Cannot be empty/absent (nullable: false).
Contentstring · nullable
Snippet content. Text, HTML markup, or JavaScript code that will be inserted at the snippet call location. Nullable: true.
Enabledboolean
Activity status. Determines whether the snippet will be displayed on the site. Default: true if false, there will be an empty space instead of the snippet content.
CodeEditorboolean
Editor mode. True: in the admin panel interface, highlight content as code (HTML/JS). False: display as plain text or through a visual editor (WYSIWYG).
Response
Idinteger
Unique identifier. Technical record number in the database. Read-only.
Namestring · nullable
Internal name. Snippet name for administrators.
Aliasstring · nullable
Technical alias. A unique key used to identify the snippet in the system without being tied to the ID.
Contentstring · nullable
Snippet body. Text or code that is rendered on the page.
FtpPathstring · nullable
File path. Location of the physical.html file on the server, where the snippet content is duplicated for quick system access. Read-only.
LiquidAliasstring · nullable
Insertion code. A ready-made code fragment (Liquid syntax) that an administrator can copy and paste into any page template to display this snippet.
Enabledboolean
Status. If false, the snippet is ignored during page rendering, even if the insertion code (LiquidAlias) is present in the template.
CodeEditorboolean
Editing mode. Indicates to the admin panel interface that the content is program code and requires syntax highlighting (JS/HTML).
curl -X POST "https://your-site.webinone.com/api/v2/admin/snippets" \ -H "Authorization: Bearer <token>" \ -H "Content-Type: application/json" \ -d '{"Name":"Example","Alias":"string","Content":"string","Enabled":false,"CodeEditor":false}'
await fetch("https://your-site.webinone.com/api/v2/admin/snippets", { method: "POST", headers: { "Authorization": "Bearer <token>", "Content-Type": "application/json" }, body: JSON.stringify({ "Name": "Example", "Alias": "string", "Content": "string", "Enabled": false, "CodeEditor": false }) });
import requests requests.post( "https://your-site.webinone.com/api/v2/admin/snippets", headers={"Authorization": "Bearer <token>"}, json={ "Name": "Example", "Alias": "string", "Content": "string", "Enabled": False, "CodeEditor": False } )
$client = new GuzzleHttp\Client(); $response = $client->request('POST', 'https://your-site.webinone.com/api/v2/admin/snippets', [ 'headers' => [ 'Authorization' => 'Bearer <token>', 'Content-Type' => 'application/json' ], 'json' => [ 'Name' => 'Example', 'Alias' => 'string', 'Content' => 'string', 'Enabled' => false, 'CodeEditor' => false ] ]);
using var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Post, "https://your-site.webinone.com/api/v2/admin/snippets"); request.Headers.Add("Authorization", "Bearer <token>"); request.Content = new StringContent( "{\"Name\":\"Example\",\"Alias\":\"string\",\"Content\":\"string\",\"Enabled\":false,\"CodeEditor\":false}", Encoding.UTF8, "application/json"); var response = await client.SendAsync(request);
Response · 200
{
"Id": 1,
"Name": "Example",
"Alias": "string",
"Content": "string",
"FtpPath": "string",
"LiquidAlias": "string",
"Enabled": false,
"CodeEditor": false
}Retrieves a single snippet
Parameters
idinteger · pathrequired
Snippet id.
Response
Idinteger
Unique identifier. Technical record number in the database. Read-only.
Namestring · nullable
Internal name. Snippet name for administrators.
Aliasstring · nullable
Technical alias. A unique key used to identify the snippet in the system without being tied to the ID.
Contentstring · nullable
Snippet body. Text or code that is rendered on the page.
FtpPathstring · nullable
File path. Location of the physical.html file on the server, where the snippet content is duplicated for quick system access. Read-only.
LiquidAliasstring · nullable
Insertion code. A ready-made code fragment (Liquid syntax) that an administrator can copy and paste into any page template to display this snippet.
Enabledboolean
Status. If false, the snippet is ignored during page rendering, even if the insertion code (LiquidAlias) is present in the template.
CodeEditorboolean
Editing mode. Indicates to the admin panel interface that the content is program code and requires syntax highlighting (JS/HTML).
curl "https://your-site.webinone.com/api/v2/admin/snippets/1" \ -H "Authorization: Bearer <token>"
await fetch("https://your-site.webinone.com/api/v2/admin/snippets/1", { method: "GET", headers: { "Authorization": "Bearer <token>" } });
import requests requests.get( "https://your-site.webinone.com/api/v2/admin/snippets/1", headers={"Authorization": "Bearer <token>"} )
$client = new GuzzleHttp\Client(); $response = $client->request('GET', 'https://your-site.webinone.com/api/v2/admin/snippets/1', [ 'headers' => [ 'Authorization' => 'Bearer <token>' ] ]);
using var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Get, "https://your-site.webinone.com/api/v2/admin/snippets/1"); request.Headers.Add("Authorization", "Bearer <token>"); var response = await client.SendAsync(request);
Response · 200
{
"Id": 1,
"Name": "Example",
"Alias": "string",
"Content": "string",
"FtpPath": "string",
"LiquidAlias": "string",
"Enabled": false,
"CodeEditor": false
}Updates an existing snippet
Parameters
idinteger · pathrequired
Existent snippet id.
Body parameters
Namestringrequired
Snippet name. Used to identify the block in the administrator's list (for example: "Footer Contact Block").
Aliasstringrequired
Unique alias (ID). A short text identifier by which the snippet is called in template code (for example: ). Cannot be empty/absent (nullable: false).
Contentstring · nullable
Snippet content. Text, HTML markup, or JavaScript code that will be inserted at the snippet call location. Nullable: true.
Enabledboolean
Activity status. Determines whether the snippet will be displayed on the site. Default: true if false, there will be an empty space instead of the snippet content.
CodeEditorboolean
Editor mode. True: in the admin panel interface, highlight content as code (HTML/JS). False: display as plain text or through a visual editor (WYSIWYG).
Response
Idinteger
Unique identifier. Technical record number in the database. Read-only.
Namestring · nullable
Internal name. Snippet name for administrators.
Aliasstring · nullable
Technical alias. A unique key used to identify the snippet in the system without being tied to the ID.
Contentstring · nullable
Snippet body. Text or code that is rendered on the page.
FtpPathstring · nullable
File path. Location of the physical.html file on the server, where the snippet content is duplicated for quick system access. Read-only.
LiquidAliasstring · nullable
Insertion code. A ready-made code fragment (Liquid syntax) that an administrator can copy and paste into any page template to display this snippet.
Enabledboolean
Status. If false, the snippet is ignored during page rendering, even if the insertion code (LiquidAlias) is present in the template.
CodeEditorboolean
Editing mode. Indicates to the admin panel interface that the content is program code and requires syntax highlighting (JS/HTML).
curl -X PUT "https://your-site.webinone.com/api/v2/admin/snippets/1" \ -H "Authorization: Bearer <token>" \ -H "Content-Type: application/json" \ -d '{"Name":"Example","Alias":"string","Content":"string","Enabled":false,"CodeEditor":false}'
await fetch("https://your-site.webinone.com/api/v2/admin/snippets/1", { method: "PUT", headers: { "Authorization": "Bearer <token>", "Content-Type": "application/json" }, body: JSON.stringify({ "Name": "Example", "Alias": "string", "Content": "string", "Enabled": false, "CodeEditor": false }) });
import requests requests.put( "https://your-site.webinone.com/api/v2/admin/snippets/1", headers={"Authorization": "Bearer <token>"}, json={ "Name": "Example", "Alias": "string", "Content": "string", "Enabled": False, "CodeEditor": False } )
$client = new GuzzleHttp\Client(); $response = $client->request('PUT', 'https://your-site.webinone.com/api/v2/admin/snippets/1', [ 'headers' => [ 'Authorization' => 'Bearer <token>', 'Content-Type' => 'application/json' ], 'json' => [ 'Name' => 'Example', 'Alias' => 'string', 'Content' => 'string', 'Enabled' => false, 'CodeEditor' => false ] ]);
using var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Put, "https://your-site.webinone.com/api/v2/admin/snippets/1"); request.Headers.Add("Authorization", "Bearer <token>"); request.Content = new StringContent( "{\"Name\":\"Example\",\"Alias\":\"string\",\"Content\":\"string\",\"Enabled\":false,\"CodeEditor\":false}", Encoding.UTF8, "application/json"); var response = await client.SendAsync(request);
Response · 200
{
"Id": 1,
"Name": "Example",
"Alias": "string",
"Content": "string",
"FtpPath": "string",
"LiquidAlias": "string",
"Enabled": false,
"CodeEditor": false
}Deletes an existing snippet
Parameters
idinteger · pathrequired
Existent snippet id.
curl -X DELETE "https://your-site.webinone.com/api/v2/admin/snippets/1" \ -H "Authorization: Bearer <token>"
await fetch("https://your-site.webinone.com/api/v2/admin/snippets/1", { method: "DELETE", headers: { "Authorization": "Bearer <token>" } });
import requests requests.delete( "https://your-site.webinone.com/api/v2/admin/snippets/1", headers={"Authorization": "Bearer <token>"} )
$client = new GuzzleHttp\Client(); $response = $client->request('DELETE', 'https://your-site.webinone.com/api/v2/admin/snippets/1', [ 'headers' => [ 'Authorization' => 'Bearer <token>' ] ]);
using var client = new HttpClient(); var request = new HttpRequestMessage(HttpMethod.Delete, "https://your-site.webinone.com/api/v2/admin/snippets/1"); request.Headers.Add("Authorization", "Bearer <token>"); var response = await client.SendAsync(request);