Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Can't connect to API that uses POST (Dropbox)

Hi, I am trying to connect to the dropbox API but keep getting a 404 error. The documentation gives me this example, whcih works well in command promt:

curl -X POST https://api.dropboxapi.com/2/team_log/get_events \
    --header "Authorization: Bearer <Hidden access token>" \
    --header "Content-Type: application/json" \
    --data "{\"limit\": 50,\"category\": \"groups\"}"

I then tried making this work in power query with the following code:

 

 

 

let
  access = "Bearer <Hidden Access Token>",
  Source = Json.Document(Web.Contents("https://api.dropboxapi.com/2/team_log/get_events",[Query=[limit="50"],Headers=[#"Content-Type"="application/json",Authorization=access]]))
in
  Source

 

 

 

 I think the problem is that the API used POST but Web.Contents defaults to GET. I couldnt find any helpful information anywhere to tell me how to use POST