Fixed Can't create post via API from guest user (no username)

ivan133

New member
Hi!
I'm trying to create a post via API by the guest.
I've tried the guest key and superuser key.
I keep getting:
code": "please_enter_valid_name"
How can I create a post with the guest user?
I can create guest posts via the web interface, so I'm sure that permissions are correct.
Also if I set XF-Api-User in the header it will work (will create a post on behalf of the user).
 
Last edited:

Mike

XenForo developer
Staff member
I thought we handled this, but it looks like it might be a current limitation of the API. There should generally be a global way of setting the guest username which will be used if needed (which is how it works on the public app), but it doesn't appear to be exposed to the API. I'll move this to bugs for tracking.
 

XF Bug Bot

XenForo bug fixer bot
Staff member
Thank you for reporting this issue, it has now been resolved. We are aiming to include any changes that have been made in a future XF release (2.2.3).

Change log:
For API actions that require guests to have a username specified (like posting a message), allow this to be globally set via the api_guest_username parameter
There may be a delay before changes are rolled out to the XenForo Community.
 

Cyry

Active member
I thought we handled this, but it looks like it might be a current limitation of the API. There should generally be a global way of setting the guest username which will be used if needed (which is how it works on the public app), but it doesn't appear to be exposed to the API. I'll move this to bugs for tracking.

Have api xenforo some limits (bug-error) right now ?
i have a phyton script that are copy articles from a blog and post it on my forum (xf2.2.3 patch 1) with a super user api key and all privileges. The problem comes when that script are trying to POST , only are works GET petitions .
What can be the problem there ? I have a demo installed on same server and its works , but on live forum don’t .
 
Top