[SOLVED]How to add member to usergroup from C++



  • Hello all!

    I did next thing:

    @
    QJsonObject query;
    query["id"] = groupId;
    QJsonObject user;
    user["id"] = userId;
    user["objectType"] = QString("users");
    query["headers"] = user;

            const EnginioReply* pAddMemberOperation = client.create(query, EnginioClient::UsergroupMembersOperation);
            QObject::connect(pAddMemberOperation, &EnginioReply::finished,
                             [&](EnginioReply * pReply)
            {
                qDebug() <<  pReply->data();
            });
    

    @

    I recieved next message:

    @QJsonObject({"errors": [{"message": "User not found","reason": "NotFound"}]}) @

    UserId and GroupId 100% correct.

    How I can add member to group from enginio?



  • It is a bug in EnginioClient::create(), thanks for reporting it. I will post as soon as it is fixed. Temporary workaroud would be to use internal api EnginioClient::customRequest.



  • Hi,
    It is fixed in trunk (7fc355bd303b79943311c97417409ee60c06a074)

    Just instead of:
    @ query["headers"] = user;@

    use

    @ query["member"] = user;@



  • Yes, now this works! Thank you!



  • you welcome


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.