node.js - I am trying to insert new customer using google reseller api of node.I am getting 400 error -


//parmeter

var params = { "auth":auth, "kind": "reseller#customer", "customerid": "customerid", "customerdomain": "customer domain", "postaladdress": {   "kind": "customers#address",   "contactname": "john doe",   "organizationname": "example inc",   "postalcode": "94043",   "countrycode": "us",  }, "alternateemail": "email address  " 

} //using api

var service = google.reseller('v1'); service.customers.insert(params,function(err,data){    console.log(err);    console.log(data);  }) 

iam getting error:

{ [error: invalid value]   code: 400,   errors: [ { domain: 'global', reason: 'invalid', message: 'invalid value' } ] } 

you can use request module perform action in easy way.

here example insert customer execute it

post https://www.googleapis.com/apps/reseller/v1/customers

    body parameter    {   "kind": "reseller#customer",   "customerid": "custid-1234",   "customerdomain": "example.com",   "postaladdress": {     "kind": "customers#address",     "contactname": "john doe",     "organizationname": "example inc",     "postalcode": "94043",     "countrycode": "us",   },   "alternateemail": "alternateemail@google.com" } 

for more reference


Comments