# @simpleview/crm-client

> Client for communicating with sv-crm

Latest version **1.0.6** (published 2019-04-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install @simpleview/crm-client
pnpm add @simpleview/crm-client
yarn add @simpleview/crm-client
bun add @simpleview/crm-client
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.6 |
| Published | 2019-04-27 |
| First published | 2019-03-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 11.1 KB |
| Known vulnerabilities | 0 (+25 in 1 direct dependencies) |
| Install scripts | no |
| Author | Sean Albert |
| Maintainers | owenallenaz, qman33, seanmalbert, svjoshua |

## Links

- npm: https://www.npmjs.com/package/@simpleview/crm-client
- Repository: https://github.com/simpleviewinc/sv-crm-client
- Homepage: https://github.com/simpleviewinc/sv-crm-client#readme
- Issues: https://github.com/simpleviewinc/sv-crm-client/issues
- npm.io page: https://npm.io/package/@simpleview/crm-client

## Dependencies (2)

- [axios](https://npm.io/package/axios.md) 0.18.0
- [@simpleview/sv-graphql-client](https://npm.io/package/@simpleview/sv-graphql-client.md) 1.0.0

## Recent versions

- 1.0.6 (latest) — 2019-04-27
- 1.0.5 — 2019-04-23
- 1.0.4 — 2019-04-01
- 1.0.3 — 2019-03-29
- 1.0.2 — 2019-03-24
- 1.0.1 — 2019-03-14
- 1.0.0 — 2019-03-08

## README

# sv-crm-client
Client and tools for communicating with sv-graphql and crm-graphql-server.

# installation

```
npm install @simpleview/sv-crm-client
```

## crm_query

For all queries, a bearer token must be proved in Authorization header. To acquire your token, you must login first to get the token:
	```
	{
		auth {
			login(email: String!, password: String!) {
				success
				token
			}
		}
	}
	```

For all queries, acct_id must be passed at the root.
	```
	{
		crm(acct_id: String!) {
			...
		}
	}
	```

- **get_contact**
	- Returns an array of contacts, which can be filtered by recId.
	- See schema browser for all fields.
	```
	query getContact {
		crm(acct_id: String!) {
			get_contact(filter: {
				recId: Int
			}) {
				recId
				FirstName
				LastName
				Email {
					EmailAddress
				}
			}
		}
	}
	```

## crm_mutation

For all mutations, a bearer token must be proved in Authorization header. To acquire your token, you must login first to get the token:
	```
	{
		auth {
			login(email: String!, password: String!) {
				success
				token
			}
		}
	}
	```

For all mutations, acct_id must be passed at the root.
	```
	{
		crm(acct_id: String!) {
			...
		}
	}
	```

- **set_contact**
	- Sets a contact, and returns the ID
	- See schema browser for all possible inputs.
	```
	mutation setContact {
		crm(acct_id: String!) {
			set_contact(input: {
				FirstName: "test",
				LastName: "user",
				Email: [
					{
						type: "contact",
						EmailAddress: "test@test.com"
					}
				]
			})
		}
	}
	```

---
_Source: https://npm.io/package/@simpleview/crm-client · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
