Zapier / Invalid Argument Users.Email?

  • 1
  • Problem
  • Updated 8 months ago
I'm using Zapier to create users and am randomly getting the following error: 

Javascript Exception: `TypeError: Cannot read property '0' of undefined`.


Which is why I decided to make my own connector but am stuck with error messages that I can't figure out: "Invalid Argument Users.Email" or "Invalid Argument Users.User"

This is the Postman request:
 
POST /sf/v3/Users HTTP/1.1
Host: xxxxxxxxxxx.sf-api.com
Authorization: Bearer xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Content-Type: application/x-www-form-urlencoded
Cache-Control: no-cache
Postman-Token: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

%7B=&%22Email%22=%22user.one%40domain.com%22%2C&%22FirstName%22=%22Name%22%2C&%22LastName%22=%22Last+Name%22%2C&%22Company%22=%22Company%22%2C&%22Password%22=%22password%22%2C&%7D=
Photo of Patrick Prasquier

Patrick Prasquier

  • 2 Posts
  • 1 Reply Like

Posted 8 months ago

  • 1
Photo of Michael Berrier

Michael Berrier, Official Rep

  • 123 Posts
  • 24 Reply Likes
Patrick,

The V3 API expects a JSON-encoded request body, so I would expect your request to have the following header:
Content-Type: application/json

And a body like the following:
{
  "Email" : "user.one@domain.com",
  "FirstName" : "Name",
  "LastName" : "Last Name",
  "Company" : "Company",
  "Password" : "password"
}

See the documentation here for a more full-fledged example:
http://api.sharefile.com/rest/docs/resource.aspx?name=Users

As written, you're using a form-urlencoded request instead.

Michael
Photo of Patrick Prasquier

Patrick Prasquier

  • 2 Posts
  • 1 Reply Like
Thanks. Switching to application/json  in Postman and checking the option "Send to Action Endpoint URL in JSON body" in Zapier both did the trick.