Skip to content

Instantly share code, notes, and snippets.

@chadwilken
Created May 10, 2018 18:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chadwilken/eb7b07ddfb783681b7ca8060874357b3 to your computer and use it in GitHub Desktop.
Save chadwilken/eb7b07ddfb783681b7ca8060874357b3 to your computer and use it in GitHub Desktop.
Create project
// project will be https://docs.companycam.com/#the-project-object
const project = await fetch ('https://api.companycam.com/v2/projects', {
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json',
'Authorization': 'Bearer {access_token},
'X-CompanyCam-User': '{user_email}',
'X-CompanyCam-Secret': '{application_secret}'
},
method: 'POST',
// Not entirely sure if you have to JSON.stringify when using fetch, this is all untested
body: JSON.stringify({
project: {
name: 'CompanyCam - 2883',
integration_relation_id: '{jnid}',
coordinates: {
lat: 40.815194,
lon: -96.709478
}
}
})
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment