API Plugin to migrate to Bludit

Post Reply
User avatar
grz
Jr. Bludit
Posts: 4
Joined: Thu Dec 31, 2020 4:33 pm
Location: France
Contact:

Hi there

I will migrate a Jekyll site which contains more than 500 posts with custom fields in the YAML structure.

I'm able to migrate standard fields (date, title, tags, content, etc.) via the Bludit API, but I don't see any method to create the category from the API.

I've already exploring the API code at https://github.com/bludit/bludit/blob/m ... plugin.php and I don't see any method to POST a new category.

I have almost 74 categories to migrate.

Also, I tried to create custom fields via POST on /pages but it not work presently. I don't get any error, but the defined custom fields on the pages is not filled after creation. Maybe I'm wrong somewhere. I will try again.

If you have any idea or solution to help to achieve this migration, you're welcome! ;)

Long live Bludit
User avatar
grz
Jr. Bludit
Posts: 4
Joined: Thu Dec 31, 2020 4:33 pm
Location: France
Contact:

I found how to add custom fields via the API.

The add method of the pages class need a nested hash, not an array of hash.

So, in JSON it looks like:

Code: Select all

{
  "custom": {
    "artist": "Michael",
    "album": "Something"
  }
}
Question about add category via API still open :)
User avatar
diego
Site Admin
Posts: 773
Joined: Sat May 16, 2015 2:53 pm
Been thanked: 1 time
Contact:

Hi,
is no possible to create categories via the API, I will add the feature for Bludit v4, because all the system will work via API.
User avatar
grz
Jr. Bludit
Posts: 4
Joined: Thu Dec 31, 2020 4:33 pm
Location: France
Contact:

Ok, I have found a workaround for the category.

I have another issue about the API plugin: https://github.com/bludit/bludit/issues/1299

I tried many times to upload an image via the API without success.

It's possible to have an example in CURL?

Regards
User avatar
grz
Jr. Bludit
Posts: 4
Joined: Thu Dec 31, 2020 4:33 pm
Location: France
Contact:

I found the way. I will push a quote about that in the documentation.
Post Reply