@extends('admin.layouts.app') @section('panel')

@lang('INTRODUCTION')

{{ __(gs('site_name')) }} @lang('API integration is pretty simple and easy. using our API you can send SMS to any mobile number. You can send scheduled messages using our API. Our API is easy to implement in any other web application. Our API is well-formatted, accepts GET & POST request, and returns JSON responses. All URLs are case-sensitive')

@lang('API KEY')

@lang('Get your API key from the below. The API key is used to authenticate the request and determines whether the request is valid or not. If you want to regenerate the API key from the below sync icon.')

@lang('SEND SMS(POST)')

@lang('You will need to make request with these following API end points.')

@lang('URL:') {{ route('api.sms.send') }}

@lang('METHOD:') @lang('POST')

@lang('HEADER:') @lang('apikey')

@lang('Using this endpoint you can send SMS to multiple numbers, schedule SMS and change the default device SIM slot. Request to the end point with the following parameters below. The parameters must be send with request body & request header must be needed to valid API key.')

@lang('Param Name') @lang('Param Type') @lang('Validate') @lang('Description')
@lang('message') @lang('string') @lang('Required') @lang('Maximum 160 Charter')
@lang('mobile_number') @lang('string/number') @lang('Required') @lang('You can send sms to multiple numbers using this format')
@lang('+1 (695) 785-7295,+1 (695) 785-724544')
@lang('device') @lang('string') @lang('Required') @lang('Device ID, which device to send from SMS.') @lang('Device List')
@lang('device_sim') @lang('number') @lang('Optional') @lang('If your device has multiple SIM, then you can choose which SIM from sending SMS to. By Default send from SIM 1.')
@lang('date') @lang('string') @lang('Optional') @lang('If you also send schedule SMS. you can control when sending SMS. The date must be a future date, by default is the current DateTime.')
@lang('The Date format must be') {{ now()->format('Y-m-d h:i') }}
@lang('PHP Code')
                                                    
<?php
    $parameters = [
        'message'       => 'your message',
        'mobile_number' => '+1 (695) 785-7295,+1 (695) 785-724544',
        'device'        => 'Your device id',
    ];

    $header = [
        'apikey:{{@$admin->activeApiKey->key}}'
    ];


    $url ={{ route('api.sms.send') }};

    $ch = curl_init();
    curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
    curl_setopt($ch, CURLOPT_POSTFIELDS,  $parameters);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    $result = curl_exec($ch);
    curl_close($ch);
?>
                                                        
                                                    
@lang('Error Response')
                                                        
{
    "success": false,
    "code": 422,
    "message": "Unprocessable Entity",
    "errors": [
        "The message field is required.",
        "The mobile number field is required.",
    ]
}
                                                            
                                                        
@lang('Success Response')
                                                        
{
    "success": true,
    "code": 200,
    "message": "1 message should be send.",
}
                                                            
                                                        

@lang('SEND SMS(GET)')

@lang('You will need to make request with these following API end points.')

@lang('URL:') {{ route('api.sms.send.get') }}

@lang('METHOD:') @lang('GET')

@lang('Using this endpoint you can send SMS to single numbers. Some restricted here, using this endpoint you can\'t send multiple, or schedule SMS and also you can\'t change the default device SIM slot. Request to the end point with the following parameters below. The parameters must be pass as query-string via endpoint or URLs.')

@lang('Param Name') @lang('Param Type') @lang('Validate') @lang('Description')
@lang('apikey') @lang('string') @lang('Required') @lang('Must valid API KEY')
@lang('message') @lang('string') @lang('Required') @lang('Maximum 160 Charter')
@lang('mobile_number') @lang('string/number') @lang('Required') @lang('Mobile Numbers')
@lang('device') @lang('string') @lang('Required') @lang('Device ID, which device to send from SMS.') @lang('Device List')
@lang('Error Response')
                                                        
{
    "success": false,
    "code": 422,
    "message": "Unprocessable Entity",
    "errors": [
        "The message field is required.",
        "The mobile number field is required.",
    ]
}
                                                            
                                                        
@lang('Success Response')
                                                        
{
    "success": true,
    "code": 200,
    "message": "1 message should be send.",
}
                                                            
                                                        

@lang('ERROR CODE')

@foreach ($errorCodes as $k=> $errorCode) @endforeach
@lang('Code') @lang('Status')
{{ $k }} {{ __($errorCode) }}
@endsection @push('script') @endpush @push('style') @endpush