No API key has been generated yet. Contact the Super Admin to generate one.
X-API-Key header.
@if ($school->api_key)
Send a POST request with your API key in the X-API-Key header.
@else
Send a POST request to the chatbot API. No API key required for this school.
@endif
curl -X POST
{{ url('/api/chatbot') }} -H "Content-Type:
application/json"{{ $school->api_key ? ' -H "X-API-Key: ' . $school->api_key . '"' : '' }}
-d '{"message": "hello", "school_code": "{{ $school->code }}"}'
Copy and paste this code into your school's website, just before the closing
</body> tag.
<!-- ShikshaLink Chatbot Widget -->
<script src="{{ url('/widget.js') }}"
data-api="{{ url('/api') }}"
data-school="{{ $school->code }}"{{ $school->api_key ? "\n data-key=\"{$school->api_key}\"" : '' }}></script>