PHP code example of karaden-prg / karaden-prg-php

1. Go to this page and download the library: Download karaden-prg/karaden-prg-php library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

karaden-prg / karaden-prg-php example snippets


\Karaden\Config::$apiKey = '<トークン>';
\Karaden\Config::$tenantId = '<テナントID>';
$params = \Karaden\Param\Message\MessageCreateParams::newBuilder()
    ->withServiceId(1)
    ->withTo('09012345678')
    ->withBody('本文')
    ->build();
$message = \Karaden\Model\Message::create($params);

$params = \Karaden\Param\Message\MessageDetailParams::newBuilder()
    ->withId('<メッセージID>')
    ->build();
$requestOptions = \Karaden\RequestOptions::newBuilder()
    ->withApiKey('<トークン>')
    ->withTenantId('<テナントID>')
    ->build();
$message = \Karaden\Model\Message::detail($params, $requestOptions);

\Karaden\Config::$httpClient = \Http\Adapter\Guzzle7\Client::createWithConfig(['timeout' => <秒>]);

composer