This example shows how Dapi's C# library could be used as a server endpoint to handle Dapi requests forwarded to it.
The example shows a very basic server.
How to run it:
- Open the example in VisualStudio (or any equivalent IDE).
- Edit the
Startup.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:43206 (by default).
- Note: you can change the port of the server from the
Properties/lauchSettings.jsonfile, through theapplicationUrlfield(s).
- Note: you can change the port of the server from the
- The endpoint is now exposed on: http://localhost:43206/DapiSDKRequests (by default).
- Note: you can change the endpoint name from the
Properties/lauchSettings.jsonfile, through thelaunchUrlfield(s).
- Note: you can change the endpoint name from the
- 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