Created
December 2, 2020 12:00
-
-
Save zupzup/6187cfe905ca9e8f4b0f1464ab227304 to your computer and use it in GitHub Desktop.
Timeular Webhooks Events
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
#[derive(Deserialize, Debug)] | |
struct EventsResponse { | |
events: Vec<String>, | |
} | |
async fn fetch_events(token: &str) -> Result<Vec<String>, Error> { | |
let resp = CLIENT | |
.get(&url("/webhooks/event")) | |
.header("Authorization", auth(token)) | |
.send() | |
.await? | |
.json::<EventsResponse>() | |
.await?; | |
Ok(resp.events) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment