2016-09-02 2 views
1

// ParmeterIch versuche, neue Kunden mit Google Händler api von node.I bin immer 400 Fehler

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 " 

} // mit api

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

Iam immer diese Fehlermeldung einzufügen:

{ [Error: Invalid Value] 
    code: 400, 
    errors: [ { domain: 'global', reason: 'invalid', message: 'Invalid Value' } ] } 

Antwort

0

können Sie request Modul verwenden diese Aktion in der einfachen Weise durchzuführen.

hier ein Beispiel ein customer führen Sie es zum Einfügen

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": "[email protected]" 
} 

Weitere reference

0

Das Problem bereits in der Fehlerprotokolle angegeben.

reason: message: 'Invalid Value'

"auth":auth ist nicht im Customers resource enthalten.

Dies sind die gültigen Werte:

{ 
    "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 
} 
Verwandte Themen