Home

Awesome

CloseIoDotNet

A library for interacting with the Close.io CRM API.

Author

More Than Rewards

Maintained by Tony Lechner, tony@morethanrewards.com, Software Engineer at More Than Rewards

Legal Note

CloseIoDotNet is a third party API abstraction library. More Than Rewards is not affiliated with Elastic, Inc, owners of the Close.Io service and trademark, in any way.

License

MIT. See LICENSE.txt.

Status

First beta release (0.1) complete - reading from all lead-based endpoints implemented.

Second beta release (0.2) under active development.

How to

Read single records by ID with Queries, or read multiple records with Scans.

Currently, reading of any lead-based record type (Lead, Address, Contact, Contact URL, Contact Phone, Contact Email, Opportunity, and Task objects) are supported.

Example: Query a specific lead

using (var context = new CloseIoDotNetContext("VALID CLOSE.IO API KEY"))
{
	return context.Query<Lead>("LEAD ID");
}

Example: Scan all leads

using (var context = new CloseIoDotNetContext("VALID CLOSE.IO API KEY"))
{
	return context.Scan<Lead>();
}

Example: Scan for the names of all contacts with a specific phone number.

using (var context = new CloseIoDotNetContext("VALID CLOSE.IO API KEY"))
{
	var fieldsToSearch = (new Lead()).EntityFields.Where(entry => entry.SerializedName.Equals("contacts"));
	var searchQuery = "phone_number:111-222-3344";
	return context.Scan<Lead>(searchQuery, fieldsToSearch)
		.SelectMany(entry => entry.Contacts)
		.Select(entry => entry.Name);
}

Roadmap