認証

Rememberizerは、ユーザーアカウントとセッションを管理するためのいくつかの認証エンドポイントを提供します。この文書では、利用可能な認証APIについて説明します。

サインアップ

例リクエスト

curl -X POST \
  https://api.rememberizer.ai/api/v1/auth/signup/ \
  -H "Content-Type: application/json" \
  -d '{
    "email": "[email protected]",
    "password": "secure_password",
    "name": "ジョン・ドー",
    "captcha": "recaptcha_response"
  }'

recaptcha_response を実際の reCAPTCHA 応答に置き換えてください。

サインイン

例リクエスト

curl -X POST \
  https://api.rememberizer.ai/api/v1/auth/signin/ \
  -H "Content-Type: application/json" \
  -d '{
    "login": "[email protected]",
    "password": "secure_password",
    "captcha": "recaptcha_response"
  }'

recaptcha_response を実際の reCAPTCHA 応答に置き換えてください。

メール確認

例リクエスト

curl -X POST \
  https://api.rememberizer.ai/api/v1/auth/verify-email/ \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "verification_code": "123456"
  }'

YOUR_JWT_TOKEN を実際のJWTトークンに置き換え、あなたのメールに送信された確認コードを使用してください。

トークン管理

例のリクエスト

curl -X POST \
  https://api.rememberizer.ai/api/v1/auth/custom-refresh/ \
  -b "refresh_token=YOUR_REFRESH_TOKEN"

このエンドポイントは認証のためにクッキーを使用します。リフレッシュトークンはクッキーとして送信する必要があります。

ログアウト

例のリクエスト

curl -X POST \
  https://api.rememberizer.ai/api/v1/auth/custom-logout/

このエンドポイントは認証クッキーをクリアします。

const logout = async () => {
  const response = await fetch('https://api.rememberizer.ai/api/v1/auth/custom-logout/', {
    method: 'POST',
    credentials: 'include' // これによりリクエストにクッキーが含まれます
  });
  
  if (response.status === 204) {
    console.log("ログアウト成功!");
  } else {
    console.error("ログアウト失敗!");
  }
};

logout();

このエンドポイントは認証のためにクッキーを使用します。アプリケーションがリクエストに資格情報を含めることを確認してください。

import requests

def logout():
    session = requests.Session()
    
    response = session.post(
        "https://api.rememberizer.ai/api/v1/auth/custom-logout/"
    )
    
    if response.status_code == 204:
        print("ログアウト成功!")
    else:
        print("ログアウト失敗!")

logout()

このエンドポイントは認証クッキーをクリアします。

{% endtabs %

Last updated