# Authentication Token Refresh Operation Source: https://api-docs.tarla.io/api-reference/authentication-service/authentication-token-refresh-operation en/open-api/auth-version-1.json post /v1/auth/refresh When the Authentication Token expires, it is renewed using the refresh token # Login Operation Source: https://api-docs.tarla.io/api-reference/authentication-service/login-operation en/open-api/auth-version-1.json post /v1/auth/login Login Operations are Made With Username And Password # Logout Operation Source: https://api-docs.tarla.io/api-reference/authentication-service/logout-operation en/open-api/auth-version-1.json post /v1/auth/logout Logout Operations Puts JWT In Blacklist # New User Registration Source: https://api-docs.tarla.io/api-reference/authentication-service/new-user-registration en/open-api/auth-version-1.json post /v1/auth/register New User Registration is Made # Abonelik Planını Güncelle Source: https://api-docs.tarla.io/api-reference/kullanıcı-hesapları-servisi/abonelik-planını-güncelle tr/open-api/accounts-version-1.json post /v1/accounts/update-subscription Hesabın abonelik planını verilen bilgilerle günceller. # Hesabı Aktive Et Source: https://api-docs.tarla.io/api-reference/kullanıcı-hesapları-servisi/hesabı-aktive-et tr/open-api/accounts-version-1.json get /v1/accounts/activate-account Kullanıcı ID, hesap ID ve e-posta doğrulama anahtarı ile hesabı aktive eder. # Hesap Aktivasyonu Talebi Source: https://api-docs.tarla.io/api-reference/kullanıcı-hesapları-servisi/hesap-aktivasyonu-talebi tr/open-api/accounts-version-1.json post /v1/accounts/account-activation-request Kullanıcıya aktivasyon e-postası göndererek hesap aktivasyon sürecini başlatır. # Hesap Bilgilerini Getir Source: https://api-docs.tarla.io/api-reference/kullanıcı-hesapları-servisi/hesap-bilgilerini-getir tr/open-api/accounts-version-1.json get /v1/accounts/{userId} Belirtilen kullanıcı ID'sine ait hesap detaylarını getirir. # Hesap Güncelle Source: https://api-docs.tarla.io/api-reference/kullanıcı-hesapları-servisi/hesap-güncelle tr/open-api/accounts-version-1.json patch /v1/accounts/update Hesap bilgilerini (e-posta, telefon veya diğer alanlar) günceller. # Hesap Oluştur Source: https://api-docs.tarla.io/api-reference/kullanıcı-hesapları-servisi/hesap-oluştur tr/open-api/accounts-version-1.json post /v1/accounts/create Girilen bilgilerle yeni bir hesap oluşturur. # Telefon Aktivasyon Talebi Source: https://api-docs.tarla.io/api-reference/kullanıcı-hesapları-servisi/telefon-aktivasyon-talebi tr/open-api/accounts-version-1.json post /v1/accounts/phone-number-activation-request Kullanıcının telefonuna doğrulama kodu göndererek telefon aktivasyon sürecini başlatır. # Telefon Numarasını Aktive Et Source: https://api-docs.tarla.io/api-reference/kullanıcı-hesapları-servisi/telefon-numarasını-aktive-et tr/open-api/accounts-version-1.json get /v1/accounts/activate-phone-number Kullanıcı ID, hesap ID ve telefon doğrulama anahtarı ile telefon numarasını aktive eder. # Kendi Kullanıcı Bilgilerini Getir İşlemi Source: https://api-docs.tarla.io/api-reference/kullanıcı-servisi/kendi-kullanıcı-bilgilerini-getir-i̇şlemi tr/open-api/auth-version-1.json get /v1/users/me Herhangi Bir Belirteç Vermeden Sadece İstek Yapanın Keni Kullanıcı Detaylarını Getirir # Kullanıcı Engelini Kaldırma İşlemi Source: https://api-docs.tarla.io/api-reference/kullanıcı-servisi/kullanıcı-engelini-kaldırma-i̇şlemi tr/open-api/auth-version-1.json get /v1/users/unblock/{userId} Sadece ADMIN Rölüne Sahip Kullanıcılar Tarafından Kullanılabilir. Brute-Force Atağı Şeklinde Yetkisiz Giriş Denemesi Sayısını Aşan Kullanıcı Kalıcı Olarak Engellenir. Bu Engellemenin Kaldırılması İçin Kullanılan İşlemdir. # Kullanıcı Getir İşlemi Source: https://api-docs.tarla.io/api-reference/kullanıcı-servisi/kullanıcı-getir-i̇şlemi tr/open-api/auth-version-1.json get /v1/users/{userId} Sadece POWER_USER ve Üstü Role Sahip Kullanıcılar Tarafından Kullanılabilir. Verilen Kullanıcı Kimlik Belirteci İle Kullanıcı Detaylarını Getirir # Kullanıcı Güncelleme İşlemi Source: https://api-docs.tarla.io/api-reference/kullanıcı-servisi/kullanıcı-güncelleme-i̇şlemi tr/open-api/auth-version-1.json patch /v1/users/update Sadece ADMIN Rolüne Sahip Kullanıcıların Rol, Durum ve Şifre Güncelleyebildiği, Sadece POWER_USER ve Daha Üst Role Sahip Kullanıcılar ile İstekte Bulunan Kendi Kullanıcının Kullanıcı Adını Değiştirebildiği, Diğer Kullanıcı Rollerine Sahip Kullanıcıların Kalan Diğer Alanları Güncelleyebildiği Bir İşlemdir. # Sayfalanabilir Kullanıcı Listeleme İşlemi Source: https://api-docs.tarla.io/api-reference/kullanıcı-servisi/sayfalanabilir-kullanıcı-listeleme-i̇şlemi tr/open-api/auth-version-1.json post /v1/users/page Sadece ADMIN Rölüne Sahip Kullanıcılar Tarafından Kullanılabilir. Sistemdeki Kayıtlı Kullanıcıları Verilen Filtre ve Sıralama Seçeneklerine Göre Sayfalanabilir Olarak Getirir # Yeni Kullanıcı Oluşturma İşlemi Source: https://api-docs.tarla.io/api-reference/kullanıcı-servisi/yeni-kullanıcı-oluşturma-i̇şlemi tr/open-api/auth-version-1.json post /v1/users/create Sadece ADMIN Rölüne Sahip Kullanıcılar Tarafından Kullanılabilir. Detayları Verilen Yeni Kullanıcı Kaydını Oluşturur. Şifre Alanı Boş Bırakılırsa 12 Alfa Nümerik Karakterli Rastgele Bir Şifre Oluşturulur. Kullanıcı Oluşturulduktan Sonra İlgili Kullanıcının Email Adresine (Kullanıcı Adı) Hoş Geldiniz E-Postası Gönderilir. Şifre Bilgileri Bu E-Postanın İçinde Mevcuttur. # Şifre Değiştirme İşlemi Source: https://api-docs.tarla.io/api-reference/kullanıcı-servisi/şifre-değiştirme-i̇şlemi tr/open-api/auth-version-1.json post /v1/users/change-password Kullanıcının Kendi Şifresini Değiştirmesini Sağlayan İşlem. Bir Kullanıcı Başka Bir Kullanıcının Şifresini Bu İşlem Üzerinden Değiştiremez! # Şifre Sıfırlama İsteği Yapılan İşlem Source: https://api-docs.tarla.io/api-reference/kullanıcı-servisi/şifre-sıfırlama-i̇steği-yapılan-i̇şlem tr/open-api/auth-version-1.json post /v1/users/password-reset-request Şifresini Unutan Kullanıcıların Şifre Sırıflramasını Talebini Alan İşlemdir. Bir Kullanıcı İçin Belirli Bir Periyot İçinde Şifre Sıfırlama Talebine Sınır Uygulanır. Bu Sınır Aşıldığında Tekrar Email Gönderilmez ve Hata Mesajı Döner. # Şifre Sıfırlama İşlemi Source: https://api-docs.tarla.io/api-reference/kullanıcı-servisi/şifre-sıfırlama-i̇şlemi tr/open-api/auth-version-1.json post /v1/users/password-reset Şifre Sıfırlama İsteği Sırasında Gönderilen # ID ile Tek İstasyon Bul Source: https://api-docs.tarla.io/api-reference/mgm-i̇stasyon-verileri-apisi/id-ile-tek-i̇stasyon-bul tr/open-api/mgm-stations-v1.json get /v1/mgm-stations/by/id/{stationId} # İlleri Listele Source: https://api-docs.tarla.io/api-reference/mgm-i̇stasyon-verileri-apisi/i̇lleri-listele tr/open-api/mgm-stations-v1.json get /v1/mgm-stations/get-cities # İlçe ve Bölgeye Göre İstasyonları Bul Source: https://api-docs.tarla.io/api-reference/mgm-i̇stasyon-verileri-apisi/i̇lçe-ve-bölgeye-göre-i̇stasyonları-bul tr/open-api/mgm-stations-v1.json post /v1/mgm-stations/by/city-district # İsim Örüntüsüne Göre İstasyon Bul Source: https://api-docs.tarla.io/api-reference/mgm-i̇stasyon-verileri-apisi/i̇sim-örüntüsüne-göre-i̇stasyon-bul tr/open-api/mgm-stations-v1.json post /v1/mgm-stations/by/name # İstasyonları sayfalı olarak lister Source: https://api-docs.tarla.io/api-reference/mgm-i̇stasyon-verileri-apisi/i̇stasyonları-sayfalı-olarak-lister tr/open-api/mgm-stations-v1.json get /v1/mgm-stations/page/{pageNumber}/size/{pageSize} # Sayfalı Olarak Veri Günlüklerini Bul Source: https://api-docs.tarla.io/api-reference/mgm-i̇stasyon-verileri-apisi/sayfalı-olarak-veri-günlüklerini-bul tr/open-api/mgm-stations-v1.json post /v1/mgm-stations/get-data-logs # Verilen İlin İlçelerini Listele Source: https://api-docs.tarla.io/api-reference/mgm-i̇stasyon-verileri-apisi/verilen-i̇lin-i̇lçelerini-listele tr/open-api/mgm-stations-v1.json get /v1/mgm-stations/get-districts-of/{city} Belirli bir ilin ilçelerinin listesini alın. Türkçe karakterler içeren il adları için URL kodlamasını kullanmayı unutmayın. # Find Paged Data Logs Source: https://api-docs.tarla.io/api-reference/mgm-stations-data-api/find-paged-data-logs en/open-api/mgm-stations-v1.json post /v1/mgm-stations/get-data-logs # Find Single Station By ID Source: https://api-docs.tarla.io/api-reference/mgm-stations-data-api/find-single-station-by-id en/open-api/mgm-stations-v1.json get /v1/mgm-stations/by/id/{stationId} # Find Stations By City and District Source: https://api-docs.tarla.io/api-reference/mgm-stations-data-api/find-stations-by-city-and-district en/open-api/mgm-stations-v1.json post /v1/mgm-stations/by/city-district # Find Stations By Name Pattern Source: https://api-docs.tarla.io/api-reference/mgm-stations-data-api/find-stations-by-name-pattern en/open-api/mgm-stations-v1.json post /v1/mgm-stations/by/name # Get Cities Source: https://api-docs.tarla.io/api-reference/mgm-stations-data-api/get-cities en/open-api/mgm-stations-v1.json get /v1/mgm-stations/get-cities # Get Districts of Given City Source: https://api-docs.tarla.io/api-reference/mgm-stations-data-api/get-districts-of-given-city en/open-api/mgm-stations-v1.json get /v1/mgm-stations/get-districts-of/{city} Get the list of districts of a given city. Remember to use URL encoding for the city name having Turkish characters. # Lists stations paged Source: https://api-docs.tarla.io/api-reference/mgm-stations-data-api/lists-stations-paged en/open-api/mgm-stations-v1.json get /v1/mgm-stations/page/{pageNumber}/size/{pageSize} # Activate Account Source: https://api-docs.tarla.io/api-reference/user-accounts-service/activate-account en/open-api/accounts-version-1.json get /v1/accounts/activate-account Activates the account using user ID, account ID, and email verification token. # Activate Phone Number Source: https://api-docs.tarla.io/api-reference/user-accounts-service/activate-phone-number en/open-api/accounts-version-1.json get /v1/accounts/activate-phone-number Activates the user's phone number using user ID, account ID, and phone verification token. # Create Account Source: https://api-docs.tarla.io/api-reference/user-accounts-service/create-account en/open-api/accounts-version-1.json post /v1/accounts/create Creates a new account with the provided details. # Get Account Details Source: https://api-docs.tarla.io/api-reference/user-accounts-service/get-account-details en/open-api/accounts-version-1.json get /v1/accounts/{userId} Retrieves detailed information of the account associated with the specified user ID. # Request Account Activation Source: https://api-docs.tarla.io/api-reference/user-accounts-service/request-account-activation en/open-api/accounts-version-1.json post /v1/accounts/account-activation-request Initiates the process of account activation by sending an activation email to the user. # Request Phone Number Activation Source: https://api-docs.tarla.io/api-reference/user-accounts-service/request-phone-number-activation en/open-api/accounts-version-1.json post /v1/accounts/phone-number-activation-request Starts the phone number activation process by sending a verification code to the user's phone. # Update Account Source: https://api-docs.tarla.io/api-reference/user-accounts-service/update-account en/open-api/accounts-version-1.json patch /v1/accounts/update Updates account information such as email, phone, or other attributes. # Update Subscription Plan Source: https://api-docs.tarla.io/api-reference/user-accounts-service/update-subscription-plan en/open-api/accounts-version-1.json post /v1/accounts/update-subscription Updates the account's subscription plan with the provided details. # Change Password Operation Source: https://api-docs.tarla.io/api-reference/user-service/change-password-operation en/open-api/auth-version-1.json post /v1/users/change-password The operation that allows a user to change their own password. A user cannot change another user's password through this operation! # Get Own User Information Operation Source: https://api-docs.tarla.io/api-reference/user-service/get-own-user-information-operation en/open-api/auth-version-1.json get /v1/users/me Retrieves only the requester's own user details without providing any token # Get User Operation Source: https://api-docs.tarla.io/api-reference/user-service/get-user-operation en/open-api/auth-version-1.json get /v1/users/{userId} Can only be used by users with POWER_USER and higher roles. Retrieves user details with the given user identifier # New User Creation Operation Source: https://api-docs.tarla.io/api-reference/user-service/new-user-creation-operation en/open-api/auth-version-1.json post /v1/users/create Can only be used by users with the ADMIN role. Creates a new user record with the provided details. If the password field is left blank, a random password of 12 alphanumeric characters is generated. After the user is created, a welcome email is sent to the relevant user's email address (username). Password information is included in this email. # Pageable User Listing Operation Source: https://api-docs.tarla.io/api-reference/user-service/pageable-user-listing-operation en/open-api/auth-version-1.json post /v1/users/page Can only be used by users with the ADMIN role. Retrieves registered users in the system pageably according to the given filter and sorting options # Password Reset Operation Source: https://api-docs.tarla.io/api-reference/user-service/password-reset-operation en/open-api/auth-version-1.json post /v1/users/password-reset Sent during the password reset request # Password Reset Request Operation Source: https://api-docs.tarla.io/api-reference/user-service/password-reset-request-operation en/open-api/auth-version-1.json post /v1/users/password-reset-request This is the operation that receives the password reset request from users who have forgotten their password. A limit is applied to the password reset request for a user within a certain period. When this limit is exceeded, an email is not sent again and an error message is returned. # User Unblocking Operation Source: https://api-docs.tarla.io/api-reference/user-service/user-unblocking-operation en/open-api/auth-version-1.json get /v1/users/unblock/{userId} Can only be used by users with the ADMIN role. A user who exceeds the number of unauthorized login attempts in the form of a brute-force attack is permanently blocked. This is the operation used to remove this block. # User Update Operation Source: https://api-docs.tarla.io/api-reference/user-service/user-update-operation en/open-api/auth-version-1.json patch /v1/users/update An operation where only users with the ADMIN role can update roles, status, and password; only users with POWER_USER and higher roles, along with the requesting user themselves, can change the username; and users with other roles can update the remaining fields. # Giriş İşlemi Source: https://api-docs.tarla.io/api-reference/yetklilendirme-servisi/giriş-i̇şlemi tr/open-api/auth-version-1.json post /v1/auth/login Kullanıcı Adı ve Şifre İle Giriş Yapılır # Yeni Kullanıcı Kaydı Source: https://api-docs.tarla.io/api-reference/yetklilendirme-servisi/yeni-kullanıcı-kaydı tr/open-api/auth-version-1.json post /v1/auth/register Yeni Kullanıcı Kaydı Yapılır # Yetki Belirteci Yenileme İşlemi Source: https://api-docs.tarla.io/api-reference/yetklilendirme-servisi/yetki-belirteci-yenileme-i̇şlemi tr/open-api/auth-version-1.json post /v1/auth/refresh Yetki Belirtecinin Süresi Dolduğunda Yenileme Belirteci Kullanılarak Yetki Belirteci Yenilenir # Çıkış İşlemi Source: https://api-docs.tarla.io/api-reference/yetklilendirme-servisi/çıkış-i̇şlemi tr/open-api/auth-version-1.json post /v1/auth/logout Çıkış İşlemi Kimlik Doğrulama Belirtecini Kara Listeye Alır # Authentication Source: https://api-docs.tarla.io/en/api-reference/authentication Authentication guarantees privacy of API Services by authenticating users. Authentication requires users to log in before accessing iklim.co API Services. This guide covers setup for each available handshake method. All authorized endpoints require `Authorization: Bearer ` header in request!
Otherwise API client will receive an error message with status `401 - Unauthorized`
Example Header: ```ini theme={null} Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJtdXJhdG96ZGVtaXJAdGFybGEuaW8iLCJ1c2VySWQiOiJjOGI1OTQwZS01M2QyLTQwZGYtYTg4Yi0xMTBjODYxNTVjZmEiLCJyb2xlcyI6WyJBUElfVVNFUiIsIkFETUlOIl0sImxvY2FsZSI6InRyX1RSIiwidGltZVpvbmUiOiJFdXJvcGUvSXN0YW5idWwiLCJpYXQiOjE3NTMyMTA2MzQsImV4cCI6MTc1MzIxNDIzNH0.hfF1bjcNDhVthtpaZ_HkysA-zJH3VN1a6Sr59aRZbk0 ``` # 1. Login Operation > Login Operations are Made With Username And Password
> API Endpoint: `/v1/auth/login` Example Request Payload: ```json theme={null} { "username": "name@domain.com", "password": "password" } ``` Example Success Response: ```json theme={null} { "username": "name@domain.com", "type": "Bearer", "accessToken": "eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJtdXJhdG96ZGVtaXJAdGFybGEuaW8iLCJ1c2VySWQiOiJjOGI1OTQwZS01M2QyLTQwZGYtYTg4Yi0xMTBjODYxNTVjZmEiLCJyb2xlcyI6WyJBUElfVVNFUiIsIkFETUlOIl0sImxvY2FsZSI6InRyX1RSIiwidGltZVpvbmUiOiJFdXJvcGUvSXN0YW5idWwiLCJpYXQiOjE3NTMyMDc1OTAsImV4cCI6MTc1MzIxMTE5MH0.fTCunl7i7yQ8nAuughBpvpRfdH8VFK8uhZWeTrDOPAc", "refreshToken": "eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJtdXJhdG96ZGVtaXJAdGFybGEuaW8iLCJ1c2VySWQiOiJjOGI1OTQwZS01M2QyLTQwZGYtYTg4Yi0xMTBjODYxNTVjZmEiLCJsb2NhbGUiOiJ0cl9UUiIsInRpbWVab25lIjoiRXVyb3BlL0lzdGFuYnVsIiwiaWF0IjoxNzUzMjA3NTkwLCJleHAiOjE3NTMyOTM5OTB9.ozFiZzNPSUtzwvu3wuocA8q8t6MlqbyT6On2i0vSENQ" } ``` Access Tokens are valid for only 1 hour. Refresh tokens are valid for 1 day! Possible Error Responses: ```json theme={null} { "timestamp": "2025-04-14T16:58:22.22308754", "status": 401, "error": "Unauthorized", "message": "Bad credentials", "path": "/auth/login" } ``` ```json theme={null} { "timestamp": "2025-04-21T16:35:54.095818", "status": 401, "error": "Unauthorized", "message": "User is disabled", "path": "/auth/login" } ``` # 2. Authentication Token Refresh Operation > When the Authentication Token expires, it is renewed using the refresh token
> API Endpoint: `/v1/auth/refresh` Example Request Payload: ```json theme={null} { "refreshToken": "eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJtdXJhdG96ZGVtaXJAdGFybGEuaW8iLCJ1c2VySWQiOiJjOGI1OTQwZS01M2QyLTQwZGYtYTg4Yi0xMTBjODYxNTVjZmEiLCJsb2NhbGUiOiJ0cl9UUiIsInRpbWVab25lIjoiRXVyb3BlL0lzdGFuYnVsIiwiaWF0IjoxNzUzMjA3NTkwLCJleHAiOjE3NTMyOTM5OTB9.ozFiZzNPSUtzwvu3wuocA8q8t6MlqbyT6On2i0vSENQ" } ``` Responses are similar to `Login Operation` If you receive `401 - Unauthorized` response to your API requests, refresh your access token.
If you still receive `401 - Unauthorized` response to your Refresh Token requests, please Login before you proceed!
# User Settings Source: https://api-docs.tarla.io/en/api-reference/final-briefing This page provides important information about the details required to make API requests, such as language selection, user registration, account activation and account subscription processes. # 1. API Language Selection You can use API messages with different language translations by using the `Accept-Language` header in the requests. This applies to API endpoints that do not require input. Supported language selections are given in the example below. ``` Accept-Language: tr Accept-Language: en ``` ## Login-free API endpoints * Authorization Service * New User Registration - `/v1/auth/register` * Login Process - `/v1/auth/login` * Access Token Refresh - `/v1/auth/refresh` * User Service * Password Reset Request `/v1/users/password-reset-request` ## User Language Selection After a user logs in, the system recognizes the user's locale and language selection and translates the API responses accordingly, thanks to the **Access Token** sent to the API endpoints they request. In addition, the ***User Update Process*** available on the `/v1/users/update` API endpoint allows the user to change their (or any user's if they are ADMIN) language, locale and timezone settings. # 2. User Registration and Account Activation * A new user registration is created via the **New User Registration** - `/v1/auth/register` API endpoint by entering the following information: 1. Username (email address) 2. Password 3. Name 4. Middle Name, if any 5. Surname 6. Language and Locale Preference 7. Time Zone Preference * During registration, if there is a user with the same username (email), the error message `Existing User` is returned with the code `400 - Bad Request`. * If the registration was successful, the user status will be created as `INACTIVE`. * A new account registration is created by entering the following information via the **Account Activation Request** - `/v1/accounts/account-activation-request` API endpoint: 1. User ID 2. Account Type 3. Mobile Phone Number 4. Location Address 5. Company 6. Industry 7. Link to Account Activation Page * Handles the activation request for a new account. This method processes the activation request, performs necessary validations (such as checking if an account already exists for the user), and creates a new account if valid. * It also sends an email to the user with an account activation link. * It finalizes the registration of a new account via the **Account Activation** - `/v1/accounts/activate-account` API endpoint by entering the following information: 1. User ID 2. Account ID 3. Email Verification Token * Activates a user account by verifying the provided email verification token. It validates the token, updates account and user status, and ensures the token has not expired. * Once verified, the account is marked as email verified and token fields are cleared. A phone number verification request is made via the **Mobile Phone Number Activation Request** - `/v1/accounts/phone-number-activation-request` API endpoint by entering the following information: 1. User ID 2. Account ID 3. Link to Phone Number Activation Page * Handles the activation process for a user's phone number. This includes validating the account, generating a phone number verification token, composing an activation message, and sending the activation SMS. * It is an optional step, this and the next step can be skipped, but the user will not receive SMS notifications if the phone number is not verified. The phone number verification process is finalized by entering the following information via the **Mobile Phone Number Activation** - `/v1/accounts/activate-phone-number` API endpoint: 1. User ID 2. Account ID 3. Phone Number Validation Token * Activates a phone number for a user by verifying the provided phone number verification token associated with their account. The user cannot use paid services unless a subscription is selected. Therefore, it is necessary to select a subscription as described in the next section. # 3. Subscription Operations * The subscription update process is performed for the user by entering the following information via the **Update Subscription** - `/v1/accounts/update-subscription` API endpoint; * Plan Selection 1. User ID 2. Subscriber ID 3. Subscription Plan Name * Creating a Custom Plan 1. User ID 2. Subscriber ID 3. Plan Details 1. Subscription Period 2. Limit Reset Recurrence 3. Geographical Boundary 4. Api Service Limits 1. Api Version 2. Api Endpoint Name 3. Maximum Number of Calls * Updates the subscription plan for a user account. The endpoint ensures that the user has the required role and the account exists. * It sets the account's subscription plan to the specified value and adjusts the user's status if necessary. * Returns error message if validation errors occur or required entities are not found. ## 3.1. Subscription Plans | Plan Name | Subscription Period | Limit Type | Limit Count | API Call Count | Country Boundary | Region Boundary | Note | | ----------------- | ------------------- | ----------------- | ----------------- | ----------------- | ----------------- | ----------------- | ---------------------------------------------------------------------------------------------------------------------------- | | None | - | - | - | - | - | - | For users who do not have a subscription or whose subscription has been canceled. | | Trial | 1 month | day | 5 | very few | - | - | Available for users who have not previously had a trial subscription. A user cannot select the trial more than once. | | Basic - Monthly | 1 month | month | 1 | limited | - | - | API call count is limited, it is an economical subscription type. There is a 1-month usage limit, must be renewed afterward. | | Basic - Annual | 1 year | quota | - | limited | - | - | API call count is limited, an economical type where the total annual quota can be used at any time within the year. | | Premium - Monthly | 1 month | month | 1 | sufficient | - | - | API call count is sufficient, top-tier subscription. There is a 1-month usage limit, must be renewed afterward. | | Premium - Annual | 1 year | quota | - | sufficient | - | - | API call count is sufficient, top-tier subscription where the total annual quota can be used at any time within the year. | | Custom | depends on choice | depends on choice | depends on choice | depends on choice | depends on choice | depends on choice | A custom subscription type where each parameter can be customized. | ## 3.2. Geo-bounding Options for Custom Subscription Option 1. All 2. Akdeniz Region 3. Doğu Anadolu Region 4. Ege Region 5. Güneydoğu Anadolu Region 6. İç Anadolu Region 7. Marmara Region 8. Karadeniz Region 1. All 2. Eastern 3. Western 4. Northern 5. Southern 1. Iran 1. All # API Security Source: https://api-docs.tarla.io/en/api-reference/introduction This page provides important information about the details you need to know before making API requests. # Secure API Request Signing and Idempotency Mechanism ## Overview This API leverages a robust security mechanism involving **HMAC-based request signing, timestamping, unique request identification (nonce)**, and **idempotency keys**. These mechanisms collectively ensure the integrity, authenticity, and non-replayability of client requests, as well as safe handling of duplicate submissions. This documentation explains each mechanism, their purposes, and how to implement the required client logic (e.g., in Postman or custom API clients). ## 1. HMAC Signature (`X-Signature` Header) ### What is it? An **HMAC (Hash-based Message Authentication Code)** is a cryptographic signature generated using a shared secret and the request data. It ensures that the request cannot be tampered with, and its sender can be authenticated. ### Purpose * **Integrity:** Detects if any part of the request (method, URI, body, timestamp) has been altered. * **Authentication:** Confirms the request is from a trusted client who knows the secret key. * **Anti-Replay:** Tied to a timestamp and unique values, making replay attacks detectable. ### How is it used? * The client constructs a string to sign, concatenating the HTTP method, full request path (including query), current timestamp ***in epoch milliseconds***, and resolved request body: ```ini theme={null} dataToSign = HTTP_METHOD + "|" + PATH_WITH_QUERY + "|" + TIMESTAMP + "|" + BODY ``` * The client generates the HMAC SHA256 signature using the shared secret (kept in a secure vault, **never exposed**): ```ini theme={null} X-Signature = HMAC_SHA256(secret, dataToSign) ``` * This signature is sent in the request header `X-Signature`. Please ask us **HMAC Secret** before making your first API call ### What if not used? * Client will receive an error message with http status `400 - Bad Request` ```json theme={null} { "timestamp": "2025-04-14T16:58:10.414972912", "status": 400, "error": "Bad Request", "message": "Missing signature, timestamp, or nonce headers", "path": "/auth/login" } ``` ### What if signature is not valid? * Client will receive an error message with http status `401 - Unauthorized` ```json theme={null} { "timestamp": "2025-04-14T16:57:50.083970026", "status": 401, "error": "Unauthorized", "message": "Invalid request signature", "path": "/auth/login" } ``` ## 2. Timestamp (`X-Timestamp` Header) ### What is it? The Unix timestamp (in milliseconds) at the moment the request is generated. ### Purpose * **Anti-Replay:** Prevents an attacker from reusing a previously valid request, since the server can enforce strict time windows for valid requests. ### How is it used? * The client generates the timestamp just before sending the request and includes it as the `X-Timestamp` header. ### What if not used? * Client will receive an error message with http status `400 - Bad Request` ```json theme={null} { "timestamp": "2025-04-14T16:58:10.414972912", "status": 400, "error": "Bad Request", "message": "Missing signature, timestamp, or nonce headers", "path": "/auth/login" } ``` ## 3. Nonce (`X-Nonce` Header) ### What is it? A **nonce** is a randomly generated unique identifier (UUID v4) included in each request. ### Purpose * **Anti-Replay:** Further prevents request replay by uniquely identifying each request. Even if method, URI, and body are the same, the nonce will differ. ### How is it used? * The client generates a new UUID v4 for every request and includes it as the `X-Nonce` header. ### What if not used? * Client will receive an error message with http status `400 - Bad Request` ```json theme={null} { "timestamp": "2025-04-14T16:58:10.414972912", "status": 400, "error": "Bad Request", "message": "Missing signature, timestamp, or nonce headers", "path": "/auth/login" } ``` ### What if re-used? * Client will receive an error message with http status `409 - Conflict` ```json theme={null} { "timestamp": "2025-04-14T16:57:21.168927321", "status": 409, "error": "Conflict", "message": "Replay attack detected (nonce reused)", "path": "/endpoint/uri/here" } ``` ## 4. Idempotency Key (`X-Idempotency-Key` Header) ### What is it? A **unique identifier** (UUID v4) for each request, enabling the server to recognize and safely ignore duplicate submissions (e.g., from retrying a POST request). ### Purpose * **Idempotency:** Guarantees that retrying a request due to network errors will not result in duplicate resource creation or side effects. ### How is it used? * The client generates a new UUID v4 for each operation and sends it as the `X-Idempotency-Key` header. ### What if not used? * Client will receive an error message with http status `400 - Bad Request` ```json theme={null} { "timestamp": "2025-04-14T16:26:54.203118461", "status": 400, "error": "Bad Request", "message": "Missing X-Idempotency-Key header", "path": "/endpoint/uri/here" } ``` ### What if re-used? * Client will receive an error message with http status `409 - Conflict` ```json theme={null} { "timestamp": "2025-04-14T16:56:28.671809875", "status": 409, "error": "Conflict", "message": "Duplicate request detected (X-Idempotency-Key)", "path": "/endpoint/uri/here" } ``` * The `secret` used for HMAC **must never be shared or exposed in client code or documentation**. * Always use HTTPS to prevent man-in-the-middle attacks. * Servers enforce a maximum allowable time skew for the `X-Timestamp` and reject used/replayed `X-Nonce` or `X-Idempotency-Key` values within a certain window. ```ini theme={null} X-Signature: 75c759570bbb5dfd40136cffd3dbaa51b28d4620e51359161686790adcc53bea X-Timestamp: 1752751106704 X-Nonce: 684a0dca-bd6a-4056-a449-2567f9847f9c X-Idempotency-Key: 777edc03-ad49-4c17-be6b-9baf05a1b9e0 ``` ### Summary Table | Header | Value/Format | Purpose | | ----------------- | ------------------------ | ------------------------------ | | X-Signature | Hexadecimal string | Request authenticity/integrity | | X-Timestamp | Milliseconds since epoch | Prevent replay | | X-Nonce | UUID v4 | Uniqueness/anti-replay | | X-Idempotency-Key | UUID v4 | Idempotency for retries | # Introduction Source: https://api-docs.tarla.io/en/index Welcome to the home of tarla.io API documentation # Abundance via Data tarla.io gathers and presents data from satellite images, storm detections, rainfall radars, soil sensors, climate data, and price indices to help you make informed agricultural decisions, monitor your field, and boost productivity. ## Discover Smart farming made easy with tarla.io! With the parametric insurance, you can now safeguard your agricultural production against natural events in a fairer, faster, and more transparent way. This system is automatically triggered by specific weather events and delivers payouts directly—without the need for claims or inspections. Designed for farmers, this next-generation protection model eliminates paperwork, saves time, and reduces climate risks. With the smart climate stations you install on your fields, you won't just monitor the weather—you'll also start earning cryptocurrency! By sharing microclimate data from your area through WeatherXM's innovative stations, you can earn additional income via blockchain technology. Offered in two different models, these stations are fully compatible with your agricultural land, providing precise measurement, robust data analytics, and a future-oriented investment opportunity. Track your field using satellite indices and find problematic areas. Notifies you of field-specific risks, disease probabilities, and severe weather events with real-time messages. # Kimlik Doğrulama Source: https://api-docs.tarla.io/tr/api-reference/authentication Kimlik doğrulama, kullanıcıların kimliğini doğrulayarak API Hizmetlerinin gizliliğini garanti eder. Kimlik doğrulama, kullanıcıların iklim.co API Hizmetlerine erişmeden önce oturum açmasını gerektirir. Bu kılavuz, mevcut her el sıkışma yöntemi için kurulumu kapsar. Tüm yetkili uç noktalar istekte `Authorization: Bearer ` başlığı gerektirir!
Aksi takdirde API istemcisi durum `401 - Yetkisiz` ile bir hata mesajı alacaktır
Örnek Başlık: ```ini theme={null} Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJtdXJhdG96ZGVtaXJAdGFybGEuaW8iLCJ1c2VySWQiOiJjOGI1OTQwZS01M2QyLTQwZGYtYTg4Yi0xMTBjODYxNTVjZmEiLCJyb2xlcyI6WyJBUElfVVNFUiIsIkFETUlOIl0sImxvY2FsZSI6InRyX1RSIiwidGltZVpvbmUiOiJFdXJvcGUvSXN0YW5idWwiLCJpYXQiOjE3NTMyMTA2MzQsImV4cCI6MTc1MzIxNDIzNH0.hfF1bjcNDhVthtpaZ_HkysA-zJH3VN1a6Sr59aRZbk0 ``` # 1. Giriş İşlemi > Kullanıcı Adı ve Şifre ile Giriş İşlemleri Yapılır
> API Uç Noktası: `/v1/auth/login` Örnek İstek Gövdesi: ```json theme={null} { "username": "name@domain.com", "password": "password" } ``` Örnek Başarılı Yanıt: ```json theme={null} { "username": "name@domain.com", "type": "Bearer", "accessToken": "eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJtdXJhdG96ZGVtaXJAdGFybGEuaW8iLCJ1c2VySWQiOiJjOGI1OTQwZS01M2QyLTQwZGYtYTg4Yi0xMTBjODYxNTVjZmEiLCJyb2xlcyI6WyJBUElfVVNFUiIsIkFETUlOIl0sImxvY2FsZSI6InRyX1RSIiwidGltZVpvbmUiOiJFdXJvcGUvSXN0YW5idWwiLCJpYXQiOjE3NTMyMDc1OTAsImV4cCI6MTc1MzIxMTE5MH0.fTCunl7i7yQ8nAuughBpvpRfdH8VFK8uhZWeTrDOPAc", "refreshToken": "eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJtdXJhdG96ZGVtaXJAdGFybGEuaW8iLCJ1c2VySWQiOiJjOGI1OTQwZS01M2QyLTQwZGYtYTg4Yi0xMTBjODYxNTVjZmEiLCJsb2NhbGUiOiJ0cl9UUiIsInRpbWVab25lIjoiRXVyb3BlL0lzdGFuYnVsIiwiaWF0IjoxNzUzMjA3NTkwLCJleHAiOjE3NTMyOTM5OTB9.ozFiZzNPSUtzwvu3wuocA8q8t6MlqbyT6On2i0vSENQ" } ``` Erişim belirteçleri sadece 1 saat için geçerlidir. Yenileme belirteçleri ise 1 gün boyunca geçerlidir! Olası Hata Yanıtları: ```json theme={null} { "timestamp": "2025-04-14T16:58:22.22308754", "status": 401, "error": "Yetkisiz", "message": "Hatalı kimlik bilgileri", "path": "/auth/login" } ``` ```json theme={null} { "timestamp": "2025-04-21T16:35:54.095818", "status": 401, "error": "Yetkisiz", "message": "Kullanıcı devre dışı", "path": "/auth/login" } ``` # 2. Erişim Belirteci Yenileme İşlemi > Erişim belirtecinin süresi dolduğunda, yenileme belirteci kullanılarak yenilenir
> API Uç Noktası: `/v1/auth/refresh` Örnek İstek Gövdesi: ```json theme={null} { "refreshToken": "eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJtdXJhdG96ZGVtaXJAdGFybGEuaW8iLCJ1c2VySWQiOiJjOGI1OTQwZS01M2QyLTQwZGYtYTg4Yi0xMTBjODYxNTVjZmEiLCJsb2NhbGUiOiJ0cl9UUiIsInRpbWVab25lIjoiRXVyb3BlL0lzdGFuYnVsIiwiaWF0IjoxNzUzMjA3NTkwLCJleHAiOjE3NTMyOTM5OTB9.ozFiZzNPSUtzwvu3wuocA8q8t6MlqbyT6On2i0vSENQ" } ``` Cevaplar `Giriş İşlemi`'ne benzeridir. API isteklerinize `401 - Yetkisiz` yanıtı alırsanız, erişim belirtecinizi yenileyin.
Belirteci Yenileme isteklerinize hala `401 - Yetkisiz` yanıtı alıyorsanız, lütfen devam etmeden önce Giriş yapın!
# Kullanıcı Seçenekleri Source: https://api-docs.tarla.io/tr/api-reference/final-briefing Bu sayfa, API istekleri yapmak için gerekli dil seçimi, kullanıcı kaydı, hesap aktivasyonu ve hesap abonelik işlemleri gibi ayrıntılar hakkında önemli bilgiler sağlar. # 1. API Dili Seçimi Yapılan isteklerde `Accept-Language` başlığı kullanılarak API mesajlarını farklı dildeki tercümeleri ile kullanabilirsiniz. Bu durum Giriş gerektirmeyen API uç noktaları için geçerlidir. Desteklenen dil seçilmleri aşağıdaki örnekte verilmiştir. ``` Accept-Language: tr Accept-Language: en ``` ## Giriş gerektirmeyen API uç noktaları * Yetkilendirme Servisi * Yeni Kullanıcı Kaydı - `/v1/auth/register` * Giriş İşlemi - `/v1/auth/login` * Erişim Belirteci Yenileme - `/v1/auth/refresh` * Kullanıcı Servisi * Şifre Sıfırlama İsteği `/v1/users/password-reset-request` ## Kullanıcı Dil Seçimi Bir kullanıcı, giriş yaptıktan sonra istekte bulunduğu API uç noktalarına gönderilen **Erişim Belirteci** sayesinde sistem kullanıcının yerel ayarlar ve dil seçimini tanır ve buna göre API cevaplarını tercüme eder. Bunun yanında `/v1/users/update` API uç noktasında hizmet veren ***Kullanıcı Güncelleme İşlemi*** ile kullanıcı kendi (ADMIN ise herhangi bir kullanıcının) dil, yerel ve zaman dilimi ayarlarını da değiştirebilir. # 2. Kullanıcı Kaydı ve Hesap Aktivasyonu * **Yeni Kullanıcı Kaydı** - `/v1/auth/register` API uç noktası üzerinden aşağıdaki bilgiler girilerek yeni bir kullanıcı kaydı oluşturulur: 1. Kullanıcı adı (e-posta adresi) 2. Şifre 3. Adı 4. Varsa Göbek Adı 5. Soyadı 6. Dil ve Yerel Ayarlar Tercihi 7. Zaman Dilimi Tercihi * Kayıt sırasında, eğer aynı kullanıcı adına (e-posta) sahip bir kullanıcı varsa `400 - Hatalı İstek` kodu ile `Kullanıcı Mevcut` hata mesajı döner. * Kayıt başarılı oldu ise kullanıcı durumu `INACTIVE` olarak kayıt oluşturulmuş olur. * **Hesap Aktivasyon İsteği** - `/v1/accounts/account-activation-request` API uç noktası üzerinden aşağıdaki bilgiler girilerek yeni bir hesap kaydı oluşturulur: 1. Kullanıcı ID 2. Hesap Tipi 3. Mobil Telefon Numarası 4. Konum Adresi 5. Firma 6. Endüstri 7. Hesap Aktivasyon Sayfası Linki * Yeni bir hesap için etkinleştirme isteğini yerine getirir. Bu uç nokta, aktivasyon talebini işler, gerekli doğrulamaları yapar (kullanıcı için zaten bir hesap olup olmadığını kontrol etmek gibi) ve geçerliyse yeni bir hesap oluşturur. * Ayrıca kullanıcıya hesap etkinleştirme bağlantısını içeren bir e-posta gönderir. * **Hesap Aktivasyonu** - `/v1/accounts/activate-account` API uç noktası üzerinden aşağıdaki bilgiler girilerek yeni bir hesap kaydını neticlendirir: 1. Kullanıcı ID 2. Hesap ID 3. E-posta Doğrulama Belirteci * Sağlanan e-posta doğrulama belirtecini doğrulayarak bir kullanıcı hesabını etkinleştirir. Belirteci doğrular, hesap ve kullanıcı durumunu günceller ve belirtecin süresinin dolmadığından emin olur. * Doğrulandıktan sonra, hesap e-postası doğrulandı olarak işaretlenir ve belirteç alanları temizlenir. * **Telefon Numarası Aktivasyon Talebi** - `/v1/accounts/phone-number-activation-request` API uç noktası üzerinden aşağıdaki bilgiler girilerek telefon numarası doğrulama isteği yapılır: 1. Kullanıcı ID 2. Hesap ID 3. Telefon Numarası Aktivasyon Sayfası Linki * Bir kullanıcının telefon numarası için aktivasyon sürecini yönetir. Bu, hesabın doğrulanmasını, bir telefon numarası doğrulama belirteci oluşturulmasını, bir aktivasyon mesajı oluşturulmasını ve aktivasyon SMS'inin gönderilmesini içerir. * İsteğe bağlı bir adımdır, bu ve sonraki adım atlanabilir, ancak telefon numarası doğrulanmaz ise kullanıcı SMS bildirimleri alamaz. * **Telefon Numarası Aktivasyonu** - `/v1/accounts/activate-phone-number` API uç noktası üzerinden aşağıdaki bilgiler girilerek telefon numarası doğrulama işlemi neticlendirilir: 1. Kullanıcı ID 2. Hesap ID 3. Telefon Numarası Doğrulama Belirteci * Bir kullanıcı için, hesabıyla ilişkili olarak sağlanan telefon numarası doğrulama belirtecini doğrulayarak bir telefon numarasını etkinleştirir. Kullanıcı için bir abonelik seçilmeden ücretli servisleri kullanamaz. Bu nedenle bir sonraki başlıkta anlatıldığı gibi bir abonelik seçimi yapılması gerekmektedir. # 3. Abonelik İşlemleri * **Aboneli̇k Güncelleme** - `/v1/accounts/update-subscription` API uç noktası üzerinden aşağıdaki bilgiler girilerek kullanıcı için abnonelik güncelleme işlemi gerçekleştirilir; * Plan Seçimi 1. Kullanıcı ID 2. Abone ID 3. Abonelik Planı İsmi * Özel Plan Oluşturma 1. Kullanıcı ID 2. Abone ID 3. Plan Detayları 1. Abonelik Süresi 2. Limit Sıfırlama Periyodu 3. Coğrafi Sınır 4. Api Servis Limitleri 1. Api Versiyonu 2. Api Endpoint İsmi 3. Maksimum Çağrı Sayısı * Bir kullanıcı hesabı için abonelik planını günceller. Uç nokta, kullanıcının gerekli role sahip olduğundan ve hesabın var olduğundan emin olur. * Hesabın abonelik planını belirtilen değere ayarlar ve gerekirse kullanıcının durumunu ayarlar. * Doğrulama hataları oluşursa veya gerekli kayıtlar bulunamazsa hata mesajı döndürür. ## 3.1. Abonelik Planları | Plan İsmi | Abonelik Süresi | Limit Tipleri | Limit Tanımı | API Çağrı Sayısı | Ülke Sınırı | Bölge Sınırı | Not | | ----------------------- | --------------- | ------------- | ------------ | ---------------- | ------------ | ------------ | ------------------------------------------------------------------------------------------------------------------------ | | Hiçbiri | - | - | - | - | - | - | Henüz bir aboneliği olmayan veya aboneliği iptal edilen kullanıcılar içindir. | | Deneme | 1 ay | gün | 5 | çok az | - | - | Daha önce deneme aboneliği olmamış kullanıcılar yararlanabilir. Birden fazla kez deneme aboneliği seçilemez. | | Giriş Seviyesi - Aylık | 1 ay | ay | 1 | sınırlı | - | - | API Çağrı sayısı sınırlı, ekonomik abonelik çeşididir. 1 aylık kullanım limiti vardır, sonrasında yenilenmeli. | | Giriş Seviyesi - Yıllık | 1 yıl | kota | - | sınırlı | - | - | API Çağrı sayısı sınırlı, aylık limit olmayan tüm kotanın 1 yıl içinde kullanılabileceği ekonomik abonelik çeşididir. | | Premium - Aylık | 1 ay | ay | 1 | yeterli | - | - | API Çağrı sayısı yeterli, üst seviye abonelik çeşididir. 1 aylık kullanım limiti vardır, sonrasında yenilenmeli. | | Premium - Yıllık | 1 yıl | kota | - | yeterli | - | - | API Çağrı sayısı yeterli, aylık limiti olmayan tüm kotanın 1 yıl içinde kullanılabileceği üst seviye abonelik çeşididir. | | Özel | seçime bağlı | seçime bağlı | seçime bağlı | seçime bağlı | seçime bağlı | seçime bağlı | Her parametresi değiştirilebilir özel abonelik çeşidi. | ## 3.2. Özel Abonelik Seçeneği İçin Coğrafi Sınır Seçenekleri 1. Tümü 2. Akdeniz Bölgesi 3. Doğu Anadolu Bölgesi 4. Ege Bölgesi 5. Güneydoğu Anadolu Bölgesi 6. İç Anadolu Bölgesi 7. Marmara Bölgesi 8. Karadeniz Bölgesi 1. Tümü 2. Doğu 3. Batı 4. Kuzey 5. Güney 1. Iran 1. Tümü # API Güvenliği Source: https://api-docs.tarla.io/tr/api-reference/introduction Bu sayfa, API istekleri yapmadan önce bilmeniz gereken ayrıntılar hakkında önemli bilgiler sağlar. # Güvenli API İstek İmzalama ve Idempotency Mekanizması ## Genel Bakış Genel Bakış Bu API, **HMAC tabanlı istek imzalama, zaman damgası, benzersiz istek tanımlama (nonce)** ve **idempotency anahtarları** içeren sağlam bir güvenlik mekanizmasından yararlanır. Bu mekanizmalar toplu olarak, istemci isteklerinin bütünlüğünü, gerçekliğini ve tekrarlanamazlığını ve ayrıca yinelenen gönderimlerin güvenli bir şekilde ele alınmasını sağlar. Bu belgede her bir mekanizma, amaçları ve gerekli istemci mantığının nasıl uygulanacağı (örneğin Postman veya özel API istemcilerinde) açıklanmaktadır. ## 1. HMAC İmzası (`X-Signature` Başlığı) ### Nedir? Bir **HMAC (Karma Tabanlı Mesaj Kimlik Doğrulama Kodu)**, paylaşılan bir sır ve istek verileri kullanılarak oluşturulan bir kriptografik imzadır. Talebin değiştirilememesini ve gönderenin kimliğinin doğrulanabilmesini sağlar. ### Amacı * **Bütünlük:** İsteğin herhangi bir kısmının (yöntem, URI, gövde, zaman damgası) değiştirilip değiştirilmediğini tespit eder. * **Kimlik Doğrulama:** İsteğin gizli anahtarı bilen güvenilir bir istemciden geldiğini doğrular. * **Yeniden Oynatma Önleme:** Bir zaman damgasına ve benzersiz değerlere bağlı olarak yeniden oynatma saldırılarını tespit edilebilir hale getirir. ### Nasıl Kullanılır? * İstemci imzalamak için HTTP yöntemini, tam istek yolunu (sorgu dahil), ***milisaniye cinsinden geçerli zaman damgasını*** ve çözümlenmiş istek gövdesini birleştiren bir dize oluşturur: ```ini theme={null} dataToSign = HTTP_METHOD + "|" + PATH_WITH_QUERY + "|" + TIMESTAMP + "|" + BODY ``` * İstemci, paylaşılan anahtarı (güvenli bir kasada tutulur, **asla ifşa edilmez**) kullanarak HMAC SHA256 imzasını oluşturur: ```ini theme={null} X-Signature = HMAC_SHA256(secret, dataToSign) ``` * Bu imza `X-Signature` istek başlığında gönderilir. İlk API çağrınızı yapmadan önce lütfen bizden **HMAC Anahtarını** isteyin ### Kullanılmazsa ne olur? * İstemci http durumu `400 - Hatalı İstek` ile bir hata mesajı alacaktır ```json theme={null} { "timestamp": "2025-04-14T16:58:10.414972912", "status": 400, "error": "Hatalı İstek", "message": "Eksik imza, zaman damgası veya nonce başlıkları", "path": "/auth/login" } ``` ### İmza geçerli değilse ne olur? * İstemci, http durumu `401 - Yetkisiz` olan bir hata mesajı alacaktır. ```json theme={null} { "timestamp": "2025-04-14T16:57:50.083970026", "status": 401, "error": "Yetkisiz", "message": "Geçersiz istek imzası", "path": "/auth/login" } ``` ## 2. Zaman Damgası (`X-Timestamp` Başlığı) ### Nedir? İsteğin oluşturulduğu andaki Unix zaman damgası (milisaniye cinsinden). ### Amaç * **Tekrar Oynatma Önleme:** Sunucu geçerli istekler için katı zaman pencereleri uygulayabildiğinden, bir saldırganın daha önce geçerli olan bir isteği tekrar kullanmasını önler. ### Nasıl Kullanılır? * İstemci, isteği göndermeden hemen önce zaman damgasını oluşturur ve bunu `X-Timestamp` başlığı olarak ekler. ### Kullanılmazsa ne olur? * İstemci, http durumu `400 - Hatalı İstek` olan bir hata mesajı alacaktır ```json theme={null} { "timestamp": "2025-04-14T16:58:10.414972912", "status": 400, "error": "Hatalı İstek", "message": "Eksik imza, zaman damgası veya nonce başlıkları", "path": "/auth/login" } ``` ## 3. Nonce - Tek Seferlik (`X-Nonce` Başlığı) ### Nedir? Bir **nonce**, her istekte bulunan rastgele oluşturulmuş benzersiz bir tanımlayıcıdır (UUID v4). ### Amaç * **Yeniden Oynatma Önleme:** Her isteği benzersiz bir şekilde tanımlayarak isteğin yeniden oynatılmasını daha da önler. Yöntem, URI ve gövde aynı olsa bile, nonce farklı olacaktır. ### Nasıl Kullanılır? * İstemci her istek için yeni bir UUID v4 oluşturur ve bunu `X-Nonce` başlığı olarak ekler. ### Kullanılmazsa ne olur? * İstemci, http durumu `400 - Hatalı İstek` olan bir hata mesajı alacaktır ```json theme={null} { "timestamp": "2025-04-14T16:58:10.414972912", "status": 400, "error": "Hatalı İstek", "message": "Eksik imza, zaman damgası veya nonce başlıkları", "path": "/auth/login" } ``` ### Yeniden kullanılırsa ne olur? * İstemci http durumu `409 - Çakışma` ile bir hata mesajı alacaktır ```json theme={null} { "timestamp": "2025-04-14T16:57:21.168927321", "status": 409, "error": "Çakışma", "message": "Yeniden oynatma saldırısı tespit edildi (nonce yeniden kullanıldı)", "path": "/endpoint/uri/here" } ``` ## 4. Idempotency Anahtarı (`X-Idempotency-Key` Başlığı) ### Nedir? Her istek için bir **tekil tanımlayıcı** (UUID v4), sunucunun yinelenen gönderimleri tanımasını ve güvenli bir şekilde göz ardı etmesini sağlar (örneğin, bir POST isteğinin yeniden denenmesi). ### Amaç * **Idempotency:** Ağ hataları nedeniyle bir isteğin yeniden denenmesinin yinelenen kaynak oluşturma veya yan etkilere neden olmayacağını garanti eder. ### Nasıl Kullanılır? * İstemci her işlem için yeni bir UUID v4 oluşturur ve bunu `X-Idempotency-Key` başlığı olarak gönderir. ### What if not used? * İstemci, http durumu `400 - Hatalı İstek` olan bir hata mesajı alacaktır ```json theme={null} { "timestamp": "2025-04-14T16:26:54.203118461", "status": 400, "error": "Hatalı İstek", "message": "Eksik X-Idempotency-Key başlığı", "path": "/endpoint/uri/here" } ``` ### Yeniden kullanılırsa ne olur? * İstemci http durumu `409 - Çakışma` ile bir hata mesajı alacaktır ```json theme={null} { "timestamp": "2025-04-14T16:56:28.671809875", "status": 409, "error": "Çakışma", "message": "Yinelenen istek algılandı (X-Idempotency-Key)", "path": "/endpoint/uri/here" } ``` * HMAC için kullanılan `anahtar` **istemci kodunda veya belgelerinde asla paylaşılmamalı veya ifşa edilmemelidir**. * Ortadaki adam saldırılarını önlemek için her zaman HTTPS kullanın. * Sunucular, `X-Timestamp` için izin verilen maksimum bir zaman eğriliği uygular ve belirli bir pencere içinde kullanılmış/tekrarlanmış `X-Nonce` veya `X-Idempotency-Key` değerlerini reddeder. ```ini theme={null} X-Signature: 75c759570bbb5dfd40136cffd3dbaa51b28d4620e51359161686790adcc53bea X-Timestamp: 1752751106704 X-Nonce: 684a0dca-bd6a-4056-a449-2567f9847f9c X-Idempotency-Key: 777edc03-ad49-4c17-be6b-9baf05a1b9e0 ``` ### Özet Tablo | Başlık | Değer/Format | Amaç | | ----------------- | ------------------------ | ---------------------------------- | | X-Signature | Hexadecimal string | Orijinallik/bütünlük talebi | | X-Timestamp | Milliseconds since epoch | Yeniden oynatmayı önler | | X-Nonce | UUID v4 | Teklik/tekrarı önleme | | X-Idempotency-Key | UUID v4 | Yeniden denemeler için Idempotency | # Giriş Source: https://api-docs.tarla.io/tr/index tarla.io API belgelerinin ana sayfasına hoş geldiniz # Verilerle Bereket tarla.io, uydu görüntüleri, fırtına tespitleri, yağış radarları, toprak sensörleri, iklim verileri ve fiyat endekslerinden elde edilen verileri toplayarak sunar ve bu sayede bilinçli tarımsal kararlar almanıza, tarlalarınızı izlemenize ve verimliliğinizi artırmanıza yardımcı olur. ## Keşfet Tarla.io ile akıllı tarım artık çok kolay! Parametrik sigorta ile artık tarımsal üretiminizi doğal afetlere karşı daha güvenli, daha hızlı ve daha şeffaf bir şekilde koruyabilirsiniz. Bu sistem, belirli hava olayları tarafından otomatik olarak tetiklenir ve tazminat talepleri veya incelemelere gerek kalmadan doğrudan ödeme yapar. Çiftçiler için tasarlanan bu yeni nesil koruma modeli, evrak işlerini ortadan kaldırır, zaman kazandırır ve iklim risklerini azaltır. Tarlalarınıza kurduğunuz akıllı iklim istasyonları ile sadece hava durumunu izlemekle kalmayacak, aynı zamanda kripto para birimi kazanmaya da başlayacaksınız! WeatherXM'in yenilikçi istasyonları aracılığıyla bölgenizdeki mikro iklim verilerini paylaşarak, blok zinciri teknolojisi sayesinde ek gelir elde edebilirsiniz. İki farklı modelde sunulan bu istasyonlar, tarım arazilerinizle tam uyumludur ve hassas ölçümler, sağlam veri analizi ve geleceğe yönelik bir yatırım fırsatı sunar. Uydu endekslerini kullanarak arazinizi takip edin ve sorunlu alanları bulun. Tarlaya özgü riskler, hastalık olasılıkları ve şiddetli hava olayları hakkında gerçek zamanlı mesajlarla sizi bilgilendirir.