const fetch = require('node-fetch');
let url = 'https://app.orbit.love/api/v1/orbit/activities';
let options = {
method: 'POST',
headers: {
Accept: 'application/json',
'Content-Type': 'application/json',
'Authorization: 'Bearer orbit-api-key'
},
body: JSON.stringify({
activity: {
description: 'Getting Started with the Orbit Model',
link: 'https://orbit-event.eventbrite.com/',
link_text: 'See the event',
title: 'Orbit Meetup Registration',
activity_type: 'eventbrite:registration',
occurred_at: '2020-05-10',
member: {
github: 'user-github',
email: 'user@email.com'
}
}
})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json));