<?php
$Curl = curl_init();
$PostFields =
[
'image' => 'base64_encoded_image_string_here',
'output_format' => 'png',
'quality' => 85,
'resize_mode' => 0,
'resize_percentage' => 50,
'resize_width' => 800,
'resize_height' => 600,
'rotate' => 0,
'rotate_background_color' => 'none',
'crop_mode' => 0,
'crop_percentage' => 80,
'crop_x' => 0,
'crop_y' => 0,
'crop_width' => 400,
'crop_height' => 300,
'flip_mode' => 0,
'border_width' => 0,
'border_height' => 0,
'border_color' => '#000000',
'oil_paint' => 0,
'polaroid' => 0,
'polaroid_angle' => 5,
'swirl' => 0,
'swirl_amount' => 60,
'wave' => 0,
'wave_amplitude' => 10,
'wave_length' => 50,
'negate' => 0,
'charcoal' => 0,
'sepia' => 0,
'vignette' => 0,
'enhance_saturation' => 0,
'enhance_contrast' => 0,
];
curl_setopt_array(
$Curl,
[
CURLOPT_URL => 'https://apicentral.dev/Image/multiTool',
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => http_build_query($PostFields),
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTPHEADER =>
[
'Authorization: Bearer YOUR_API_TOKEN_HERE',
'Content-Type: application/x-www-form-urlencoded'
]
]
);
$Response = curl_exec($Curl);
$Data = json_decode($Response, true);
if (curl_errno($Curl))
$Error = curl_error($Curl);
else
{
$status = $Data['status'];
$message = $Data['message'];
$data = $Data['data'] ?? null;
}
curl_close($Curl); // Omit in PHP 8 and above
?>
import requests
import json
url = 'https://apicentral.dev/Image/multiTool'
Headers = {'Authorization': 'Bearer YOUR_API_TOKEN_HERE'}
Data =
{
"image": "base64_encoded_image_string_here",
"output_format": "png",
"quality": 85,
"resize_mode": 0,
"resize_percentage": 50,
"resize_width": 800,
"resize_height": 600,
"rotate": 0,
"rotate_background_color": "none",
"crop_mode": 0,
"crop_percentage": 80,
"crop_x": 0,
"crop_y": 0,
"crop_width": 400,
"crop_height": 300,
"flip_mode": 0,
"border_width": 0,
"border_height": 0,
"border_color": "#000000",
"oil_paint": 0,
"polaroid": 0,
"polaroid_angle": 5,
"swirl": 0,
"swirl_amount": 60,
"wave": 0,
"wave_amplitude": 10,
"wave_length": 50,
"negate": 0,
"charcoal": 0,
"sepia": 0,
"vignette": 0,
"enhance_saturation": 0,
"enhance_contrast": 0
}
try:
Response = requests.post(url, json=Data, headers=Headers)
ResData = Response.json()
status = ResData.get('status')
message = ResData.get('message')
data = ResData.get('data')
except Exception as e:
error = str(e)
const axios = require('axios');
const Data =
{
"image": "base64_encoded_image_string_here",
"output_format": "png",
"quality": 85,
"resize_mode": 0,
"resize_percentage": 50,
"resize_width": 800,
"resize_height": 600,
"rotate": 0,
"rotate_background_color": "none",
"crop_mode": 0,
"crop_percentage": 80,
"crop_x": 0,
"crop_y": 0,
"crop_width": 400,
"crop_height": 300,
"flip_mode": 0,
"border_width": 0,
"border_height": 0,
"border_color": "#000000",
"oil_paint": 0,
"polaroid": 0,
"polaroid_angle": 5,
"swirl": 0,
"swirl_amount": 60,
"wave": 0,
"wave_amplitude": 10,
"wave_length": 50,
"negate": 0,
"charcoal": 0,
"sepia": 0,
"vignette": 0,
"enhance_saturation": 0,
"enhance_contrast": 0
};
axios.post(
'https://apicentral.dev/Image/multiTool',
Data,
{
headers: {'Authorization': 'Bearer YOUR_API_TOKEN_HERE'}
}
)
.then(Response =>
{
const status = Response.data.status;
const message = Response.data.message;
const data = Response.data.data;
})
.catch(Error => { const error = Error.message; });
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.net.URI;
import java.time.Duration;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
public class ApiExample
{
public static void main(String[] args)
{
String url = "https://apicentral.dev/Image/multiTool";
String JsonPayload = """
{
"image": "base64_encoded_image_string_here",
"output_format": "png",
"quality": 85,
"resize_mode": 0,
"resize_percentage": 50,
"resize_width": 800,
"resize_height": 600,
"rotate": 0,
"rotate_background_color": "none",
"crop_mode": 0,
"crop_percentage": 80,
"crop_x": 0,
"crop_y": 0,
"crop_width": 400,
"crop_height": 300,
"flip_mode": 0,
"border_width": 0,
"border_height": 0,
"border_color": "#000000",
"oil_paint": 0,
"polaroid": 0,
"polaroid_angle": 5,
"swirl": 0,
"swirl_amount": 60,
"wave": 0,
"wave_amplitude": 10,
"wave_length": 50,
"negate": 0,
"charcoal": 0,
"sepia": 0,
"vignette": 0,
"enhance_saturation": 0,
"enhance_contrast": 0
}
""";
HttpClient Client = HttpClient.newBuilder()
.connectTimeout(Duration.ofSeconds(30))
.build();
HttpRequest Request = HttpRequest.newBuilder()
.uri(URI.create(url))
.header("Authorization", "Bearer YOUR_API_TOKEN_HERE")
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString(JsonPayload))
.build();
try
{
HttpResponse Response = Client.send(Request, HttpResponse.BodyHandlers.ofString());
JsonObject ResData = JsonParser.parseString(Response.body()).getAsJsonObject();
String status = ResData.get("status").getAsString();
String message = ResData.get("message").getAsString();
Object data = ResData.has("data") ? ResData.get("data") : null;
}
catch (Exception e)
{
e.printStackTrace();
}
}
}
using System;
using System.Net.Http;
using System.Text;
using Newtonsoft.Json;
public class ApiExample
{
public static async Task Main()
{
using var Client = new HttpClient();
Client.DefaultRequestHeaders.Add("Authorization", "Bearer YOUR_API_TOKEN_HERE");
var json_payload = @"
{
"image": "base64_encoded_image_string_here",
"output_format": "png",
"quality": 85,
"resize_mode": 0,
"resize_percentage": 50,
"resize_width": 800,
"resize_height": 600,
"rotate": 0,
"rotate_background_color": "none",
"crop_mode": 0,
"crop_percentage": 80,
"crop_x": 0,
"crop_y": 0,
"crop_width": 400,
"crop_height": 300,
"flip_mode": 0,
"border_width": 0,
"border_height": 0,
"border_color": "#000000",
"oil_paint": 0,
"polaroid": 0,
"polaroid_angle": 5,
"swirl": 0,
"swirl_amount": 60,
"wave": 0,
"wave_amplitude": 10,
"wave_length": 50,
"negate": 0,
"charcoal": 0,
"sepia": 0,
"vignette": 0,
"enhance_saturation": 0,
"enhance_contrast": 0
}";
var content = new StringContent(json_payload, Encoding.UTF8, "application/json");
var Response = await Client.PostAsync("https://apicentral.dev/Image/multiTool", content);
var Result = await Response.Content.ReadAsStringAsync();
dynamic ResData = JsonConvert.DeserializeObject(Result);
string status = ResData.status;
string message = ResData.message;
object data = ResData.data;
}
}
package main
import (
"bytes"
"encoding/json"
"fmt"
"net/http"
"io"
)
func main() {
JsonPayload := []byte(`
{
"image": "base64_encoded_image_string_here",
"output_format": "png",
"quality": 85,
"resize_mode": 0,
"resize_percentage": 50,
"resize_width": 800,
"resize_height": 600,
"rotate": 0,
"rotate_background_color": "none",
"crop_mode": 0,
"crop_percentage": 80,
"crop_x": 0,
"crop_y": 0,
"crop_width": 400,
"crop_height": 300,
"flip_mode": 0,
"border_width": 0,
"border_height": 0,
"border_color": "#000000",
"oil_paint": 0,
"polaroid": 0,
"polaroid_angle": 5,
"swirl": 0,
"swirl_amount": 60,
"wave": 0,
"wave_amplitude": 10,
"wave_length": 50,
"negate": 0,
"charcoal": 0,
"sepia": 0,
"vignette": 0,
"enhance_saturation": 0,
"enhance_contrast": 0
}`)
Client := &http.Client{}
Request, _ := http.NewRequest("POST", "https://apicentral.dev/Image/multiTool", bytes.NewBuffer(JsonPayload))
Request.Header.Set("Authorization", "Bearer YOUR_API_TOKEN_HERE")
Request.Header.Set("Content-Type", "application/json")
Response, err := Client.Do(Request)
if err != nil {
fmt.Println("Error:", err)
return
}
defer Response.Body.Close()
Body, _ := io.ReadAll(Response.Body)
var ResData map[string]interface{}
json.Unmarshal(Body, &ResData)
status := ResData["status"]
message := ResData["message"]
data := ResData["data"]
fmt.Println(status, message, data)
}
require 'net/http'
require 'uri'
require 'json'
uri = URI('https://apicentral.dev/Image/multiTool')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri)
request['Authorization'] = 'Bearer YOUR_API_TOKEN_HERE'
request['Content-Type'] = 'application/json'
request.body =
{
"image": "base64_encoded_image_string_here",
"output_format": "png",
"quality": 85,
"resize_mode": 0,
"resize_percentage": 50,
"resize_width": 800,
"resize_height": 600,
"rotate": 0,
"rotate_background_color": "none",
"crop_mode": 0,
"crop_percentage": 80,
"crop_x": 0,
"crop_y": 0,
"crop_width": 400,
"crop_height": 300,
"flip_mode": 0,
"border_width": 0,
"border_height": 0,
"border_color": "#000000",
"oil_paint": 0,
"polaroid": 0,
"polaroid_angle": 5,
"swirl": 0,
"swirl_amount": 60,
"wave": 0,
"wave_amplitude": 10,
"wave_length": 50,
"negate": 0,
"charcoal": 0,
"sepia": 0,
"vignette": 0,
"enhance_saturation": 0,
"enhance_contrast": 0
}.to_json
response = http.request(request)
res_data = JSON.parse(response.body)
status = res_data['status']
message = res_data['message']
data = res_data['data']
import Foundation
let url = URL(string: "https://apicentral.dev/Image/multiTool")!
var request = URLRequest(url: url)
request.httpMethod = "POST"
request.setValue("Bearer YOUR_API_TOKEN_HERE", forHTTPHeaderField: "Authorization")
request.setValue("application/json", forHTTPHeaderField: "Content-Type")
let JsonPayload = """
{
"image": "base64_encoded_image_string_here",
"output_format": "png",
"quality": 85,
"resize_mode": 0,
"resize_percentage": 50,
"resize_width": 800,
"resize_height": 600,
"rotate": 0,
"rotate_background_color": "none",
"crop_mode": 0,
"crop_percentage": 80,
"crop_x": 0,
"crop_y": 0,
"crop_width": 400,
"crop_height": 300,
"flip_mode": 0,
"border_width": 0,
"border_height": 0,
"border_color": "#000000",
"oil_paint": 0,
"polaroid": 0,
"polaroid_angle": 5,
"swirl": 0,
"swirl_amount": 60,
"wave": 0,
"wave_amplitude": 10,
"wave_length": 50,
"negate": 0,
"charcoal": 0,
"sepia": 0,
"vignette": 0,
"enhance_saturation": 0,
"enhance_contrast": 0
}
""".data(using: .utf8)!
request.httpBody = JsonPayload
let task = URLSession.shared.dataTask(with: request) { data, response, error in
if let error = error {
print("Error: \(error)")
return
}
guard let data = data else { return }
if let resData = try? JSONSerialization.jsonObject(with: data) as? [String: Any] {
let status = resData["status"] as? String
let message = resData["message"] as? String
let data = resData["data"]
}
}
task.resume()
import java.net.http.HttpClient
import java.net.http.HttpRequest
import java.net.http.HttpResponse
import java.net.URI
import java.time.Duration
import com.google.gson.JsonParser
fun main() {
val url = "https://apicentral.dev/Image/multiTool"
val jsonPayload = """
{
"image": "base64_encoded_image_string_here",
"output_format": "png",
"quality": 85,
"resize_mode": 0,
"resize_percentage": 50,
"resize_width": 800,
"resize_height": 600,
"rotate": 0,
"rotate_background_color": "none",
"crop_mode": 0,
"crop_percentage": 80,
"crop_x": 0,
"crop_y": 0,
"crop_width": 400,
"crop_height": 300,
"flip_mode": 0,
"border_width": 0,
"border_height": 0,
"border_color": "#000000",
"oil_paint": 0,
"polaroid": 0,
"polaroid_angle": 5,
"swirl": 0,
"swirl_amount": 60,
"wave": 0,
"wave_amplitude": 10,
"wave_length": 50,
"negate": 0,
"charcoal": 0,
"sepia": 0,
"vignette": 0,
"enhance_saturation": 0,
"enhance_contrast": 0
}
""".trimIndent()
val client = HttpClient.newBuilder()
.connectTimeout(Duration.ofSeconds(30))
.build()
val request = HttpRequest.newBuilder()
.uri(URI.create(url))
.header("Authorization", "Bearer YOUR_API_TOKEN_HERE")
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString(jsonPayload))
.build()
try {
val response = client.send(request, HttpResponse.BodyHandlers.ofString())
val resData = JsonParser.parseString(response.body()).asJsonObject
val status = resData.get("status").asString
val message = resData.get("message").asString
val data = if (resData.has("data")) resData.get("data") else null
} catch (e: Exception) {
e.printStackTrace()
}
}
import 'dart:convert';
import 'package:http/http.dart' as http;
void main() async {
final url = Uri.parse('https://apicentral.dev/Image/multiTool');
final headers = {
'Authorization': 'Bearer YOUR_API_TOKEN_HERE',
'Content-Type': 'application/json'
};
final body = jsonEncode(
{
"image": "base64_encoded_image_string_here",
"output_format": "png",
"quality": 85,
"resize_mode": 0,
"resize_percentage": 50,
"resize_width": 800,
"resize_height": 600,
"rotate": 0,
"rotate_background_color": "none",
"crop_mode": 0,
"crop_percentage": 80,
"crop_x": 0,
"crop_y": 0,
"crop_width": 400,
"crop_height": 300,
"flip_mode": 0,
"border_width": 0,
"border_height": 0,
"border_color": "#000000",
"oil_paint": 0,
"polaroid": 0,
"polaroid_angle": 5,
"swirl": 0,
"swirl_amount": 60,
"wave": 0,
"wave_amplitude": 10,
"wave_length": 50,
"negate": 0,
"charcoal": 0,
"sepia": 0,
"vignette": 0,
"enhance_saturation": 0,
"enhance_contrast": 0
});
try {
final response = await http.post(url, headers: headers, body: body);
final resData = jsonDecode(response.body);
final status = resData['status'];
final message = resData['message'];
final data = resData['data'];
} catch (e) {
print('Error: $e');
}
}
use reqwest::blocking::Client;
use serde_json::Value;
fn main() -> Result<(), Box> {
let client = Client::new();
let json_payload = r#"
{
"image": "base64_encoded_image_string_here",
"output_format": "png",
"quality": 85,
"resize_mode": 0,
"resize_percentage": 50,
"resize_width": 800,
"resize_height": 600,
"rotate": 0,
"rotate_background_color": "none",
"crop_mode": 0,
"crop_percentage": 80,
"crop_x": 0,
"crop_y": 0,
"crop_width": 400,
"crop_height": 300,
"flip_mode": 0,
"border_width": 0,
"border_height": 0,
"border_color": "#000000",
"oil_paint": 0,
"polaroid": 0,
"polaroid_angle": 5,
"swirl": 0,
"swirl_amount": 60,
"wave": 0,
"wave_amplitude": 10,
"wave_length": 50,
"negate": 0,
"charcoal": 0,
"sepia": 0,
"vignette": 0,
"enhance_saturation": 0,
"enhance_contrast": 0
}
"#;
let response = client
.post("https://apicentral.dev/Image/multiTool")
.header("Authorization", "Bearer YOUR_API_TOKEN_HERE")
.header("Content-Type", "application/json")
.body(json_payload.to_string())
.send()?;
let res_data: Value = serde_json::from_str(&response.text()?)?;
let status = &res_data["status"];
let message = &res_data["message"];
let data = &res_data["data"];
println!("{} {} {:?}", status, message, data);
Ok(())
}
curl -X POST 'https://apicentral.dev/Image/multiTool' \
-H 'Authorization: Bearer YOUR_API_TOKEN_HERE' \
-H 'Content-Type: application/json' \
-d '
{
"image": "base64_encoded_image_string_here",
"output_format": "png",
"quality": 85,
"resize_mode": 0,
"resize_percentage": 50,
"resize_width": 800,
"resize_height": 600,
"rotate": 0,
"rotate_background_color": "none",
"crop_mode": 0,
"crop_percentage": 80,
"crop_x": 0,
"crop_y": 0,
"crop_width": 400,
"crop_height": 300,
"flip_mode": 0,
"border_width": 0,
"border_height": 0,
"border_color": "#000000",
"oil_paint": 0,
"polaroid": 0,
"polaroid_angle": 5,
"swirl": 0,
"swirl_amount": 60,
"wave": 0,
"wave_amplitude": 10,
"wave_length": 50,
"negate": 0,
"charcoal": 0,
"sepia": 0,
"vignette": 0,
"enhance_saturation": 0,
"enhance_contrast": 0
}'