Table of Contents:
Table of Contents minLevel 2
Code Examples
Add contact to List: PHP, C# and NodeJS examples
C# code example of how to add a contact to your Ongage List:
View file | ||||
---|---|---|---|---|
|
PHP code example of how to add a single contact to your Ongage List:
View file name Add_Contact_to_List.php height 250
NodeJS code example of how to add a single contact to your Ongage List
Code Block |
---|
const request = require('request-promise-native')const headers = { x_username: '*******', x_password:'********', x_account_code:'*********' } const listId = 1234 // Put List Id in which you want to create contact const createContact = async () => { const payload = { uri: `https://api.ongage.net/${listId}/api/v2/contacts/`, json: true, body: { email: 'test123@gmail.com', first_name: 'Test', last_name: 'Test' }, headers, method: "POST", resolveWithFullResponse: true } return request(payload) }createContact() .then((response) => { console.log(`Response : ${JSON.stringify(response)}`) }).catch((err) => { console.log(`Error : ${err}`) }) |
...