Dokimantasyon API

GPTMail API

Sèvi ak API GPTMail la pou kreye bwat resepsyon tanporè, fè lis mesaj yo, li yo epi efase imèl atravè HTTPS ak yon antèt X-API-Key. Li bon pou tès otomatik, pipeline CI/CD ak pwosesis QA.

Kijan pou jwenn yon API Key

Buy API requests

Purchase API requests with GPTMail points. Earn points through daily check-ins and public domains, or buy points with LDC at a 1:1 rate.

Buy with points / add requests

Opsyon 2: Ajoute pwòp domèn ou

Lè yon domèn piblik pase verifikasyon MX: soumèt san konekte → kle API (20000 demann); soumèt pandan ou konekte → 200 pwen. Chak domèn resevwa yon sèl rekonpans. Enpòtan: yon fwa li konekte, sifiks domèn sa a vin yon sifiks piblik pou tout itilizatè sit la, kidonk lòt itilizatè ka kreye adrès bwat resepsyon anba l tou. Apre aktivasyon, pa efase, pa ranplase epi pa modifye anrejistreman MX ki dirije domèn sa a sou sèvis nou an. Sinon, verifikasyon ki vin apre yo ka konsidere domèn nan mal konfigire. Si yon verifikasyon pita jwenn anrejistreman MX la pa valab, yo ap dezaktive domèn nan. Si anrejistreman MX la rete pa valab pandan 3 verifikasyon youn dèyè lòt, yo ap dezaktive kle API ki asosye a tou. Si anrejistreman MX la vin valab ankò pita, domèn nan ap reaktive otomatikman.

Domèn

Kle piblik pou tès

Pou fè tès, voye kle piblik pataje ki parèt anba a nan antèt X-API-Key la. Li chanje chak jou epi li gen yon limit 200,000 demann pa jou ke tout itilizatè yo pataje.

Rete jodi a

Reyinisyalize nan

Ap chaje quota an dirèk pou kle piblik la...

Referans API anba a ka kopye kòm Markdown pou zouti AI, baz konesans, oswa yon README.

Adrès bès: https://mail.chatgpt.org.uk

AI
llms.txt

·

llms-full.txt

(Markdown)

Kòmanse rapid

  • X-API-Key: YOUR_KEY se opsyon ki pi senp lan. Pou tès rapid, sèvi ak kle piblik chak jou ki parèt anlè a olye YOUR_KEY.

  • Pifò pwen bwat mande yon paramèt email, pa egzanp ?email=demo@example.com.

  • Repons API GPTMail yo sèvi ak JSON ak chan success, data ak error, plis usage lè ou sèvi ak yon kle API. Erè Cloudflare, tankou repons limit frekans, ka retounen HTML pito. Tcheke estati HTTP ak Content-Type anvan ou analize JSON.

  • Si ou deja konnen yon domèn ki sipòte sou sit sa a, ou pa oblije rele pwen kreyasyon imèl la anvan. Ou ka konpoze prefix@domain lokalman epi rele API bwat la dirèkteman, sa ki ekonomize yon demann API.

Limit frekans ak nouvo tantativ

  • GET ak POST /api/generate-email pataje yon limit 30 demann chak 10 segonn pou chak IP sous. Sa aplike pou kle API piblik ak pèsonèl. Diferan kle ak kliyan ki sèvi ak menm IP a pataje limit sa a.

  • Lè limit la depase, sistèm nan retounen HTTP 429 epi li bloke jenerasyon adrès imel pandan 10 segonn. Tann dire Retry-After endike a anvan ou eseye ankò. Si antèt sa a pa la, tann omwen 10 segonn epi ogmante tan ant tantativ yo. Evite tantativ an menm tan nan kliyan ki pataje yon IP.

  • Règ sa a pa aplike pou lis mesaj nan bwat resepsyon ni pou lekti yon imel endividyèl. Kota chak jou ak kota total kle API a toujou aplike apa. Tann 10 segonn pa retabli yon kota kle ki fin itilize.

Pwen prensipal yo

POST / GET
/api/generate-email

Kreye yon bwat imèl tanporè. Itilize GET pou pi senp flux o aza, oswa POST ak prefix ak domain lè ou vle kontwòl klè.

GET
/api/emails?email=...

Rekipere imèl yo pou bwat la.

GET
/api/email/{id}?email=...

Rekipere yon sèl imèl, ki gen tèks, HTML, antèt bò, ak metadata.

DELETE
/api/email/{id}?email=...

Efase yon imèl pa ID.

DELETE
/api/emails/clear?email=...

Efase tout imèl yo nan bwat la.

GET
/api/stats

Li estatistik sit entè a.

Egzanp flux

Anba a gen de modèl komen: kite sèvis la kreye yon bwat, oswa mande yon prefix fiks. Si ou deja konnen yon domèn ki sipòte kounye a, ou ka konpoze bwat la lokalman epi mande dirèkteman.

1) Jenere yon adrès imèl tanporè o aza

curl 'https://mail.chatgpt.org.uk/api/generate-email' \
  -H 'X-API-Key: PUBLIC_API_KEY'
Egzanp repons
{
  "success": true,
  "data": {
    "email": "a3f9c2b1@example.com"
  },
  "usage": {
    "daily_limit": 200000,
    "used_today": 1,
    "remaining_today": 199999,
    "total_limit": 200000,
    "total_usage": 1,
    "remaining_total": 199999
  }
}

2) Jenere ak yon prefix fiks (egz. demo@example.com)

curl -X POST 'https://mail.chatgpt.org.uk/api/generate-email' \
  -H 'Content-Type: application/json' \
  -H 'X-API-Key: PUBLIC_API_KEY' \
  -d '{"prefix":"demo"}'
Egzanp repons
{
  "success": true,
  "data": {
    "email": "demo@example.com"
  },
  "usage": {
    "daily_limit": 200000,
    "used_today": 2,
    "remaining_today": 199998
  }
}

3) Lis imèl nan yon bwat resepsyon

Si ou deja konnen yon domèn ki sipòte, sote etap 1 epi mande dirèkteman.

curl 'https://mail.chatgpt.org.uk/api/emails?email=demo@example.com' \
  -H 'X-API-Key: PUBLIC_API_KEY'
Egzanp repons
{
  "success": true,
  "data": {
    "emails": [
      {
        "id": "e5a7f3...",
        "email_address": "demo@example.com",
        "from_address": "noreply@github.com",
        "subject": "Your code: 654321",
        "content": "Your verification code is 654321",
        "html_content": "...",
        "has_html": true,
        "timestamp": 1709654321,
        "created_at": "2024-03-05T12:18:41Z"
      }
    ],
    "count": 1
  }
}

4) Li yon sèl imèl — gen tèks plen, kò HTML, ak metadata

Ranplase EMAIL_ID ak yon id etap 3 retounen. Voye adrès bwat resepsyon an tou kòm email (menm pou efase ak telechaje atachman): konsa yo li imèl la dirèkteman nan bwat resepsyon li olye pou yo chèche l pa ID. Avèk yon kle API, paramèt email la opsyonèl, men si w voye l rechèch la ap pi rapid.

curl 'https://mail.chatgpt.org.uk/api/email/EMAIL_ID?email=demo@example.com' \
  -H 'X-API-Key: PUBLIC_API_KEY'
Egzanp repons
{
  "success": true,
  "data": {
    "id": "e5a7f3...",
    "email_address": "demo@example.com",
    "from_address": "noreply@github.com",
    "subject": "Your code: 654321",
    "content": "Your verification code is 654321",
    "html_content": "<p>Your code is 654321</p>",
    "has_html": true,
    "timestamp": 1709654321,
    "raw_size": 2048,
    "created_at": "2024-03-05T12:18:41Z"
  }
}

5) Efase yon sèl imèl pa ID

Avèk yon kle API, paramèt email la opsyonèl, men si w voye l rechèch la ap pi rapid.

curl -X DELETE 'https://mail.chatgpt.org.uk/api/email/EMAIL_ID?email=demo@example.com' \
  -H 'X-API-Key: PUBLIC_API_KEY'
Egzanp repons
{
  "success": true,
  "data": {
    "message": "Email deleted"
  }
}

6) Vide tout bwat la — efase tout imèl pou adrès sa a

Chak apèl efase yon pakèt. Toutotan repons lan gen "has_more": true, rele l ankò jiskaske li retounen false.

curl -X DELETE 'https://mail.chatgpt.org.uk/api/emails/clear?email=demo@example.com' \
  -H 'X-API-Key: PUBLIC_API_KEY'
Egzanp repons
{
  "success": true,
  "data": {
    "message": "Deleted 3 emails",
    "count": 3,
    "has_more": false
  }
}

Fòm repons

Repons ki reyisi anjeneral sanble konsa. Si ou otantifye ak yon API Key, atansyon ak enfòmasyon quota andedan usage.

{
  "success": true,
  "data": {
    "email": "demo@example.com"
  },
  "usage": {
    "daily_limit": 200000,
    "used_today": 1,
    "remaining_today": 199999,
    "total_limit": 200000,
    "total_usage": 1,
    "remaining_total": 199999
  }
}

Estatistik elaji

  • /api/statistics/24h retounen yon fenèt distribisyon pa èdtan ki dire 24 èdtan; sèvi ak offset=1,2,... pou fenèt ki pi ansyen yo.
  • /api/statistics/top-subjects retounen sijè imèl ki parèt pi souvan yo.
  • /api/statistics/top-domains retounen domèn ki pi aktif yo.
  • /api/statistics/top-senders retounen moun ki pi aktif k ap voye yo.
GPTMail