Created
May 10, 2018 18:58
-
-
Save chadwilken/eb7b07ddfb783681b7ca8060874357b3 to your computer and use it in GitHub Desktop.
Create project
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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