@extends('frontend.main_master') @section('title', $title) @section('meta_description', $meta_description) @section('meta_keywords', $meta_keywords) @section('og_title', $og_title) @section('og_description', $og_description) @push('styles') @endpush @section('content')
{{ t('api-docs-title') }}

{{ t('api-docs-' . $activePage . '-title') }}

{{ t('api-docs-' . $activePage . '-meta-description') }}

@include('frontend.api_products.partials.subnav')
@if ($activePage === 'intro')

{{ t('api-docs-intro-lead') }}

{{ t('api-docs-intro-base-url-label') }} {{ $baseUrl }}
{{ t('api-docs-intro-format-label') }} application/json; charset=utf-8

{{ t('api-docs-intro-steps-title') }}

    @foreach (range(1, 4) as $i)
  1. {{ t('api-docs-intro-step-' . $i . '-title') }} {{ str_replace(':host', $panelHost, t('api-docs-intro-step-' . $i . '-text')) }}
  2. @endforeach

{{ t('api-docs-intro-request-title') }}

{{ t('api-docs-intro-request-text') }}

curl -X POST {{ $baseUrl }}/chart/natal \
  -H "Authorization: Bearer ab_live_xxxxxxxxxxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "date": "1990-04-12",
    "time": "08:35",
    "lat": 41.0082,
    "lng": 28.9784,
    "timezone": "Europe/Istanbul"
  }'

{{ t('api-docs-intro-response-title') }}

{{ t('api-docs-intro-response-text') }}

{
  "success": true,
  "data": {
    "chart_type": "natal",
    "chart_key": "natal",
    "title": "Doğum Haritası (Natal)",
    "png_data_uri": "data:image/png;base64,iVBORw0KGgo..."
  },
  "meta": { "request_id": "5a1f2b3c-...", "credits_charged": 1, "credits_remaining": 97, "quota_remaining": 1000 }
}

{{ t('api-docs-intro-image-note') }}

{{ t('api-docs-intro-full-example-link') }}

@elseif ($activePage === 'authentication')

{{ t('api-docs-authentication-lead') }}

{{ t('api-docs-auth-header-title') }}

{{ t('api-docs-auth-header-text') }}

Authorization: Bearer ab_live_xxxxxxxxxxxxxxxxxxxxxxxx
{{-- Anahtar yalnızca API müşteri panelinden (API paneli) alınır --}}

{{ t('api-docs-auth-panel-title') }}

{{ str_replace(':host', $panelHost, t('api-docs-auth-panel-text')) }}

{{ t('api-pricing-cta-panel') }}

{{ t('api-docs-auth-steps-title') }}

    @foreach (range(1, 3) as $i)
  1. {{ t('api-docs-auth-step-' . $i . '-title') }} {{ t('api-docs-auth-step-' . $i . '-text') }}
  2. @endforeach

{{ t('api-docs-auth-keyformat-title') }}

{{ t('api-docs-auth-keyformat-text') }}

{{ t('api-docs-auth-security-title') }}

{{ t('api-docs-auth-security-text') }}

{{ t('api-docs-auth-ratelimit-title') }}

{{ t('api-docs-auth-ratelimit-text') }}

X-RateLimit-Limit: 60
X-RateLimit-Remaining: 58
Retry-After: 24
@elseif ($activePage === 'errors')

{{ t('api-docs-errors-lead') }}

{{ t('api-docs-errors-shape-title') }}

{{ t('api-docs-errors-shape-text') }}

{
  "success": false,
  "error": {
    "code": "insufficient_credits",
    "message": "Kredi bakiyeniz bu istek için yeterli değil.",
    "details": { "required": 20, "balance": 4 }
  }
}

{{ t('api-docs-errors-table-title') }}

@foreach ($errorCodes as $status => $code) @endforeach
{{ t('api-docs-errors-th-status') }} {{ t('api-docs-errors-th-code') }} {{ t('api-docs-errors-th-desc') }}
{{ $status }} {{ $code }} {{ t('api-docs-error-' . $status . '-desc') }}

{{ t('api-docs-errors-retry-title') }}

{{ t('api-docs-errors-retry-text') }}

@else

{{ t('api-docs-endpoints-lead') }}

@foreach ($groups as $group)

{{ t('api-group-' . $group['key'] . '-name') }}

{{ t('api-group-' . $group['key'] . '-desc') }}

@if ($group['key'] === \App\Services\ApiPlatform\ApiCatalog::GROUP_AI) {{-- Rapor üretimi dakikalar sürer: 202 + report_id ile sonradan çekme akışı --}}

{{ t('api-docs-ai-async-title') }}

{{ t('api-docs-ai-async-text') }}

@endif
@foreach ($group['skus'] as $sku) @endforeach
{{ t('api-docs-endpoints-th-endpoint') }} {{ t('api-docs-endpoints-th-name') }} {{ t('api-docs-endpoints-th-credits') }} {{ t('api-docs-endpoints-th-cache') }}
{{ $sku['method'] }} {{ $sku['path'] }} {{ t($sku['name_key']) }} {{ t($sku['description_key']) }} @if ($sku['credits'] > 0) {{ $sku['credits'] }} @else {{ t('api-services-free-label') }} @endif {{ $sku['cacheable'] ? t('api-docs-endpoints-cache-yes') : t('api-docs-endpoints-cache-no') }}
@foreach ($group['skus'] as $sku) @php $domId = str_replace('.', '-', $sku['sku']); @endphp

{{ t('api-docs-endpoints-params-title') }}

@if (count($sku['params']) > 0)
@foreach ($sku['params'] as $param) @endforeach
{{ t('api-docs-endpoints-param-th-field') }} {{ t('api-docs-endpoints-param-th-type') }} {{ t('api-docs-endpoints-param-th-required') }} {{ t('api-docs-endpoints-param-th-desc') }}
{{ $param['name'] }} {{ $param['type'] }} @if ($param['required']) {{ t('api-docs-endpoints-required-yes') }} @else {{ t('api-docs-endpoints-required-no') }} @endif {{ $param['description'] }} @if ($param['notes'] !== '') {{ $param['notes'] }} @endif
@else

{{ t('api-docs-endpoints-no-params') }}

@endif

{{ t('api-docs-endpoints-request-title') }}

{{ $sku['curl'] }}

{{ t('api-docs-endpoints-response-title') }}

@if (!empty($sku['example_image_url']))

{{ t('api-docs-endpoints-image-in-data-note') }}

@endif @if ($sku['example'] !== null)
{{ json_encode($sku['example'], JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) }}

{{ t('api-docs-endpoints-response-note') }}

@endif @if (!empty($sku['example_download_url'])) {{ t('api-docs-endpoints-response-download') }} @endif @if (!empty($sku['example_image_url']))

{{ t('api-docs-endpoints-image-title') }}

{{ t($sku['name_key']) }} @endif
@endforeach
@endforeach @endif
@endsection