XenAPI - XenForo PHP REST API

XenAPI - XenForo PHP REST API 1.4.2

No permission to download
First off, let me say GREAT addon!

Is there a way to Move Threads using this?

EDIT: It is undocumented, but this moves threads successfully:

Code:
api.php?action=editThread&thread_id=THREAD_ID&hash=API_KEY&grab_as=USERNAME&node_id=NEW_NODE_ID
 
Last edited:
First off, let me say GREAT addon!

Is there a way to Move Threads using this?

EDIT: It is undocumented, but this moves threads successfully:

Code:
api.php?action=editThread&thread_id=THREAD_ID&hash=API_KEY&grab_as=USERNAME&node_id=NEW_NODE_ID
Sorry about that, I'm working on documenting (and rewriting) everything.

Glad you managed to figure it out yourself!
 
With the massive amount of our user's dissatisfaction with Tapa Talk's new upgrade and there being no real alternatives out in the market, we're thinking of rolling our own app. I'm wondering if the XenAPI would work well for this sort of thing? Any thoughts on that?

Ray
 
Hmm, will keep an eye on that. Our thinking, however, is to have a more fully integrated app, ie. with not only the forums but also our articles, podcasts, videos, etc. so it's a one stop shop for our website.

Ray
 
Hmm, will keep an eye on that. Our thinking, however, is to have a more fully integrated app, ie. with not only the forums but also our articles, podcasts, videos, etc. so it's a one stop shop for our website.

Ray
This addon is capable of that, just grab from a specific node/forum.
 
Sorry, as in moderating threads, posts -- deleting, moving, etc. the usual sort of thing that comes with moderating a forum.

Ray
 
I would like to use this api to search through my forum, but unfortunately I'm not sure how I can do this. Is there a "search" action available like
api.php?action=search @Contex ?
 
why am I getting this
{"error":17,"message":"The API key has not been changed, make sure you use another API key before using this API"}
 
why am I getting this
{"error":17,"message":"The API key has not been changed, make sure you use another API key before using this API"}
Change the text 'REPLACE_THIS_WITH_AN_API_KEY' to your desired API key on line 20 of api.php.
 
more questions:
  • The hash code it generates. When doe it expires?
  • I am trying to create a javascript app with this. How can I make it secure?
  • I guess if you lose your hash code, you are dead. Right?
Any guidance or suggestion for securing js app would be helpful.

Thanks.
 
Sorry, was out of country and missed the alerts.

I would like to use this api to search through my forum, but unfortunately I'm not sure how I can do this. Is there a "search" action available like
api.php?action=search @Contex ?
Yes.

Code:
api.php?api_key=API_KEY&action=search&value=test
api.php?api_key=API_KEY&action=search&value=test&order=ASC&type=thread
Valid arguments for "order": ASC and DESC
Valid arguments for "type": thread, thread_title and post

These are optional parameters.

Check this post earlier in this thread.

Example:
Code:
api.php?hash=API_KEY&action=search&value=test
Response:
Code:
[
{
"type": "post",
"data": {
"post_id": 2,
"thread_id": 1,
"user_id": 1,
"username": "Contex",
"post_date": 1421756007,
"message": "test",
"ip_id": 10,
"message_state": "visible",
"attach_count": 0,
"position": 1,
"likes": 0,
"like_users": "a:0:{}",
"warning_id": 0,
"warning_message": "",
"last_edit_date": 0,
"last_edit_user_id": 0,
"edit_count": 0,
"message_html": "test",
"absolute_url": "http:\/\/xenapi.net\/index.php?posts\/2\/"
}
}
]

more questions:
  • The hash code it generates. When doe it expires?
  • I am trying to create a javascript app with this. How can I make it secure?
  • I guess if you lose your hash code, you are dead. Right?
Any guidance or suggestion for securing js app would be helpful.

Thanks.
  • The hash code should only regenerate if the user updates his/her password (or user information). I have to look into this as I haven't experienced it to regenerate before, so in short: it should not expire unless the user updates the password.
  • Make sure you store the hash securely, I have average experience with security in JavaScript so I wouldn't be able to help you with that.
  • You can make the user authenticate again if they lose the hash.
Edit: Just tested, it does regenerate the authentication record when the user changes their password but does not regenerate when they change their email.
You would also have to get a new hash if the user changes their username.
 
Last edited:
Hello, when I use XenAPI Object for login an account, XenApi return TRUE but I am not connected on my forum when I refresh the page.

Code:
$response = $xenAPI->login($username, 'secret', $ip_address);
// Return True but account not online.

With XenAPI class, it's possible to call all action inside the documentation ? I see only login/createAlert/authenticate and getActions (without arguments), how I can use other methode from XenApi class please ? And what is the difference beetwen "login" and "authenticate" please ?

And I have a suggestion, add logout from API, on Drupal 8 if my user click on "logout" button, I would like disconnecte all accounts (site and forum) :)

Thanks.
 
Top Bottom