メインコンテンツへスキップ

2件の投稿件に「dev-tools」のタグが付いています

すべてのタグを表示

· 読了目安時間 2 分
Josh Hurley

After creating a new DoorDash Developer account, your next step is to explore the DoorDash Drive API. In order to communicate securely with DoorDash, your application must pass a JSON Web Token (JWT) to authenticate with our API. You’ll first want to create sandbox DoorDash Drive API credentials that will be used in generating a JWT. Many languages and frameworks provide libraries to create JWT for you. You can find examples for popular language in the step-by-step guide for creating a DoorDash JWT.

As you develop against the DoorDash Drive API, you can use the make-doordash-jwt CLI to generate a DoorDash JWT on Windows and Mac. When using Postman you use the DoorDash Postman Collection to create and send the JWT for each call.

You can learn more about the DoorDash JWT Format if your stack doesn’t support JWT creation, or if you’re looking to validate the output of your solution. Additionally, tools are available to you that illustrate the three parts of the DoorDash JWT in the JSFiddle JWT Sample and WinForms Sample App (for Windows users). A popular utility developers use to validate a JWT is the Auth0 JWT Debugger (check off the “secret base64 encoded” option when using the credentials provided by DoorDash. Please keep in mind that providing secrets on public websites carries a risk, and you should never expose your production credential secrets.

The DoorDash SDK Sample Application provides a prototype full stack solution with React and Node Express server that uses the Doordash SDK to communicate with the DoorDash Drive API. For developers that use WooCommerce, the JWT creation is provided in the plugin, the Get Started (WooCommerce Plugin) provides details on adding your credentials and configuring the plugin.

Please join our Discord community to share feedback and questions about the DoorDash JWT and getting started with DoorDash Drive!

· 読了目安時間 2 分
Brian Quach

Webhooks are a critical part of a successful on-demand delivery integration. They enable DoorDash to inform your integration about delivery updates, like when the Dasher has arrived at the pickup location or where they are along their route in real time. This real-time information lets you keep both the sender and receiver of the delivery up-to-date with precisely what’s happening.

It can be challenging to develop and test the part of your integration that receives and handles webhooks. How can you confirm that DoorDash sent a webhook that you were expecting to receive? How can you confirm that your application parsed the webhook details correctly?

We’re introducing Event Logs to answer exactly those kinds of questions. Event Logs is a new view in the Developer Portal that shows a history of all the webhooks sent to your integration. Each log includes the endpoint to which the webhook was sent, the HTTP response code DoorDash received from that endpoint, and the full body of the webhook that DoorDash sent. You can search for all the webhooks for a particular delivery ID or inspect all of the webhooks that were sent in a specific date range.

A screenshot of the Event Logs view in the Developer Portal

Enroute webhooks & other Drive API updates

Alongside the new Event Logs, we’ve also brought some new features to the Drive API:

  • enroute webhooks can now be enabled for your integration, so you can receive frequent updates on the Dasher’s location
  • The new dasher_allowed_vehicles field enables you to specify the transportation methods that a driverDasher can use to make the delivery: "car", "bicycle" and/or "walking"
  • You can use the items field to provide more detail about what’s in the delivery; this detail can be seen by Dashers as they’re making the deliveries and by the receiver of the delivery on the tracking page

Event Logs and all of these new features are ready to use today! Check out the Event Logs view in the Developer Portal, and see the Drive API docs for more details on the new Drive API features.