Create
Parameter | Type | Values / Description |
---|---|---|
firstName | string | |
lastName | string | |
email* | string | |
phone | string | Mobile phone number with country code. Example: +46701234567 |
comment | string | |
company | string | |
categoryIds | array of numbers | Attach categories to your contact. |
- JavaScript
- curl
const Confetti = require('confetti')
const confetti = new Confetti({ apiKey: 'your-key' })
const data = await confetti.contacts.create({
firstName: 'Foo',
lastName: 'Bar',
email: 'foo@bar.se',
phone: '+46700000000',
comment: 'Foo bar',
categoryIds: [1, 2],
company: 'Foo Bar AB',
})
curl -X POST "https://api.confetti.events/contacts"
-H "Content-Type: application/json"
-H "Authorization: apikey your-key"
-d '{
"data": {
"type": "contact",
"attributes": {
"firstName": "Foo",
"lastName": "Bar",
"email": "foo@bar.se",
"phone": "+46700000000",
"comment": "Foo bar",
"company": "Foo Bar AB",
},
"relationships": {
"categories": {
"data": [
{ "id": "1" },
{ "id": "2" }
]
}
}
}
}'