PHP code example of rishimohan / pika-sdk

1. Go to this page and download the library: Download rishimohan/pika-sdk 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/ */

    

rishimohan / pika-sdk example snippets


 

kaSdk\Client;

$client = new Client("sk-he2jdus1cbz1dpt4mktgjyvx");

$modifications = [
    'title' => 'Title from PHP SDK.',
    'description' => 'Description from PHP SDK.'
];

$response = $client->generateImageFromTemplate('open-graph-image-1', $modifications, 'base64');
print_r($response['data']['base64']);

 

kaSdk\Client;

$client = new Client("sk-he2jdus1cbz1dpt4mktgjyvx");

$modifications = [
    'title' => 'Title from PHP SDK.',
    'description' => 'Description from PHP SDK.'
];

$response = $client->generateImageFromTemplate('open-graph-image-1', $modifications, 'base64');
print_r($response['data']['base64']);

 

kaSdk\Client;

$client = new Client("sk-he2jdus1cbz1dpt4mktgjyvx");

$modifications = [
    'title' => 'Title from PHP SDK.',
    'description' => 'Description from PHP SDK.'
];

$response = $client->generateImageFromTemplate('open-graph-image-1', $modifications, 'binary');
file_put_contents('og.png', $response);