UUID Generation API
GET
Generate a random UUID (v4). (GET)
{{baseUrl}}/uuid/version/:version
HEADERS
X-Fungenerators-Api-Secret
{{apiKey}}
QUERY PARAMS
version
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/uuid/version/:version");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-fungenerators-api-secret: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/uuid/version/:version" {:headers {:x-fungenerators-api-secret "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/uuid/version/:version"
headers = HTTP::Headers{
"x-fungenerators-api-secret" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/uuid/version/:version"),
Headers =
{
{ "x-fungenerators-api-secret", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/uuid/version/:version");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-fungenerators-api-secret", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/uuid/version/:version"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-fungenerators-api-secret", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/uuid/version/:version HTTP/1.1
X-Fungenerators-Api-Secret: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/uuid/version/:version")
.setHeader("x-fungenerators-api-secret", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/uuid/version/:version"))
.header("x-fungenerators-api-secret", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/uuid/version/:version")
.get()
.addHeader("x-fungenerators-api-secret", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/uuid/version/:version")
.header("x-fungenerators-api-secret", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/uuid/version/:version');
xhr.setRequestHeader('x-fungenerators-api-secret', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/uuid/version/:version',
headers: {'x-fungenerators-api-secret': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/uuid/version/:version';
const options = {method: 'GET', headers: {'x-fungenerators-api-secret': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/uuid/version/:version',
method: 'GET',
headers: {
'x-fungenerators-api-secret': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/uuid/version/:version")
.get()
.addHeader("x-fungenerators-api-secret", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/uuid/version/:version',
headers: {
'x-fungenerators-api-secret': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/uuid/version/:version',
headers: {'x-fungenerators-api-secret': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/uuid/version/:version');
req.headers({
'x-fungenerators-api-secret': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/uuid/version/:version',
headers: {'x-fungenerators-api-secret': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/uuid/version/:version';
const options = {method: 'GET', headers: {'x-fungenerators-api-secret': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-fungenerators-api-secret": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/uuid/version/:version"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/uuid/version/:version" in
let headers = Header.add (Header.init ()) "x-fungenerators-api-secret" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/uuid/version/:version",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-fungenerators-api-secret: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/uuid/version/:version', [
'headers' => [
'x-fungenerators-api-secret' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/uuid/version/:version');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'x-fungenerators-api-secret' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/uuid/version/:version');
$request->setRequestMethod('GET');
$request->setHeaders([
'x-fungenerators-api-secret' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-fungenerators-api-secret", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/uuid/version/:version' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-fungenerators-api-secret", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/uuid/version/:version' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-fungenerators-api-secret': "{{apiKey}}" }
conn.request("GET", "/baseUrl/uuid/version/:version", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/uuid/version/:version"
headers = {"x-fungenerators-api-secret": "{{apiKey}}"}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/uuid/version/:version"
response <- VERB("GET", url, add_headers('x-fungenerators-api-secret' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/uuid/version/:version")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-fungenerators-api-secret"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/uuid/version/:version') do |req|
req.headers['x-fungenerators-api-secret'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/uuid/version/:version";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-fungenerators-api-secret", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/uuid/version/:version \
--header 'x-fungenerators-api-secret: {{apiKey}}'
http GET {{baseUrl}}/uuid/version/:version \
x-fungenerators-api-secret:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'x-fungenerators-api-secret: {{apiKey}}' \
--output-document \
- {{baseUrl}}/uuid/version/:version
import Foundation
let headers = ["x-fungenerators-api-secret": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/uuid/version/:version")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"success": {
"total": 4
},
"contents": {
"uuid": [
{
"uuid": "b201b88e-b0d2-4e82-9ea8-d2d1e25b3bd0",
"version": 4
},
{
"uuid": "75becbbb-ae68-4e1a-95b1-c2dfc7a5891a",
"version": 4
},
{
"uuid": "3cffa9ad-00a9-4d7a-87f3-85626808444f",
"version": 4
},
{
"uuid": "d2c477c2-a2e3-463a-a3c5-0f131c9826c2",
"version": 4
}
],
"copyright": {
"year": "2020",
"url": " https://fungenerators.com/random/uuid"
}
}
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": {
"code": 401,
"message": "Unauthorized"
}
}
GET
Generate a random UUID (v4).
{{baseUrl}}/uuid
HEADERS
X-Fungenerators-Api-Secret
{{apiKey}}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/uuid");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-fungenerators-api-secret: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/uuid" {:headers {:x-fungenerators-api-secret "{{apiKey}}"}})
require "http/client"
url = "{{baseUrl}}/uuid"
headers = HTTP::Headers{
"x-fungenerators-api-secret" => "{{apiKey}}"
}
response = HTTP::Client.get url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/uuid"),
Headers =
{
{ "x-fungenerators-api-secret", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/uuid");
var request = new RestRequest("", Method.Get);
request.AddHeader("x-fungenerators-api-secret", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/uuid"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-fungenerators-api-secret", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/uuid HTTP/1.1
X-Fungenerators-Api-Secret: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/uuid")
.setHeader("x-fungenerators-api-secret", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/uuid"))
.header("x-fungenerators-api-secret", "{{apiKey}}")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/uuid")
.get()
.addHeader("x-fungenerators-api-secret", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/uuid")
.header("x-fungenerators-api-secret", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/uuid');
xhr.setRequestHeader('x-fungenerators-api-secret', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/uuid',
headers: {'x-fungenerators-api-secret': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/uuid';
const options = {method: 'GET', headers: {'x-fungenerators-api-secret': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/uuid',
method: 'GET',
headers: {
'x-fungenerators-api-secret': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/uuid")
.get()
.addHeader("x-fungenerators-api-secret", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/uuid',
headers: {
'x-fungenerators-api-secret': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'GET',
url: '{{baseUrl}}/uuid',
headers: {'x-fungenerators-api-secret': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/uuid');
req.headers({
'x-fungenerators-api-secret': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'GET',
url: '{{baseUrl}}/uuid',
headers: {'x-fungenerators-api-secret': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/uuid';
const options = {method: 'GET', headers: {'x-fungenerators-api-secret': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-fungenerators-api-secret": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/uuid"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/uuid" in
let headers = Header.add (Header.init ()) "x-fungenerators-api-secret" "{{apiKey}}" in
Client.call ~headers `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/uuid",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-fungenerators-api-secret: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/uuid', [
'headers' => [
'x-fungenerators-api-secret' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/uuid');
$request->setMethod(HTTP_METH_GET);
$request->setHeaders([
'x-fungenerators-api-secret' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/uuid');
$request->setRequestMethod('GET');
$request->setHeaders([
'x-fungenerators-api-secret' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-fungenerators-api-secret", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/uuid' -Method GET -Headers $headers
$headers=@{}
$headers.Add("x-fungenerators-api-secret", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/uuid' -Method GET -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-fungenerators-api-secret': "{{apiKey}}" }
conn.request("GET", "/baseUrl/uuid", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/uuid"
headers = {"x-fungenerators-api-secret": "{{apiKey}}"}
response = requests.get(url, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/uuid"
response <- VERB("GET", url, add_headers('x-fungenerators-api-secret' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/uuid")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-fungenerators-api-secret"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/uuid') do |req|
req.headers['x-fungenerators-api-secret'] = '{{apiKey}}'
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/uuid";
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-fungenerators-api-secret", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.get(url)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/uuid \
--header 'x-fungenerators-api-secret: {{apiKey}}'
http GET {{baseUrl}}/uuid \
x-fungenerators-api-secret:'{{apiKey}}'
wget --quiet \
--method GET \
--header 'x-fungenerators-api-secret: {{apiKey}}' \
--output-document \
- {{baseUrl}}/uuid
import Foundation
let headers = ["x-fungenerators-api-secret": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/uuid")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"success": {
"total": 4
},
"contents": {
"uuid": [
{
"uuid": "b201b88e-b0d2-4e82-9ea8-d2d1e25b3bd0",
"version": 4
},
{
"uuid": "75becbbb-ae68-4e1a-95b1-c2dfc7a5891a",
"version": 4
},
{
"uuid": "3cffa9ad-00a9-4d7a-87f3-85626808444f",
"version": 4
},
{
"uuid": "d2c477c2-a2e3-463a-a3c5-0f131c9826c2",
"version": 4
}
],
"copyright": {
"year": "2020",
"url": " https://fungenerators.com/random/uuid"
}
}
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": {
"code": 401,
"message": "Unauthorized"
}
}
POST
Parse a UUID string and return its version and check whether it is valid.
{{baseUrl}}/uuid
HEADERS
X-Fungenerators-Api-Secret
{{apiKey}}
QUERY PARAMS
uuidstr
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/uuid?uuidstr=");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "x-fungenerators-api-secret: {{apiKey}}");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/uuid" {:headers {:x-fungenerators-api-secret "{{apiKey}}"}
:query-params {:uuidstr ""}})
require "http/client"
url = "{{baseUrl}}/uuid?uuidstr="
headers = HTTP::Headers{
"x-fungenerators-api-secret" => "{{apiKey}}"
}
response = HTTP::Client.post url, headers: headers
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/uuid?uuidstr="),
Headers =
{
{ "x-fungenerators-api-secret", "{{apiKey}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/uuid?uuidstr=");
var request = new RestRequest("", Method.Post);
request.AddHeader("x-fungenerators-api-secret", "{{apiKey}}");
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/uuid?uuidstr="
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("x-fungenerators-api-secret", "{{apiKey}}")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/uuid?uuidstr= HTTP/1.1
X-Fungenerators-Api-Secret: {{apiKey}}
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/uuid?uuidstr=")
.setHeader("x-fungenerators-api-secret", "{{apiKey}}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/uuid?uuidstr="))
.header("x-fungenerators-api-secret", "{{apiKey}}")
.method("POST", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/uuid?uuidstr=")
.post(null)
.addHeader("x-fungenerators-api-secret", "{{apiKey}}")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/uuid?uuidstr=")
.header("x-fungenerators-api-secret", "{{apiKey}}")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/uuid?uuidstr=');
xhr.setRequestHeader('x-fungenerators-api-secret', '{{apiKey}}');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/uuid',
params: {uuidstr: ''},
headers: {'x-fungenerators-api-secret': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/uuid?uuidstr=';
const options = {method: 'POST', headers: {'x-fungenerators-api-secret': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/uuid?uuidstr=',
method: 'POST',
headers: {
'x-fungenerators-api-secret': '{{apiKey}}'
}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/uuid?uuidstr=")
.post(null)
.addHeader("x-fungenerators-api-secret", "{{apiKey}}")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/uuid?uuidstr=',
headers: {
'x-fungenerators-api-secret': '{{apiKey}}'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/uuid',
qs: {uuidstr: ''},
headers: {'x-fungenerators-api-secret': '{{apiKey}}'}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/uuid');
req.query({
uuidstr: ''
});
req.headers({
'x-fungenerators-api-secret': '{{apiKey}}'
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/uuid',
params: {uuidstr: ''},
headers: {'x-fungenerators-api-secret': '{{apiKey}}'}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/uuid?uuidstr=';
const options = {method: 'POST', headers: {'x-fungenerators-api-secret': '{{apiKey}}'}};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"x-fungenerators-api-secret": @"{{apiKey}}" };
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/uuid?uuidstr="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/uuid?uuidstr=" in
let headers = Header.add (Header.init ()) "x-fungenerators-api-secret" "{{apiKey}}" in
Client.call ~headers `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/uuid?uuidstr=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"x-fungenerators-api-secret: {{apiKey}}"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/uuid?uuidstr=', [
'headers' => [
'x-fungenerators-api-secret' => '{{apiKey}}',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/uuid');
$request->setMethod(HTTP_METH_POST);
$request->setQueryData([
'uuidstr' => ''
]);
$request->setHeaders([
'x-fungenerators-api-secret' => '{{apiKey}}'
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/uuid');
$request->setRequestMethod('POST');
$request->setQuery(new http\QueryString([
'uuidstr' => ''
]));
$request->setHeaders([
'x-fungenerators-api-secret' => '{{apiKey}}'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("x-fungenerators-api-secret", "{{apiKey}}")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/uuid?uuidstr=' -Method POST -Headers $headers
$headers=@{}
$headers.Add("x-fungenerators-api-secret", "{{apiKey}}")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/uuid?uuidstr=' -Method POST -Headers $headers
import http.client
conn = http.client.HTTPSConnection("example.com")
headers = { 'x-fungenerators-api-secret': "{{apiKey}}" }
conn.request("POST", "/baseUrl/uuid?uuidstr=", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/uuid"
querystring = {"uuidstr":""}
headers = {"x-fungenerators-api-secret": "{{apiKey}}"}
response = requests.post(url, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/uuid"
queryString <- list(uuidstr = "")
response <- VERB("POST", url, query = queryString, add_headers('x-fungenerators-api-secret' = '{{apiKey}}'), content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/uuid?uuidstr=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-fungenerators-api-secret"] = '{{apiKey}}'
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.post('/baseUrl/uuid') do |req|
req.headers['x-fungenerators-api-secret'] = '{{apiKey}}'
req.params['uuidstr'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/uuid";
let querystring = [
("uuidstr", ""),
];
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("x-fungenerators-api-secret", "{{apiKey}}".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.query(&querystring)
.headers(headers)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/uuid?uuidstr=' \
--header 'x-fungenerators-api-secret: {{apiKey}}'
http POST '{{baseUrl}}/uuid?uuidstr=' \
x-fungenerators-api-secret:'{{apiKey}}'
wget --quiet \
--method POST \
--header 'x-fungenerators-api-secret: {{apiKey}}' \
--output-document \
- '{{baseUrl}}/uuid?uuidstr='
import Foundation
let headers = ["x-fungenerators-api-secret": "{{apiKey}}"]
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/uuid?uuidstr=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"success": {
"total": 1
},
"contents": {
"uuid": [
{
"is_valid": true,
"uuid": "14cdb9b4-de01-3faa-aff5-65bc2f771745",
"version": 3
}
],
"copyright": {
"year": "2020",
"url": " https://fungenerators.com/random/uuid"
}
}
}
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{
"error": {
"code": 401,
"message": "Unauthorized"
}
}