APIs
...
Users
Create a new portal user
code examples curl location 'https //profile backend detected app/api/v2/public/portal users' \\ \ header 'accept application/json' \\ \ header 'content type application/json' \\ \ data raw '{ "email" "example\@test in" }'var myheaders = new headers(); myheaders append("accept", "application/json"); myheaders append("content type", "application/json"); var raw = json stringify({ "email" "example\@test in" }); var requestoptions = { method 'post', headers myheaders, body raw, redirect 'follow' }; fetch("https //profile backend detected app/api/v2/public/portal users", requestoptions) then(response => response text()) then(result => console log(result)) catch(error => console log('error', error));require "uri" require "json" require "net/http" url = uri("https //profile backend detected app/api/v2/public/portal users") https = net http new(url host, url port) https use ssl = true request = net http post new(url) request\["accept"] = "application/json" request\["content type"] = "application/json" request body = json dump({ "email" "example\@test in" }) response = https request(request) puts response read body import requests import json url = "https //profile backend detected app/api/v2/public/portal users" payload = json dumps({ "email" "example\@test in" }) headers = { 'accept' 'application/json', 'content type' 'application/json' } response = requests request("post", url, headers=headers, data=payload) print(response text) responses // created { "data" { "id" 10291, "name" "jonathan", "email" "example\@email com", "profiles" \[ { "id" "01029301n 12312091 12", "name" "financial ltd", "role" "admin" } ], "updated at" "2024 07 16 14 52 33", "created at" "2024 07 16 14 52 33" } }// unauthorized { "message" "unauthenticated " }// unprocessable content { "message" "the example field code is required ", "example field" \[ "the example field has already been taken " ] }// too many requests { "message" "too many attempts " }