This example shows how Dapi's C# library could be used as a server endpoint to handle Dapi requests forwarded to it, using old .NET technologies.
The example shows a very basic server.
How to run it:
- Open the example in VisualStudio (or any equivalent IDE).
- Edit the
Controller/DapiSDKController.csfile to replace theYOUR_APP_SECRETconstant passed to theDapiAppconstructor, at the very start of the file, with you Dapi application'sAppSecret. - Run the example from VisualStudio.
- The server is now listening on: http://localhost:44395 (by default).
- The endpoint is now exposed on: http://localhost:43206/api/DapiSDK/HandleSDKRequestsAsync (by default).
- Use Postman (or any equivalent app), to POST valid Dapi requests to the endpoint
URL.- All requests' bodies should be in
JSONformat.
- All requests' bodies should be in
- All requests should pass the
Authorizationheader, with its value set to theaccessTokenas aBearertoken.- The
accessTokenis retrieved from the ExchangeToken process.
- The