@extends('layouts.main.app') @section('head') @include('layouts.main.headersection',['buttons'=>[ [ 'name'=>'Back', 'url'=>route('user.apps.index'), ] ]]) @endsection @section('content')

{{__('Create New Message')}}

@php $url=route('api.create.message'); @endphp

{{ __('Text Message Only') }}

curl --location --request POST '{{ $url }}' \ --form 'appkey="{{ $key }}"' \ --form 'authkey="{{ Auth::user()->authkey }}"' \ --form 'to="RECEIVER_NUMBER"' \ --form 'message="Example message"' \

{{ __('Text Message with file') }}

curl --location --request POST '{{ $url }}' \ --form 'appkey="{{ $key }}"' \ --form 'authkey="{{ Auth::user()->authkey }}"' \ --form 'to="RECEIVER_NUMBER"' \ --form 'message="Example message"' \ --form 'file="https://www.africau.edu/images/default/sample.pdf"'


{{ __('Template Only') }}

curl --location --request POST '{{ $url }}' \ --form 'appkey="{{ $key }}"' \ --form 'authkey="{{ Auth::user()->authkey }}"' \ --form 'to="RECEIVER_NUMBER"' \ --form 'template_id="TEMPLATE_ID"' \ --form 'variables[{variableKey1}]="jhone"' \ --form 'variables[{variableKey2}]="replaceable value"'

{{ __('Text Message Only') }}

$curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => '{{ $url }}', CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => '', CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => 'POST', CURLOPT_POSTFIELDS => array( 'appkey' => '{{ $key }}', 'authkey' => '{{ Auth::user()->authkey }}', 'to' => 'RECEIVER_NUMBER', 'message' => 'Example message', 'sandbox' => 'false' ), )); $response = curl_exec($curl); curl_close($curl); echo $response;

{{ __('Text Message with file') }}

$curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => '{{ $url }}', CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => '', CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => 'POST', CURLOPT_POSTFIELDS => array( 'appkey' => '{{ $key }}', 'authkey' => '{{ Auth::user()->authkey }}', 'to' => 'RECEIVER_NUMBER', 'message' => 'Example message', 'file' => 'https://www.africau.edu/images/default/sample.pdf', 'sandbox' => 'false' ), )); $response = curl_exec($curl); curl_close($curl); echo $response;

{{ __('Template Message Only') }}

$curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => '{{ $url }}', CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => '', CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => 'POST', CURLOPT_POSTFIELDS => array( 'appkey' => '{{ $key }}', 'authkey' => '{{ Auth::user()->authkey }}', 'to' => 'RECEIVER_NUMBER', 'template_id' => 'TEMPLATE_ID', 'variables' => array( '{variableKey1}' => 'Jhone', '{variableKey2}' => 'replaceable value' ) ), )); $response = curl_exec($curl); curl_close($curl); echo $response;

{{ __('Text Message Only') }}

var request = require('request'); var options = { 'method': 'POST', 'url': '{{ $url }}', 'headers': { }, formData: { 'appkey': '{{ $key }}', 'authkey': '{{ Auth::user()->authkey }}', 'to': 'RECEIVER_NUMBER', 'message': 'Example message' } }; request(options, function (error, response) { if (error) throw new Error(error); console.log(response.body); });


{{ __('Text Message With File') }}

var request = require('request'); var options = { 'method': 'POST', 'url': '{{ $url }}', 'headers': { }, formData: { 'appkey': '{{ $key }}', 'authkey': '{{ Auth::user()->authkey }}', 'to': 'RECEIVER_NUMBER', 'message': 'Example message', 'file': 'https://www.africau.edu/images/default/sample.pdf' } }; request(options, function (error, response) { if (error) throw new Error(error); console.log(response.body); });


{{ __('Template Only') }}

var request = require('request'); var options = { 'method': 'POST', 'url': '{{ $url }}', 'headers': { }, formData: { 'appkey': '{{ $key }}', 'authkey': '{{ Auth::user()->authkey }}', 'to': 'RECEIVER_NUMBER', 'template_id': 'SELECTED_TEMPLATE_ID', 'variables': { '{variableKey1}' : 'jhone', '{variableKey2}' : 'replaceable value' } } }; request(options, function (error, response) { if (error) throw new Error(error); console.log(response.body); });

import requests

url = "{{ $url }}"

payload={
'appkey': '{{ $key }}',
'authkey': '{{ Auth::user()->authkey }}',
'to': 'RECEIVER_NUMBER',
'message': 'Example message',

}
files=[

]
headers = {}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.text)



{{__('Successful Json Callback')}}


 {
    "message_status": "Success",
    "data": {
        "from": "SENDER_NUMBER",
        "to": "RECEIVER_NUMBER",
        "status_code": 200
    }
}

                    

{{__('Parameters')}}

{{__('S/N')}} {{__('Value')}} {{__('Type')}} {{__('Required')}} {{__('Description')}}
{{__('1.')}} {{__('appkey')}} {{__('string')}} {{__('Yes')}} {{ __("Used to authorize a transaction for the app") }}
{{__('2.')}} {{__('authkey')}} {{__('string')}} {{__('Yes')}} {{ __("Used to authorize a transaction for the is valid user") }}
{{__('3.')}} {{__('to')}} {{__('number')}} {{__('Yes')}} {{ __("Who will receive the message the Whatsapp number should be full number with country code") }}
{{__('4.')}} {{__('template_id')}} {{__('string')}} {{__('No')}} {{ __("Used to authorize a transaction for the template") }}
{{__('5.')}} {{__('message')}} {{__('string')}} {{__('No')}} {{ __("The transactional message max:1000 words") }}
{{__('6.')}} {{__('file')}} {{__('string')}} {{__('No')}} {{ __("file extension type should be in jpg,jpeg,png,webp,pdf,docx,xlsx,csv,txt") }}
{{__('7.')}} {{__('variables')}} {{__('Array')}} {{__('No')}} {{ __("the first value you list replaces the {1} variable in the template message and the second value you list replaces the {2} variable") }}
@endsection