Buat User Agency
API untuk membuat user agency.
HTTP REQUEST
POST https://api.starsender.online/api/agency/users
Header Parameters
| Parameter | Default | Description |
|---|---|---|
| Authorization | true | Account API key, anda bisa dapatkan di menu profile |
Body Parameters
| Parameter | Default | Description |
|---|---|---|
| Name | true | nama user agency |
| Username | true | Username user agency (harus unik / belum pernah dipakai sebelumnya) |
| true | Email user agency (harus unik / belum pernah dipakai sebelumnya) | |
| Phone | true | Nomor Whatsapp user agency (harus unik / belum pernah dipakai sebelumnya) |
| Password | true | Password user agency |
| PackageID | true | ID paket yang tersedia untuk agency |
Implementasi dengan PHP
agency.php
<?php
$curl = curl_init();
$data = [
"name" => "Nama user agency",
"username" => "username_unik",
"email" => "email_unik@email.com",
"phone" => "08123456789",
"password" => "123456",
"package_id" => 1
];
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.starsender.online/api/agency/users',
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 => json_encode($data),
CURLOPT_HTTPHEADER => array(
'Content-Type:application/json',
'Authorization: YOUR API KEY'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
Respon API
{
"success": true,
"data": {},
"message": "User agency created"
}