200: OK If webhook is not set 200: OK If webhook is provided 400: Bad Request 401: Unauthorized 500: Internal Server Error
Copy {
"base64" : "<base64 encoded image>" ,
"status" : "success"
}
Copy {
"status" : "pending" ,
"id" : "xxxxxxxxxxxxxx" , // You can use that id with Get Job
"mode" : "upscale"
}
CURL Node.js Python PHP GO Ruby
Copy
curl --location 'https://europe-west1-gepettoai.cloudfunctions.net/v1/upscale' \
--header 'Authorization: Bearer {{API_KEY}}' \
--header 'Content-Type: application/json' \
--data '{
"url": "https://thumbs.dreamstime.com/b/empty-room-26533582.jpg"
}'
Copy var myHeaders = new Headers ();
myHeaders .append ( "Authorization" , "Bearer {{API_KEY}}" );
myHeaders .append ( "Content-Type" , "application/json" );
var requestOptions = {
method : 'POST' ,
headers : myHeaders ,
body : JSON .stringify ({
"url" : "https://thumbs.dreamstime.com/b/empty-room-26533582.jpg"
})
};
const response = await fetch ( "https://europe-west1-gepettoai.cloudfunctions.net/v1/upscale" , requestOptions)
const body = await reponse .json ();
console .log (body)
Copy import requests
import json
url = "https://europe-west1-gepettoai.cloudfunctions.net/v1/upscale"
payload = json . dumps ({
"url" : "https://thumbs.dreamstime.com/b/empty-room-26533582.jpg"
})
headers = {
'Authorization' : 'Bearer {{ API_KEY }} ' ,
'Content-Type' : 'application/json'
}
response = requests . request ( "POST" , url, headers = headers, data = payload)
print (response.text)
Copy <? php
$client = new Client ();
$headers = [
'Authorization' => 'Bearer {{API_KEY}}' ,
'Content-Type' => 'application/json'
];
$body = '{
"url": "https://thumbs.dreamstime.com/b/empty-room-26533582.jpg"
}' ;
$request = new Request ( 'POST' , 'https://europe-west1-gepettoai.cloudfunctions.net/v1/upscale' , $headers , $body);
$res = $client -> sendAsync ( $request ) -> wait () ;
echo $res -> getBody () ;
Copy package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main () {
url := "https://europe-west1-gepettoai.cloudfunctions.net/v1/upscale"
method := "POST"
payload := strings. NewReader ( `{
"url": "https://thumbs.dreamstime.com/b/empty-room-26533582.jpg"
}` )
client := & http.Client {}
req, err := http. NewRequest (method, url, payload)
if err != nil {
fmt. Println (err)
return
}
req.Header. Add ( "Authorization" , "Bearer {{API_KEY}}" )
req.Header. Add ( "Content-Type" , "application/json" )
res, err := client. Do (req)
if err != nil {
fmt. Println (err)
return
}
defer res.Body. Close ()
body, err := ioutil. ReadAll (res.Body)
if err != nil {
fmt. Println (err)
return
}
fmt. Println ( string (body))
}
Copy require "uri"
require "json"
require "net/http"
url = URI ( "https://europe-west1-gepettoai.cloudfunctions.net/v1/upscale" )
https = Net :: HTTP . new (url . host , url . port)
https . use_ssl = true
request = Net :: HTTP :: Post . new (url)
request[ "Authorization" ] = "Bearer {{API_KEY}}"
request[ "Content-Type" ] = "application/json"
request . body = JSON . dump({
"url" : "https://thumbs.dreamstime.com/b/empty-room-26533582.jpg"
})
response = https . request(request)
puts response . read_body