This creates a subject profile using method. The weightage for this API is 10
Creates a new subject profile under the given instance.
{
"Data": "did:key:z6MkoMGS7TnPJ9yykW1uPVeyviA1i6Ly5zn5PnbHAr9agaGS",
"Message": "Subject Profile Created",
"Status": "SUCCESS"
}
{
"Data": null,
"Message": "Please Provide Valid DID Method Type",
"Status": "FAILURE"
}
Take a look at how you might call this method using our official libraries, or via curl
:
curl --location 'https://api.krypcore.com/api/v0/did/createSubjectProfile' \
--header 'Authorization: xxxxxxxxxxxxx' \
--header 'DappId: xxxxxxxxxxxxx' \
--header 'Content-Type: application/json' \
--data-raw '{
"method": "key",
"subjectDescription": "xxx",
"subjectId": "xxx@gmail.com",
"subjectName": "xxx"
}'
const axios = require('axios');
let data = JSON.stringify({
"method": "key",
"subjectDescription": "xxx",
"subjectId": "xxx@gmail.com",
"subjectName": "xxx"
});
let config = {
method: 'post',
maxBodyLength: Infinity,
url: 'https://api.krypcore.com/api/v0/did/createSubjectProfile',
headers: {
'Authorization': 'xxxxxxxxxxxxx',
'DappId': 'xxxxxxxxxxxxx',
'Content-Type': 'application/json'
},
data : data
};
axios.request(config)
.then((response) => {
console.log(JSON.stringify(response.data));
})
.catch((error) => {
console.log(error);
});
import requests
import json
url = "https://api.krypcore.com/api/v0/did/createSubjectProfile"
payload = json.dumps({
"method": "key",
"subjectDescription": "xxx",
"subjectId": "xxx@gmail.com",
"subjectName": "xxx"
})
headers = {
'Authorization': 'xxxxxxxxxxxxx',
'DappId': 'xxxxxxxxxxxxx',
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.krypcore.com/api/v0/did/createSubjectProfile"
method := "POST"
payload := strings.NewReader(`{
"method": "key",
"subjectDescription": "xxx",
"subjectId": "xxx@gmail.com",
"subjectName": "xxx"
}`)
client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("Authorization", "xxxxxxxxxxxxx")
req.Header.Add("DappId", "xxxxxxxxxxxxx")
req.Header.Add("Content-Type", "application/json")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}