---
title: "OAuth 2.0 | Tajo"
description: "Güvenli üçüncü taraf entegrasyonları için OAuth 2.0 kimlik doğrulaması"
url: https://tajo.io/tr/docs/authentication/oauth/
markdown: https://tajo.io/tr/docs/authentication/oauth.md
lang: tr-TR
author: "Set Noa"
author_url: https://tajo.io/tr/set-noa/
robots: noindex
---

Erken erişim talep edin

Adınızı ve iş e-posta adresinizi girin. Tajo erişim talebinizi onaylamanız için size bir bağlantı göndereceğiz.

# OAuth 2.0

[Set Noa](https://tajo.io/tr/set-noa/)

OAuth 2.0, kullanıcılar adına Brevo’ya erişen üçüncü taraf uygulamalar için güvenli, token tabanlı kimlik doğrulama sağlar.

## OAuth akışına genel bakış

1. **Yetkilendirme isteği**: Kullanıcıyı Brevo’ya yönlendirin
2. **Kullanıcı yetkilendirmesi**: Kullanıcı izinleri verir
3. **Yetkilendirme kodu**: Brevo bir kodla birlikte geri yönlendirir
4. **Erişim token’ı takası**: Kodu token’larla takas edin
5. **API erişimi**: İsteklerinizde erişim token’ını kullanın

## Yetkilendirme uç noktası

```
https://app.brevo.com/oauth/authorize?
  response_type=code&
  client_id=YOUR_CLIENT_ID&
  redirect_uri=YOUR_REDIRECT_URI&
  scope=email%20contacts&
  state=random_string
```

## Token takası

```bash
curl -X POST "https://api.brevo.com/v3/oauth/token" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "grant_type=authorization_code&code=AUTH_CODE&client_id=YOUR_CLIENT_ID&client_secret=YOUR_CLIENT_SECRET&redirect_uri=YOUR_REDIRECT_URI"
```

## Erişim token’ının kullanımı

```javascript
const response = await fetch('https://api.brevo.com/v3/account', {
  headers: {
    'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
    'Accept': 'application/json'
  }
});
```

## Kapsamlar

- `email`: İşlemsel e-posta gönderin
- `contacts`: Kişileri ve listeleri yönetin
- `campaigns`: Kampanya oluşturun ve gönderin
- `sms`: SMS mesajları gönderin
- `webhooks`: Webhook’ları yönetin

## Token yenileme

```javascript
const refreshToken = async () => {
  const response = await fetch('https://api.brevo.com/v3/oauth/token', {
    method: 'POST',
    headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
    body: new URLSearchParams({
      grant_type: 'refresh_token',
      refresh_token: 'YOUR_REFRESH_TOKEN',
      client_id: 'YOUR_CLIENT_ID',
      client_secret: 'YOUR_CLIENT_SECRET'
    })
  });
  return response.json();
};
```
