post__register
Last updated
Was this helpful?
Was this helpful?
public nodeRegister = async (data: RegisterRequest): Promise<RegisterResponse> => {
return this.makeRequest<RegisterResponse>('register', 'POST', data);
};# You can also use wget
curl -X POST https://backend.flashback.tech/register \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d '{
"provider": "S3",
"ip": "192.168.1.100",
"status": "active",
"region": "us-east-1",
"version": "1.0.0",
"timestamp": "2024-01-15T10:30:00.000Z",
"signature": "base64-encoded-signature",
"id_org": "org-123e4567-e89b-12d3-a456-426614174000"
}'POST https://backend.flashback.tech/register HTTP/1.1
Host: localhost:3000
Content-Type: application/json
Accept: application/json
{
"provider": "S3",
"ip": "192.168.1.100",
"status": "active",
"region": "us-east-1",
"version": "1.0.0",
"timestamp": "2024-01-15T10:30:00.000Z",
"signature": "base64-encoded-signature",
"id_org": "org-123e4567-e89b-12d3-a456-426614174000"
}const inputBody = {
"provider": "S3",
"ip": "192.168.1.100",
"status": "active",
"region": "us-east-1",
"version": "1.0.0",
"timestamp": "2024-01-15T10:30:00.000Z",
"signature": "base64-encoded-signature",
"id_org": "org-123e4567-e89b-12d3-a456-426614174000"
};
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('https://backend.flashback.tech/register',
{
method: 'POST',
body: JSON.stringify(inputBody),
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json'
}
body = {
'provider' => 'S3',
'ip' => '192.168.1.100',
'status' => 'active',
'region' => 'us-east-1',
'version' => '1.0.0',
'timestamp' => '2024-01-15T10:30:00.000Z',
'signature' => 'base64-encoded-signature',
'id_org' => 'org-123e4567-e89b-12d3-a456-426614174000'
}
result = RestClient.post 'https://backend.flashback.tech/register',
body.to_json, headers: headers
p JSON.parse(result)import requests
import json
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
body = {
'provider': 'S3',
'ip': '192.168.1.100',
'status': 'active',
'region': 'us-east-1',
'version': '1.0.0',
'timestamp': '2024-01-15T10:30:00.000Z',
'signature': 'base64-encoded-signature',
'id_org': 'org-123e4567-e89b-12d3-a456-426614174000'
}
r = requests.post('https://backend.flashback.tech/register',
headers=headers,
data=json.dumps(body))
print(r.json())<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/json',
'Accept' => 'application/json',
);
$body = array(
'provider' => 'S3',
'ip' => '192.168.1.100',
'status' => 'active',
'region' => 'us-east-1',
'version' => '1.0.0',
'timestamp' => '2024-01-15T10:30:00.000Z',
'signature' => 'base64-encoded-signature',
'id_org' => 'org-123e4567-e89b-12d3-a456-426614174000'
);
$client = new \GuzzleHttp\Client();
try {
$response = $client->request('POST','https://backend.flashback.tech/register', array(
'headers' => $headers,
'json' => $body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...URL obj = new URL("https://backend.flashback.tech/register");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
con.setRequestProperty("Content-Type", "application/json");
con.setRequestProperty("Accept", "application/json");
String jsonInputString = "{\"provider\":\"S3\",\"ip\":\"192.168.1.100\",\"status\":\"active\",\"region\":\"us-east-1\",\"version\":\"1.0.0\",\"timestamp\":\"2024-01-15T10:30:00.000Z\",\"signature\":\"base64-encoded-signature\",\"id_org\":\"org-123e4567-e89b-12d3-a456-426614174000\"}";
con.setDoOutput(true);
try(OutputStream os = con.getOutputStream()) {
byte[] input = jsonInputString.getBytes("utf-8");
os.write(input, 0, input.length);
}
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());package main
import (
"bytes"
"net/http"
"encoding/json"
)
func main() {
body := map[string]interface{}{
"provider": "S3",
"ip": "192.168.1.100",
"status": "active",
"region": "us-east-1",
"version": "1.0.0",
"timestamp": "2024-01-15T10:30:00.000Z",
"signature": "base64-encoded-signature",
"id_org": "org-123e4567-e89b-12d3-a456-426614174000",
}
jsonData, _ := json.Marshal(body)
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
}
data := bytes.NewBuffer(jsonData)
req, err := http.NewRequest("POST", "https://backend.flashback.tech/register", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}{
"provider": "S3",
"ip": "192.168.1.100",
"status": "active",
"region": "us-east-1",
"version": "1.0.0",
"timestamp": "2024-01-15T10:30:00.000Z",
"signature": "base64-encoded-signature",
"id_org": "org-123e4567-e89b-12d3-a456-426614174000"
}{
"success": true,
"message": "Registration successful"
}{
"success": false,
"message": "Missing required fields"
}