Skip to content

gdavidpb/google-app-script-xero-api

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

google-app-script-xero-api

Example Google Script to handle authentication and PUT to Xero.com's API

After quite a bit of research and piecing together a few resources I managed to create a simple 'just works' solution for connecting Google Apps Script (in my case from Sheets) to Xero.com's API.

If you've found yourself here, I hope this saves you some time 😇

Explanation

To get the code to work you need to input your CONSUMER_KEY and PEM_KEY where noted.

Note: I just needed a quick and dirty solution for this, I know the code can be vastly improved, if you have time feel free to submit a pull request.

code.gs

Is a pretty straightforward read, you need to change:

And it should 'just work'

jsrsasign.gs

Version 5.0.1 is specifically used as it doesn't use as many external dependencies as the newer versions.

Is used to read the PEM key from string then sign it to send through the oauth process

Puzzle Pieces

Code

Discussion

About

Example Google Script to handle authentication and PUT to Xero.com's API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%