emma-sdk icon indicating copy to clipboard operation
emma-sdk copied to clipboard

Add member to specific group not returning anything

Open mattfili opened this issue 8 years ago • 3 comments

I'm trying to add a member to a specific group and I'm not able to return anything / not getting any errors.

I'm wondering if I'm passing in data without the right headers, or maybe poor format.

var Emma = require('emma-sdk');
var localConfig = require('../../config/local.env');

var operatorInfo = {
        "fields" : {
            "first_name": req.body.init_firstname,
            "last_name": req.body.init_lastname,
        },
        "email": res.body.email
}


var emma = new Emma({
    publicKey: localConfig.emmaKey.publicKey,
    privateKey: localConfig.emmaKey.privateKey,
    accountID: localConfig.emmaKey.accountID
})


emma.member.withID(groupId).groups.add(JSON.stringify(operatorInfo), function(err, result){
    console.log(err)
    console.log(result);
    return result;
})

mattfili avatar Feb 21 '16 08:02 mattfili