XenAPI - XenForo PHP REST API

XenAPI - XenForo PHP REST API 1.4.2

No permission to download
For some reason when I try to register a user (using the example) I get an unexpected database error. I have tried removing customs fields and certain requirements (making everything the defaults) and it still is not working for me.
 
For some reason when I try to register a user (using the example) I get an unexpected database error. I have tried removing customs fields and certain requirements (making everything the defaults) and it still is not working for me.
Could you enable debug in /library/config.php, $config['debug'] = 1;
See if that displays a stacktrace.
 
After posting that I just remembered that I could View Source of the database error page. Turns out there was a conflict with TaigaChat Pro shout box. Even just "disabling" this addon would throw a database error. After uninstalling it, however, everything work flawlessly. The error I was getting is below:

<!-- Mysqli statement execute error : Field 'taigachat_color' doesn't have a default value -->
 
After posting that I just remembered that I could View Source of the database error page. Turns out there was a conflict with TaigaChat Pro shout box. Even just "disabling" this addon would throw a database error. After uninstalling it, however, everything work flawlessly. The error I was getting is below:
Seems like some addon author have been sloppy with their database fields ;)

I made it possible to edit users and I had to correct a few minor issues with the API earlier.
I moved the code to a "dev" branch, which can be found here: https://github.com/Contex/XenAPI/tree/dev
 
just hacked to have that node list, cos i need it, until you release the next version ...

but, on the whole, u made my day :notworthy:
 
getThread seems to not get the thread content.

I assume you would do that through the getPost method. Since I want the thread content, is it possible to get posts that have a position of 1, and come from a certain specific node. That would essentially make it so I get the 5 latest threads from let's say the Announcements forum.
 
What about creating threads or posts?
I'll add that later today when I get home from work.

getThread seems to not get the thread content.

I assume you would do that through the getPost method. Since I want the thread content, is it possible to get posts that have a position of 1, and come from a certain specific node. That would essentially make it so I get the 5 latest threads from let's say the Announcements forum.
By thread content, do you mean the first post of the thread?
I could create a "grab_content" parameter, which would grab the content of the first post in the thread, like so:
Code:
api.php?action=getThreads&hash=API_KEY&node_id=4&grab_content

I could also make it so you could grab a specific amount of posts (0 being all the posts in the thread).
Code:
api.php?action=getThreads&hash=API_KEY&node_id=4&grab_content&post_limit=10

Thoughts?

I'm working on a rewrite of the code, to make it easier to add custom actions, Single Sign On, real RESTful API (current code is a workaround), and much more.
 
I'll add that later today when I get home from work.


By thread content, do you mean the first post of the thread?
I could create a "grab_content" parameter, which would grab the content of the first post in the thread, like so:
Code:
api.php?action=getThreads&hash=API_KEY&node_id=4&grab_content

I could also make it so you could grab a specific amount of posts (0 being all the posts in the thread).
Code:
api.php?action=getThreads&hash=API_KEY&node_id=4&grab_content&post_limit=10

Thoughts?

I'm working on a rewrite of the code, to make it easier to add custom actions, Single Sign On, real RESTful API (current code is a workaround), and much more.

What about specifying how many threads to get in the parameters?

Lets say get 5 of the latest threads in the node_id 4 with their messages as well, as in their content.
 
What about specifying how many threads to get in the parameters?

Lets say get 5 of the latest threads in the node_id 4 with their messages as well, as in their content.
That should already be possible by using the "order_by" parameter with "post_date" and using the "limit" parameter, like so:
Code:
api.php?action=getThreads&hash=API_KEY&node_id=4&order_by=post_date&order=desc&limit=5

Only thing I have to implement is grabbing the actual content (posts/messages) and a way to limit the amount of posts/messages if needed.

Grab all the posts/messages in each thread:
Code:
api.php?action=getThreads&hash=API_KEY&node_id=4&order_by=post_date&order=desc&limit=5&grab_content

Limit amount of posts/messages in each thread (I'm not fully sure about the "content_limit" name yet, but something like that).
Code:
api.php?action=getThreads&hash=API_KEY&node_id=4&order_by=post_date&order=desc&limit=5&grab_content&content_limit=10
 
What about specifying how many threads to get in the parameters?

Lets say get 5 of the latest threads in the node_id 4 with their messages as well, as in their content.
Should now possible with the last two commits:
https://github.com/Contex/XenAPI/commit/494ecc0e9f4cc7056329aded84e2b6e2a8b3dd2e
https://github.com/Contex/XenAPI/commit/91834d71deebf1a82e64a9268a9c823cf5907ab6

Could you try it out and see if it's what you were looking for?
Dev branch can be found here: https://github.com/Contex/XenAPI/blob/dev/net/xenapi/XenAPI/api.php
 

Seems to work pretty well actually :)

I used the following

Code:
api.php?action=getThreads&hash=My_API_Key&node_id=4&order_by=post_date&order=desc&limit=5&grab_content&content_limit=1

To grab the 5 latest threads in the announcement forums and their content.
 
Top Bottom