This sample is an example of how to create a JWT using Kotlin when calling the DoorDash API. Additionally, it creates a delivery request using the JWT.
It builds a token that is valid for 30 minutes. Please obtain a set of DoorDash Credentials (Developer ID, Key ID, and Signing Secret) in the DoorDash Developer Portal to use in the application.
This application was built using Kotlin version 1.8.10, Amazon Corretto 17 JDK, and Gradle 8.0.1. The code source and build files provided in this repository are samples and not intended for production, and are not supported.
This sample uses an IntelliJ IDEA project. You may use different IDE, but this sample is configured for IntelliJ IDEA. If using a different IDE, the source you'll want to copy is in Main.kt.
Note, if you are building a new project, you'll need to make sure the jvmToolchain
parameter is targeting at least version 11 in the build.gradle/build.gradle.kts
. In this sample project, it targets version 17:
kotlin {
jvmToolchain(17)
}
Follow these steps to run the sample app:
- Clone repository locally.
- Open the project located in the
source/DoorDashAPIKotlinSample
folder with IntelliJ IDEA. - Open Main.kt in the editor and resolve all TODO items listed in comments, save changes.
- Build and run the application.
- auth0 JWT Debugger
- DoorDash API JWT JSFiddle Sample
- make-doordash-jwt CLI
- DoorDash API get started with Postman
- DoorDash SDK Example Application
Please join the DoorDash Developer Discord community to provide feedback and ask questions about developing with the DoorDash API.