Skip to content

Instantly share code, notes, and snippets.

@rachelpw
Created November 16, 2016 03:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rachelpw/7d6fae96f0d98f4fe4b4b9cde5af6376 to your computer and use it in GitHub Desktop.
Save rachelpw/7d6fae96f0d98f4fe4b4b9cde5af6376 to your computer and use it in GitHub Desktop.
This shows you how to make a person using node. Download the request library by running 'node install request'
var request = require('request');
var formData = {
"name": "Hodor",
"emails": [{"email": "hodor@hodor.com","category": "work"}],
"tags": ["hodorhodor"],
}
var headers = {
"Content-Type": "application/json",
"X-PW-AccessToken" : "YOURAPIKEY",
"X-PW-Application" : "developer_api",
"X-PW-UserEmail" : "YOUREMAIL",
};
var opts = {
url: 'https://api.prosperworks.com/developer_api/v1/people',
method: "post",
headers: headers,
json: true,
body: formData
};
request.post(opts);
@ryanhssn
Copy link

Error: Cannot find module 'request'

Trying to figuring out this request module issue but unfortunately no luck. Is there any other way to make a lead in prosperworks with nodeJs other than request module? or can you please help me figuring out this issue. I have a form, I just want to create lead on form submit. Any help would be appreciated. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment