curl -X POST "https://api.actiwapi.com/api/auth/register" \
-H "Content-Type: application/json"
-d '{ "name": "Jane Doe", "email": "owner@acme.com", "password": "SecurePass123!", "confirmPassword": "SecurePass123!", "tenantName": "Acme Corp", "mobile": "919876543210", "captchaId": "uuid", "captchaAnswer": "7"}'
async function callActiwapi() {
const res = await fetch("https://api.actiwapi.com/api/auth/register", {
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify({
"name": "Jane Doe",
"email": "owner@acme.com",
"password": "SecurePass123!",
"confirmPassword": "SecurePass123!",
"tenantName": "Acme Corp",
"mobile": "919876543210",
"captchaId": "uuid",
"captchaAnswer": "7"
}),
});
if (!res.ok) {
throw new Error(await res.text());
}
const data = await res.json();
console.log(data);
}
callActiwapi();
import fetch from "node-fetch";
const res = await fetch("https://api.actiwapi.com/api/auth/register", {
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify({
"name": "Jane Doe",
"email": "owner@acme.com",
"password": "SecurePass123!",
"confirmPassword": "SecurePass123!",
"tenantName": "Acme Corp",
"mobile": "919876543210",
"captchaId": "uuid",
"captchaAnswer": "7"
}),
});
const data = await res.json();
console.log(data);
import requests
response = requests.post(
"https://api.actiwapi.com/api/auth/register",
headers={
"Content-Type": "application/json",
},
json={
"name": "Jane Doe",
"email": "owner@acme.com",
"password": "SecurePass123!",
"confirmPassword": "SecurePass123!",
"tenantName": "Acme Corp",
"mobile": "919876543210",
"captchaId": "uuid",
"captchaAnswer": "7"
},
)
print(response.json())
require "net/http"
require "uri"
uri = URI("https://api.actiwapi.com/api/auth/register")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == "https"
request = Net::HTTP::Post.new(uri)
request["Content-Type"] = "application/json"
request.body = "{ \"name\": \"Jane Doe\", \"email\": \"owner@acme.com\", \"password\": \"SecurePass123!\", \"confirmPassword\": \"SecurePass123!\", \"tenantName\": \"Acme Corp\", \"mobile\": \"919876543210\", \"captchaId\": \"uuid\", \"captchaAnswer\": \"7\"}"
response = http.request(request)
puts response.body
$ch = curl_init("https://api.actiwapi.com/api/auth/register");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
CURLOPT_POSTFIELDS => '{ "name": "Jane Doe", "email": "owner@acme.com", "password": "SecurePass123!", "confirmPassword": "SecurePass123!", "tenantName": "Acme Corp", "mobile": "919876543210", "captchaId": "uuid", "captchaAnswer": "7"}',
CURLOPT_RETURNTRANSFER => true,
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
<?php
use Illuminate\Support\Facades\Http;
$headers = [
'Content-Type' => 'application/json',
];
$response = Http::withHeaders($headers)->post("https://api.actiwapi.com/api/auth/register", json_decode('{ "name": "Jane Doe", "email": "owner@acme.com", "password": "SecurePass123!", "confirmPassword": "SecurePass123!", "tenantName": "Acme Corp", "mobile": "919876543210", "captchaId": "uuid", "captchaAnswer": "7"}', true));
$response->throw();
$data = $response->json();
dump($data);
using System.Net.Http;
using System.Text;
using var client = new HttpClient();
var url = "https://api.actiwapi.com/api/auth/register";
var content = new StringContent("""
{ "name": "Jane Doe", "email": "owner@acme.com", "password": "SecurePass123!", "confirmPassword": "SecurePass123!", "tenantName": "Acme Corp", "mobile": "919876543210", "captchaId": "uuid", "captchaAnswer": "7"}
""", Encoding.UTF8, "application/json");
var response = await client.PostAsync(url, content);
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
// .NET 8 — IHttpClientFactory style
using System.Net.Http.Json;
using System.Text;
using System.Text.Json;
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddHttpClient("Actiwapi", client =>
{
});
var app = builder.Build();
app.MapPost("/proxy", async (IHttpClientFactory factory) =>
{
var client = factory.CreateClient("Actiwapi");
var content = new StringContent("""
{ "name": "Jane Doe", "email": "owner@acme.com", "password": "SecurePass123!", "confirmPassword": "SecurePass123!", "tenantName": "Acme Corp", "mobile": "919876543210", "captchaId": "uuid", "captchaAnswer": "7"}
""", Encoding.UTF8, "application/json");
var request = new HttpRequestMessage(new HttpMethod("POST"), "https://api.actiwapi.com/api/auth/register")
{
Content = content,
};
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
return Results.Content(await response.Content.ReadAsStringAsync(), "application/json");
});
app.Run();
package main
import (
"bytes"
"fmt"
"io"
"net/http"
)
func main() {
payload := []byte(`{ "name": "Jane Doe", "email": "owner@acme.com", "password": "SecurePass123!", "confirmPassword": "SecurePass123!", "tenantName": "Acme Corp", "mobile": "919876543210", "captchaId": "uuid", "captchaAnswer": "7"}`)
req, err := http.NewRequest("POST", "https://api.actiwapi.com/api/auth/register", bytes.NewBuffer(payload))
if err != nil {
panic(err)
}
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
data, _ := io.ReadAll(res.Body)
fmt.Println(string(data))
}
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.actiwapi.com/api/auth/register"))
.method("POST", HttpRequest.BodyPublishers.ofString("{ \"name\": \"Jane Doe\", \"email\": \"owner@acme.com\", \"password\": \"SecurePass123!\", \"confirmPassword\": \"SecurePass123!\", \"tenantName\": \"Acme Corp\", \"mobile\": \"919876543210\", \"captchaId\": \"uuid\", \"captchaAnswer\": \"7\"}"))
.header("Content-Type", "application/json")
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());