//参数
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 "}//使用api
var service = google.reseller('v1');
service.customers.insert(params,function(err,data){
console.log(err);
console.log(data);
})我收到这个错误:
{ [Error: Invalid Value]
code: 400,
errors: [ { domain: 'global', reason: 'invalid', message: 'Invalid Value' } ] }发布于 2016-09-02 13:02:58
您可以使用request模块轻松执行此操作。
下面是一个插入customer并执行它的示例
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"
}了解更多reference
发布于 2016-09-03 16:11:18
您的错误日志中已经说明了该问题。
原因:消息:'Invalid Value‘
Customers resource中不包括"auth":auth。
以下是有效值:
{
"kind": "reseller#customer",
"customerId": string,
"customerDomain": string,
"postalAddress": {
"kind": "customers#address",
"contactName": string,
"organizationName": string,
"locality": string,
"region": string,
"postalCode": string,
"countryCode": string,
"addressLine1": string,
"addressLine2": string,
"addressLine3": string
},
"phoneNumber": string,
"alternateEmail": string,
"resourceUiUrl": string,
"customerDomainVerified": boolean
}https://stackoverflow.com/questions/39284538
复制相似问题