API Error

Hi guys,

I’ve recently noticed that I am getting a API error when calling the private members collection in the editor. However the same code in Production works just fine. This started to occur a few days ago. I don’t believe it’s related to anything that I’m doing as I didn’t change any thing and it works fine in Production.

This is just a Editor issue… anyone else experiencing this?

export function checkGuestEmail(event) {
    console.info(event.target.value) //value is a email address
    if (event.target.value.length > 0) {
        wixData.query("Members/PrivateMembersData")
            .eq("loginEmail", event.target.value)
            .find()
            .then( (results) => {
                console.info(results)
            });
    }
}

Results with the following error:
"missing_context, details: {"fields":"MSID / (appDefId, instanceId)","apps":"null","entities":"{\"context\":{\"appDefId\":\"eb377299-86b4-4a86-a1b5-774a2d1d374b\"},\"identities\":[{\"service\":{\"appDefId\":\"eb377299-86b4-4a86-a1b5-774a2d1d374b\"}}]}"}"message:
details:
{…}
"{"context":{"appDefId":"eb377299-86b4-4a86-a1b5-774a2d1d374b"},"identities":[{"service":{"appDefId":"eb377299-86b4-4a86-a1b5-774a2d1d374b"}}]}"entities:
"missing_context"error:
"MSID / (appDefId, instanceId)"fields:
"api_error"category:
nullapps:

Thank you,
David

This is a known issue and is being looked into.

The Wix Members app collection - Members/PrivateMembersData - should be Site Member Author permission, however it is being set as Admin and hence why you are getting the issue.

The workaround for it at the moment is to use Wix Data Options to suppress checks etc.
https://www.wix.com/corvid/reference/wix-data.html#WixDataOptions

Thanks GOS for the update

Hi @GOS and @david,

I have been having the same issue over the last week. Can you please show your code to see how we all can solve this problem? My code looks like this and even with the options feature my code still gives the same error message. Here is my code:

$w.onReady( function () {

let options = {
“suppressAuth”: true ,
“suppressHooks”: true
};

wixData.query(“Members/PrivateMembersData”)
.eq(“_id”, wixUsers.currentUser.id)
.find(options)
.then( (results) => {…}

})//end

actually someone was watching… the API error is no longer occurring.