The Maildrop API is based on , which allows for an easy HTTP API integration with your codebase. The maildrop.cc website uses the Apollo GraphQL client to access the API, and this document will help show how to create raw HTTP requests or use the prebuilt Apollo Javascript library.
See Also
Quickstart - curl
curl --request POST \
--header 'content-type: application/json' \
--url https://api.maildrop.cc/graphql \
--data '{"query":"query Example {\n ping(message:\"hello, world!\")\n}"}'
should return
{"data":{"ping":"pong hello, world!"}}
The API is hosted at https://api.maildrop.cc/graphql and only accepts POST requests, and these requests must have a Content-Type header set to "application/json".
Quickstart - React
Install the Apollo React library into your project
You should see a page which returns the text "Return: pong Hello, world!". The Apollo library is extremely powerful, and takes care of the raw HTTP requests, authentication, caching, JSON parsing, and so on. It acts as a React hook, so as the request starts, the loading boolean automatically changes, triggering a re-render, and then when the data comes in for the request, another re-render is automatically done.
The ping resolver returns whatever message you send to it appended to the word "pong". Try it out! GraphQL queries can take a variable as an argument to the resolver, which is specified in the schema in step 2. That schema is the exact schema which maildrop.cc uses to access the API.