curl -X POST "https://{host}/registerDevice" \
-H "Content-Type: application/json" \
-H "x-bsv-auth-identity-key: <x-bsv-auth-identity-key>" \
-d '{
"fcmToken": "string",
"deviceId": "string",
"platform": "ios"
}' const response = await fetch ( `https://{host}/registerDevice` , {
method: 'POST' ,
headers: { 'Content-Type' : 'application/json' , 'x-bsv-auth-identity-key' : '<x-bsv-auth-identity-key>' },
body: JSON . stringify ({
"fcmToken" : "string" ,
"deviceId" : "string" ,
"platform" : "ios"
})
});
const data = await response. json (); import requests
response = requests.request(
"POST" ,
"https:// {host} /registerDevice" ,
headers = { "x-bsv-auth-identity-key" : "<x-bsv-auth-identity-key>" },
json = {
"fcmToken" : "string" ,
"deviceId" : "string" ,
"platform" : "ios"
},
)
data = response.json() <? php
$ch = curl_init ();
curl_setopt ($ch, CURLOPT_URL , "https://{host}/registerDevice" );
curl_setopt ($ch, CURLOPT_RETURNTRANSFER , true );
curl_setopt ($ch, CURLOPT_CUSTOMREQUEST , "POST" );
curl_setopt ($ch, CURLOPT_HTTPHEADER , [ "Content-Type: application/json" , "x-bsv-auth-identity-key: <x-bsv-auth-identity-key>" ]);
curl_setopt ($ch, CURLOPT_POSTFIELDS , '{
"fcmToken": "string",
"deviceId": "string",
"platform": "ios"
}' );
$response = curl_exec ($ch);
curl_close ($ch); package main
import (
" fmt "
" io "
" net/http "
" strings "
)
func main () {
req, _ := http. NewRequest ( "POST" , "https://{host}/registerDevice" , strings. NewReader ( `{
"fcmToken": "string",
"deviceId": "string",
"platform": "ios"
}` ))
req.Header. Set ( "Content-Type" , "application/json" )
req.Header. Set ( "x-bsv-auth-identity-key" , "<x-bsv-auth-identity-key>" )
resp, err := http.DefaultClient. Do (req)
if err != nil {
panic (err)
}
defer resp.Body. Close ()
data, _ := io. ReadAll (resp.Body)
fmt. Println ( string (data))
} HttpClient client = HttpClient. newHttpClient ();
HttpRequest request = HttpRequest. newBuilder ()
. uri (URI. create ( "https://{host}/registerDevice" ))
. header ( "Content-Type" , "application/json" )
. header ( "x-bsv-auth-identity-key" , "<x-bsv-auth-identity-key>" )
. method ( "POST" , HttpRequest.BodyPublishers. ofString ( "{ \n \" fcmToken \" : \" string \" , \n \" deviceId \" : \" string \" , \n \" platform \" : \" ios \"\n }" ))
. build ();
HttpResponse< String > response = client. send (request, HttpResponse.BodyHandlers. ofString ());
System.out. println (response. body ()); require "net/http"
require "uri"
uri = URI ( "https://{host}/registerDevice" )
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[ "x-bsv-auth-identity-key" ] = "<x-bsv-auth-identity-key>"
request. body = "{ \n \" fcmToken \" : \" string \" , \n \" deviceId \" : \" string \" , \n \" platform \" : \" ios \"\n }"
response = http. request (request)
puts response. body ⧉