https://github.com/compwright/ongage
Ongage API Javascript Client
https://github.com/compwright/ongage
api email fetch nodejs ongage rest
Last synced: 10 months ago
JSON representation
Ongage API Javascript Client
- Host: GitHub
- URL: https://github.com/compwright/ongage
- Owner: compwright
- Created: 2021-04-29T00:15:54.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-08-12T23:20:30.000Z (over 1 year ago)
- Last Synced: 2024-12-30T03:33:46.893Z (12 months ago)
- Topics: api, email, fetch, nodejs, ongage, rest
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/ongage
- Size: 2.37 MB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# Ongage API Javascript Client
Works by composing fetch-compatible request objects.
## Installation
```
$ npm install ongage --save
```
## Usage
```js
import { ContactsApi } from 'ongage';
const contactsApi = new ContactsApi('username', 'password', 'account code');
const { url, ...req } = contactsApi.getByEmail('jonathon@compwright.com');
const res = await fetch(url, req);
const data = await res.json();
```
## API
### [ContactsApi](https://ongage.atlassian.net/wiki/spaces/HELP/pages/1004175381/Contacts+API+Methods)
* getById(id, listId)
* getByEmail(email, listId)
* getListsByEmail(email)
* create({ email, overwrite, fields }, listId)
* create([{ email, overwrite, fields }, { email, overwrite, fields }, ...], listId)
* update({ email, ...fields }, listId)
* update([{ email, ...fields }, { email, ...fields }, { email, ...fields }, ...], listId)
* delete({ contact_id }, listId)
* delete({ contact_ids }, listId)
* changeStatus({ emails, change_to, ocx_child_id, ocx_connection_id }, listId)
* changeEmail({ email, new_email }, listId)
### [ListsApi](https://ongage.atlassian.net/wiki/spaces/HELP/pages/1027965140/List+API+Methods)
* get(id)
* getAll({ name, type, sort, order, offset, limit })
* createExport({ list_id, name, segment_id, mailing_id, date_format, file_format, fields_selected, status })
* retrieveExport(id)
## License
MIT license