DropMail

פרמיום
על ידי seriyps | מְעוּדכָּן 24 days ago | Email
פּוֹפּוּלָרִיוּת

9 / 10

חֶבִיוֹן

105ms

רמת שירות

100%

Health Check

N/A

חזרה לכל ההדרכות (2)

How to restore the access to email address I have been using earlier with cURL

Intro

First of all, you can only restore the access to the address that have been created by YOU earlier. You can’t get access to any random address, because they may belong to other users - all temporary addresses ever generated by DropMail are personal and unique! You should have a valid restore key in order to be able to restore the access. You can use restoration key that you get from “restore access” function on https://dropmail.me/ WEB interface as well as restore key you get via API.

Second - you can only restore access to the address, but not to the received emails. Emails are permanently removed from our server as soon as the session that received it had expired.

Third - address can be only attached to one session. If you would try to restore the address that is still active in any other session, it will return error.

You should already know how to get the access to the API.

Step 1: Create the original temporary mail address and save the access key

$ curl --request POST \
    --url https://dropmail.p.rapidapi.com/ \
    --header 'content-type: application/json' \
    --header 'x-rapidapi-host: dropmail.p.rapidapi.com' \
    --header "x-rapidapi-key: $RAPIDAPI_KEY" \
    --data '{"query":"mutation { introduceSession { id, expiresAt, addresses { address, restoreKey }}}"}'

{"data":{"introduceSession":{"id":"U2Vzc2lvbjpeKYsIk9NJ9TiHzV8Gu","expiresAt":"2021-03-23T23:30:50+00:00","addresses":[{"address":"example@dropmail.me", "restoreKey": "0f5f2c0ca2c3d1edf59728263570a33c1"}]}}}

Here 0f5f2c0ca2c3d1edf59728263570a33c1 is your access restoration key. You should store it together with your email address, so you can get the access later.

Step 2: Wait

Address can be attached to only one session at a time. You can’t restore the address while there is already some active session that uses this address. So, you need to wait for the original session to expire (normally about 10 minutes).

Step 3: Create a new session without address

Session can have multiple addresses attached to it, but if you only need your old address, it makes sense to not create a new one. So, here we are creating an empty session without any address:

$ curl --request POST \
    --url https://dropmail.p.rapidapi.com/ \
    --header 'content-type: application/json' \
    --header 'x-rapidapi-host: dropmail.p.rapidapi.com' \
    --header "x-rapidapi-key: $RAPIDAPI_KEY" \
    --data '{"query":"mutation {  introduceSession ( input: { withAddress: false }) { id, expiresAt }}"}'

{"data":{"introduceSession":{"id":"U2Vzc2lvbjpeKYawSe49NJ9TikE49Dfop","expiresAt":"2021-03-23T23:50:10+00:00"}}}

U2Vzc2lvbjpeKYawSe49NJ9TikE49Dfop is the ID of the new session.

Step 4: Restore the address

Here we are using restoreAddress operation with the new session ID from step 3, mail address and restore key from step 1:

$ curl --request POST \
    --url https://dropmail.p.rapidapi.com/ \
    --header 'content-type: application/json' \
    --header 'x-rapidapi-host: dropmail.p.rapidapi.com' \
    --header "x-rapidapi-key: $RAPIDAPI_KEY" \
    --data '{"query":"mutation restore($input: RestoreAddressInput!) {restoreAddress(input: $input) {address }}", "variables": {"input": {"sessionId": "U2Vzc2lvbjpeKYawSe49NJ9TikE49Dfop", "mailAddress": "example@dropmail.me", "restoreKey": "0f5f2c0ca2c3d1edf59728263570a33c1"}}}'

{"data":{"restoreAddress":{"address":"example@dropmail.me"}}}

Voila! example@dropmail.me can receive the mail again, it will arrive to the U2Vzc2lvbjpeKYawSe49NJ9TikE49Dfop session now!