Has anyone been playing around with the Google Scripts?
I would like to yet dont seem to be haveing much joy.
I have had a look on github and am still floundering... Help with setting up the connection of this app to the Simpro API would be appriciated.
https://script.google.com
Google Scripts
Forum rules
- Check the documentation first. Before posting questions, please check the documentation to ensure it doesn't already cover what you need.
- No spam. All automated messages, advertisements, and links to competitor websites will be deleted immediately.
- Post in relevant sub-forums only. Messages posted in the wrong topic area will be removed and placed in the correct sub-forum by moderators.
- Respect other users. No flaming or abusing fellow forum members. Users who continue to post inflammatory, abusive comments will be deleted from the forum after two warnings are issued by moderators.
- Harassment. No threats or harassment of other users will be tolerated. Any instance of threatening or harassing behavior is grounds for deletion from the forums.
- Adult content. No profanity or pornography is allowed. Posts containing adult material will be deleted.
- Bandwidth. All images and signatures must be 500 x 500 pixels or smaller. Posts containing over-sized images and signatures will be removed.
- Illegal content. No re-posting of copyrighted materials or other illegal content is allowed. Any posts containing illegal content or copyrighted materials will be deleted.
-
garyapotter
- Posts: 4
- Joined: Sun Nov 11, 2018 11:54 am
Re: Google Scripts
Hi Gary,
I've managed to get a google script working in Google Sheets. Had some trouble initially with the api authentication this is what worked for me in the end.
It seems you have to use as well as for it to work. This was using API-Key, obviously replace the Bearer token with your own.
I've managed to get a google script working in Google Sheets. Had some trouble initially with the api authentication this is what worked for me in the end.
Code: Select all
var options = {
"headers": {
"Authorization":"Bearer 8f7aef2a1e4287d763f333xxxxxxxxxxxxxxxxx",
"Content-Type":"application/json",
"Accept": "application/json"
},
"muteHttpExceptions" : true
};Code: Select all
AcceptCode: Select all
Content-TypeDokkit
https://www.dokkit.co.uk
https://www.dokkit.co.uk
-
garyapotter
- Posts: 4
- Joined: Sun Nov 11, 2018 11:54 am
Re: Google Scripts
Michelle,
Your reply really helped, thank you.
I am not too sure what ( "muteHttpExceptions" : true ) means as yet though this code is what got me started. If someone want to add it github that would be great.
Regards,
Gary
Your reply really helped, thank you.
I am not too sure what ( "muteHttpExceptions" : true ) means as yet though this code is what got me started. If someone want to add it github that would be great.
Regards,
Gary
Code: Select all
function run() {
var url = 'https://BULDNAME.simprosuite.com/api/v1.0/companies/X/jobs/XXXXX';
var response = UrlFetchApp.fetch(url, {
"headers": {
"Authorization":"Bearer 5af829ccXXXXXXXXXXXXXXXXXXXXXXb6343f",
"Content-Type":"application/json",
"Accept": "application/json"
}
});
var result=JSON.parse(response);
Logger.log(result)
}
DEVELOPER CENTER