API to create events and more
Hi,
I have some sources (ics files, lists, xml files and others) with data I want to add. In my case there are data of events. Copy them one by one in the web interface is a pain the the a...
So I was thinking: Hey, there is an api to put all this in for sure!
But when I see it correct there is (for events) just a read-only interface. Is there a plan to implement also an interface to post data / create entries? Or maybe a kind of a generic "Fill out form xy" function?
-
-
·
LeonidS
- ·
Hello @Callya !
Yes, UNA has the api for that. For example to add content to Posts module it's possible to call
serviceEntityAddservice function:curl -H 'Authorization: Bearer tmw.msZjv4MEpwBt6Gku6Wjzvu5i9DX7LkMZdC+8AbWar&px' "http://example.com/una/api.php?r=bx_posts/entity_add¶ms=%5B3%2C%7B%22title%22%3A%22Test%20title2%22%2C%22cat%22%3A3%2C%22text%22%3A%22Post%20text%22%2C%22allow_view_to%22%3A3%7D%5D"So you may write the script, which, will parse your files with data and refer to this api page.
-
·
LeonidS
-
- · Callya
- ·
Thank you for the answer. But as usual the documentation really needs more attention.
Here for example:
- On this page (https://unacms.com/wiki/Dev-API) the authentication methods are described with an example how to add an entry using the posts module.
- A List with safe and unsafe services is not there.
I'm trying now for hours to create one event using the api and got already a few hundred times "HTTP 404" because I just don't find the correct value for "r=".
I've found a "insert"function in BxEventsFormEntry.php, but it can not be called from the api.
-
- · Zyrgon Portugal
- ·
Hello @Callya , in this time you have found some solution to this? I'm trying to create a timeline_common_post via API but the method `serviceEntityAdd` don't work in this case nether.