Skip to content

Instantly share code, notes, and snippets.

@katoen
Created May 25, 2020 20:13
Show Gist options
  • Save katoen/2bb2b39900517a3813826407ad027b96 to your computer and use it in GitHub Desktop.
Save katoen/2bb2b39900517a3813826407ad027b96 to your computer and use it in GitHub Desktop.
TOSHL Finance API Power BI - POST entries
/* POST TOSHL.com transaction in Power BI Power Query
https://developer.toshl.com/docs/entries/create/
all KEYS & IDs stored as parameters
*/ 
let
Source = Json.Document(
Web.Contents(
"https://api.toshl.com/entries"
[
Headers = [#"Content-Type" = "application/json", accept = "application/json", Authorization
= "Bearer " & TOSHLAPIKEY], 
// POST content
Content = Json.FromValue(
[
amount = "-30", 
account = TOSHLACCOUNT
currency = [code = "EUR"], 
date = "2020-05-25", 
category = "64130375"
]
)
]
)
)
in
Source
/* IMPORTANT NOTICE:
transactions gets created in TOSHL, but error is returned in Power Query
>> DataFormat.Error: We reached the end of the buffer.
Work in progress...
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment