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:
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.
 
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.
 
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 .
 
not yet fixed still getting the same error

{
"errors": [
{
"code": "please_enter_valid_name",
"message": "Please enter a valid name.",
"params": []
}
]
}
 
If you have an issue with this, it's likely worth creating a thread in the development discussions forum to confirm what input you are submitting -- if you're not explicitly passing a username in as mentioned in the fix above, this is very much expected.
 
If you have an issue with this, it's likely worth creating a thread in the development discussions forum to confirm what input you are submitting -- if you're not explicitly passing a username in as mentioned in the fix above, this is very much expected.
I'm trying to create a topic as a guest using the guest api key.

I get an error:

Code:
"errors": [
        {
            "code": "please_enter_valid_name",
            { "message": "Please enter a valid name."
            { "params": []
        }

You added "api_guest_username" in one of the updates to solve this problem - but how do you activate it and pass the right parameter to create a topic?
 
Support isn't provided in the public forums in closed bug reports - you will need to post in the development forum.
 
Top Bottom