TS Commerce Developers

Blog API

Current version: v1.1

List posts

Get a list of your blog posts.

GET
/blog/list.json
List posts Request

$storeden = new Storeden\Storeden($config);
$posts_list = $storeden->get('/blog/list.json');
					
List posts Response

[
      {
        "title": "Welcome to my-company.com",
        "id": "54c22f6516f46a490699c248"
      },
      {
        "title": "Launching a new Rocket (just-for-fun)",
        "id": "54c64e0416f46a5d047b23c8"
      },
      ...
]
					

Get single post content

Get all details about your post.

GET
/blog/post.json?id={post-id}
PARAMETERS LIST
id required (StoredenId) Unique id of your post
Get single post content Request

$storeden = new Storeden\Storeden($config);
$post_data = $storeden->get('/blog/post.json?id=54c.....c8');
					
Get single post content Response

{
  "author": 1,
  "title": "Launching a new Rocket (just-for-fun)",
  "content": "Seriously, this is only a joke.",
  "extract": "Read more inside :)",
  "ext_img": "https://static-cdn.storeden.com/secache/111111",
  "tags": [
    "1st April", "rocket"
  ],
  "seo": [],
  "visible": true,
  "social": false,
  "data": {
    "y": "2015",
    "m": "04",
    "d": "01"
  },
  "ts": {
    "sec": 1422012261,
    "usec": 764000
  },
  "languages": ["en_US"],
  "id": "54c64e0416f46a5d047b23c8",
  "iso": {
        "updateAt": "2019-03-11T23:31:18+01:00",
        "createAt": "2019-03-11T22:17:22+01:00"
    }
}
					

Create a new post

Create a new post for e-commerce blog.

POST
/blog/post.json
PARAMETERS LIST
title required (string) Post title
content required (html) Post content. Html is accepted
post_locale required (string) Post strings locale. Accept: en_US, it_IT, de_DE, fr_FR, es_ES
content_preview (string) Small preview content ( extract )
seo_title (string) Seo Title, used into head > title tag
seo_description (string) Seo Title, used into head > meta tag
seo_keywords (string) Seo Title, used into head > meta tag
visible (int) 1 => Post are visible in the store-front, 0 => Post are not visible in the store-front
tags (string) Comma separated tags
timestamp (unixtimestamp) July 4th, 2019
category_id (StoredenId) July 17th, 2019
image_id (StoredenId) June 23th, 2020 Upload the new image through the Gallery API first to get the ID
post_slug (string) June 23th, 2020 Slug string ended with ".html". Es: "launching-new-rocket.html"
Create a new post Request

$storeden = new Storeden\Storeden($config);

$payload = array();
$payload['title'] = 'Launching a new Rocket (just-for-fun)';
$payload['content'] = 'Seriously, this is only a joke.';
$payload['post_locale'] = 'en_US';
// etc...

$result = $storeden->post('/blog/post.json', $payload);
					
Create a new post Response

{
    "id": "5c86d57416f46af87eec40a2",
    "web_urls": {
        "edit_url": "https://132-backoffice.storeden.com/blog/edit/5c86d57416f46af87eec40a2"
    }
}
					

Update an existing post

Update an existing post for e-commerce blog.

PUT
/blog/post.json
PARAMETERS LIST
id required (Storeden ID) Post ID
title required (string) Post title
content required (html) Post content. Html is accepted
post_locale required (string) Post strings locale. Accept: en_US, it_IT, de_DE, fr_FR, es_ES
content_preview (string) Small preview content ( extract )
seo_title (string) Seo Title, used into head > title tag
seo_description (string) Seo Title, used into head > meta tag
seo_keywords (string) Seo Title, used into head > meta tag
visible (int) 1 => Post are visible in the store-front, 0 => Post are not visible in the store-front
tags (string) Comma separated tags
timestamp (unixtimestamp) July 4th, 2019
category_id (StoredenId) July 17th, 2019
image_id (StoredenId) June 23th, 2020 Upload the new image through the Gallery API first to get the ID
post_slug (string) June 23th, 2020 Slug string ended with ".html". Es: "launching-new-rocket.html"
Update an existing post Request

$storeden = new Storeden\Storeden($config);

$payload = array();
$payload['title'] = 'Launching a new Rocket (just-for-fun)';
$payload['content'] = 'Seriously, this is only a joke.';
$payload['post_locale'] = 'en_US';
// etc...

$result = $storeden->put('/blog/post.json', $payload);
					
Update an exissting post Response

{
    "ok": 1,
    "nModified": 1,
    "n": 1,
    "err": null,
    "errmsg": null,
    "updatedExisting": true
}
					

Patch an existing post

Patch an existing post for e-commerce blog.

PUT
/blog/patchPost.json
PARAMETERS LIST
id required (Storeden ID) Post ID
title (string) Post title
content (html) Post content. Html is accepted
post_locale (string) Post strings locale. Accept: en_US, it_IT, de_DE, fr_FR, es_ES
content_preview (string) Small preview content ( extract )
seo_title (string) Seo Title, used into head > title tag
seo_description (string) Seo Title, used into head > meta tag
seo_keywords (string) Seo Title, used into head > meta tag
visible (int) 1 => Post are visible in the store-front, 0 => Post are not visible in the store-front
tags (string) Comma separated tags
timestamp (unixtimestamp) July 4th, 2019
category_id (StoredenId) July 17th, 2019
image_id (StoredenId) June 23th, 2020 Upload the new image through the Gallery API first to get the ID
post_slug (string) June 23th, 2020 Slug string ended with ".html". Es: "launching-new-rocket.html"
Patch an existing post Request

$storeden = new Storeden\Storeden($config);

$payload = array();
$payload['title'] = 'Launching a new Rocket (just-for-fun)';
$payload['content'] = 'Seriously, this is only a joke.';
$payload['post_locale'] = 'en_US';
// etc...

$result = $storeden->put('/blog/patchPost.json', $payload);
					
patch an existing post Response

{
    "ok": 1,
    "nModified": 1,
    "n": 1,
    "err": null,
    "errmsg": null,
    "updatedExisting": true
}
					

Delete single post

Remove post from your blog.

DELETE
/blog/post.json
PARAMETERS LIST
id required (StoredenId) Unique id of your post
Delete single post Request

$storeden = new Storeden\Storeden($config);
$result = $storeden->delete('/blog/post.json', ['id' => '5c86d57416f46af87eec40a2']);
					
Delete single post Response

{
    "ok": 1,
    "err": null,
}
					

List blog categories

GET
/blog/categories/list.json
List blog categories Request

$storeden = new Storeden\Storeden($config);
$blog_categories_list = $storeden->get('/blog/categories/list.json');
					
List blog categories Response

[
    {
        "name": "Test Name",
        "parent": "",
        "description": "Test Description",
        "locale": "it_IT",
        "slug": "test-name",
        "active": true,
        "connected": [],
        "seo": {
            "title": "Seo title",
            "description": null,
            "keywords": null
        },
        "id": "5d2f70ba16f46a1b2072fb9e"
    },
	...
]
					

Get single category

GET
/blog/categories/category.json
PARAMETERS LIST
id required (StoredenId) Unique id of your blog category
Get single category Request

$storeden = new Storeden\Storeden($config);
$result = $storeden->get('/blog/categories/category.json?id=5d2.....b9e');
					
Get single category Response

[
    {
        "name": "Test Name",
        "parent": "",
        "description": "Test Description",
        "locale": "it_IT",
        "slug": "test-name",
        "active": true,
        "connected": [],
        "seo": {
            "title": "Seo title",
            "description": null,
            "keywords": null
        },
        "id": "5d2f70ba16f46a1b2072fb9e"
    },
	...
]
					

Create new blog category

POST
/blog/categories/category.json
PARAMETERS LIST
name required (string)
description (string)
locale required (string)
active required (int) [default = 0] 1 => Category available, 0 => Category disabled
seo_title (string)
seo_description (string)
seo_keywords (string)
Create new blog category Request

$storeden = new Storeden\Storeden($config);

$payload = array();
$payload['name'] = 'Test Name';
$payload['description'] = 'Test Description';
$payload['locale'] = 'it_IT';
$payload['active'] = 1;
$payload['Seo title'] = 'Seo title';

$result = $storeden->post('/blog/categories/category.json', $payload);
					
Create new blog category Response

[
    {
        "name": "Test Name",
        "parent": "",
        "description": "Test Description",
        "locale": "it_IT",
        "slug": "test-name",
        "active": true,
        "connected": [],
        "seo": {
            "title": "Seo title",
            "description": null,
            "keywords": null
        },
        "id": "5d2f70ba16f46a1b2072fb9e"
    },
	...
]
					

Update existing blog category

PUT
/blog/categories/category.json
PARAMETERS LIST
id required (StoredenID)
name required (string)
description (string)
locale required (string)
active required (int) [default = 0] 1 => Category available, 0 => Category disabled
seo_title (string)
seo_description (string)
seo_keywords (string)
Update existing blog category Request

$storeden = new Storeden\Storeden($config);

$payload = array();
$payload['id'] = '5d2f70ba16f46a1b2072fb9e';
$payload['name'] = 'Test Name';
$payload['description'] = 'Test Description';
$payload['locale'] = 'it_IT';
$payload['active'] = 1;
$payload['Seo title'] = 'Seo title';

$result = $storeden->put('/blog/categories/category.json', $payload);
					
Update existing blog category Response

{
    "ok": 1,
    "nModified": 1,
    "n": 1,
    "err": null,
    "errmsg": null,
    "updatedExisting": true
}
					

Patch existing blog category

PUT
/blog/categories/patchCategory.json
PARAMETERS LIST
id required (StoredenID)
name (string)
description (string)
locale (string)
active (int) [default = 0] 1 => Category available, 0 => Category disabled
seo_title (string)
seo_description (string)
seo_keywords (string)
Patch existing blog category Request

$storeden = new Storeden\Storeden($config);

$payload = array();
$payload['id'] = '5d2f70ba16f46a1b2072fb9e';
$payload['name'] = 'Test Name';
$payload['locale'] = 'it_IT';

$result = $storeden->put('/blog/categories/patchCategory.json', $payload);
					
Patch existing blog category Response

{
    "ok": 1,
    "nModified": 1,
    "n": 1,
    "err": null,
    "errmsg": null,
    "updatedExisting": true
}