Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
fullcontact
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
prospector
fullcontact
Commits
428eec83
Commit
428eec83
authored
May 15, 2013
by
3rd-Eden
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[doc] finish documentation
parent
26fdf435
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
68 additions
and
11 deletions
+68
-11
README.md
README.md
+63
-6
email.js
endpoints/email.js
+1
-1
location.js
endpoints/location.js
+4
-4
No files found.
README.md
View file @
428eec83
...
@@ -3,10 +3,10 @@
...
@@ -3,10 +3,10 @@
`fullcontact`
is a Node.js module that wraps the
[
fullcontact
]
API. It
`fullcontact`
is a Node.js module that wraps the
[
fullcontact
]
API. It
implements the following API endpoints:
implements the following API endpoints:
-
Location
-
[
Location
](
#location
)
-
Person
-
[
Person
](
#person
)
-
Email
-
[
Email
](
#email
)
-
Name
-
[
Name
](
#name
)
## Installation
## Installation
...
@@ -72,6 +72,47 @@ Please note that these properties are all set to 0 until you have made your
...
@@ -72,6 +72,47 @@ Please note that these properties are all set to 0 until you have made your
first request to the API server as these values are parsed from the response
first request to the API server as these values are parsed from the response
headers.
headers.
## Error responses
This API implemention will return an Error object when the FullContact response
is returned without a
`status: 200`
so it could be that your operation is queued
for processing. That's why all returned error's have a
`status`
property which
the returned status code (unless it's a parse error or a generic error). So just
because you got an error, it doesn't mean that your request has failed.
### Location
Turn your semi-structured data in fully structured location data. This
`Location`
endpoint is namespaced as a
`.location`
property. It has 2 optional
arguments.
1.
`casing`
How is the provided location cased?
-
`uppercase`
for UPPERCASED NAMES (JOHN SMITH)
-
`lowercase`
for lowercased names (john smith)
-
`titlecase`
for Title Cased names (John Smith)
2.
`includeZeroPopulation`
will display 0 population census locations. The
provided value should be a boolean.
#### fullcontact.location.normalize('denver', [casing], [includeZeroPopulation], fn);
Normalize the location data.
```
js
fullcontact
.
location
.
normalize
(
'denver'
,
function
(
err
,
data
)
{
..
});
```
#### fullcontact.location.enrich('denver', [casing], [includeZeroPopulation], fn);
Retrieve more information from the location API.
```
js
fullcontact
.
location
.
enrich
(
'denver'
,
function
(
err
,
data
)
{
..
});
```
### Person
### Person
The
`Person`
endpoint is confidently namespaced as a
`.person`
property. Each
The
`Person`
endpoint is confidently namespaced as a
`.person`
property. Each
...
@@ -135,9 +176,11 @@ fullcontact.person.phone('+13037170414', function (err, data) {
...
@@ -135,9 +176,11 @@ fullcontact.person.phone('+13037170414', function (err, data) {
### Email
### Email
The
`Email`
endpoint is namespaced under the
`.email`
property.
Reduce the number of anonymous subscribers by detecing of the user is
subscribing with a real e-mail address or just a one time address The
`Email`
endpoint is namespaced under the
`.email`
property.
#### email.disposable(email,
[casing],
fn);
#### email.disposable(email, fn);
Checks if the given e-mail address was disposible.
Checks if the given e-mail address was disposible.
...
@@ -220,6 +263,20 @@ fullcontact.name.parser('john smith', function (err, data) {
...
@@ -220,6 +263,20 @@ fullcontact.name.parser('john smith', function (err, data) {
});
});
```
```
## Testing
The tests are written against the live FullContact API. They can be ran using:
```
npm test
```
If you want to test with your own API key please run:
```
API_KEY=<key> npm test
```
## License
## License
The module is released under the MIT license.
The module is released under the MIT license.
...
...
endpoints/email.js
View file @
428eec83
...
@@ -25,7 +25,7 @@ function Email(api) {
...
@@ -25,7 +25,7 @@ function Email(api) {
* @api public
* @api public
*/
*/
Email
.
prototype
.
disposable
=
function
disposable
()
{
Email
.
prototype
.
disposable
=
function
disposable
()
{
var
args
=
this
.
api
.
args
(
arguments
,
'casing'
);
var
args
=
this
.
api
.
args
(
arguments
);
//
//
// Add a custom endpoint.
// Add a custom endpoint.
...
...
endpoints/location.js
View file @
428eec83
...
@@ -18,14 +18,14 @@ function Location(api) {
...
@@ -18,14 +18,14 @@ function Location(api) {
* Normalize the location data.
* Normalize the location data.
*
*
* ```js
* ```js
* fullcontact.location.normalize('denver', [
includeZeroPopulation], [casing
], fn);
* fullcontact.location.normalize('denver', [
casing], [includeZeroPopulation
], fn);
* ```
* ```
*
*
* @returns {Location}
* @returns {Location}
* @api public
* @api public
*/
*/
Location
.
prototype
.
normalize
=
function
normalize
()
{
Location
.
prototype
.
normalize
=
function
normalize
()
{
var
args
=
this
.
api
.
args
(
arguments
,
'
population'
,
'casing
'
);
var
args
=
this
.
api
.
args
(
arguments
,
'
casing'
,
'population
'
);
//
//
// Add a custom endpoint.
// Add a custom endpoint.
...
@@ -40,14 +40,14 @@ Location.prototype.normalize = function normalize() {
...
@@ -40,14 +40,14 @@ Location.prototype.normalize = function normalize() {
* Retrieve more information from the location API.
* Retrieve more information from the location API.
*
*
* ```js
* ```js
* fullcontact.location.enrich('denver', [
includeZeroPopulation], [casing
], fn);
* fullcontact.location.enrich('denver', [
casing], [includeZeroPopulation
], fn);
* ```
* ```
*
*
* @returns {Location}
* @returns {Location}
* @api public
* @api public
*/
*/
Location
.
prototype
.
enrich
=
function
enrichment
()
{
Location
.
prototype
.
enrich
=
function
enrichment
()
{
var
args
=
this
.
api
.
args
(
arguments
,
'
population'
,
'casing
'
);
var
args
=
this
.
api
.
args
(
arguments
,
'
casing'
,
'population
'
);
//
//
// Add a custom endpoint.
// Add a custom endpoint.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment