npm.io
1.0.6 • Published 7 years ago

@simpleview/crm-client

Licence
MIT
Version
1.0.6
Deps
2
Size
11 kB
Vulns
25
Weekly
0

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"
                    }
                ]
            })
        }
    }