Page 1 of 1

API Plugin to migrate to Bludit

Posted: Thu Dec 31, 2020 4:49 pm
by grz
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

Re: API Plugin to migrate to Bludit

Posted: Thu Dec 31, 2020 5:56 pm
by grz
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 :)

Re: API Plugin to migrate to Bludit

Posted: Fri Jan 01, 2021 11:10 pm
by diego
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.

Re: API Plugin to migrate to Bludit

Posted: Wed Jan 06, 2021 1:25 pm
by grz
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

Re: API Plugin to migrate to Bludit

Posted: Wed Jan 06, 2021 1:40 pm
by grz
I found the way. I will push a quote about that in the documentation.