Created
March 6, 2019 13:59
-
-
Save pizzacat83/3a5b575f48dccc2e8943f570bc49d1db to your computer and use it in GitHub Desktop.
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
const creds = { | |
token: properties.getProperty('trello-token'), | |
key: properties.getProperty('trello-key') | |
}; | |
export const request = ( | |
endpoint: string, | |
options?: GoogleAppsScript.URL_Fetch.URLFetchRequestOptions, | |
params?: any | |
) => { | |
const res = UrlFetchApp.fetch( | |
'https://api.trello.com/1/' + endpoint + queryString(Object.assign({ ...creds }, params)), | |
options | |
); | |
const text = res.getContentText(); | |
return JSON.parse(text); | |
}; |
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
import * as Trello from './trello'; | |
Trello.request('cards', { method: 'post' }, { name: 'hoge' }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment