Introduction to iGrant.io APIs v2.1.6
Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.
This specification is documented in OpenAPI format, it describes the RESTFul APIs of iGrant.io.
iGrant.io offers one form of authentication - Bearer authentication
This form of authentication is a form of authentication scheme that involves security tokens. The client sends this token in the Authorization header when making request.
Base URLs:
Identity management
Identity management handles authentication and authorisation of individuals and organisation admins (further split to owners, admins, developers and dpo roles). It also supports federated identity management with OpenID Connect and SAML.
It uses HTTP Authentication and scheme: bearer
Login as user
Code samples
# You can also use wget
curl -X POST https://api.igrant.io/v1/v1.1/users/login \
-H 'Content-Type: application/json' \
-H 'Accept: application/json'
POST https://api.igrant.io/v1/v1.1/users/login HTTP/1.1
Host: api.igrant.io
Content-Type: application/json
Accept: application/json
const inputBody = '{
"username": "string",
"password": "pa$$word"
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('https://api.igrant.io/v1/v1.1/users/login',
{
method: 'POST',
body: 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'
}
result = RestClient.post 'https://api.igrant.io/v1/v1.1/users/login',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
r = requests.post('https://api.igrant.io/v1/v1.1/users/login', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/json',
'Accept' => 'application/json',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','https://api.igrant.io/v1/v1.1/users/login', array(
'headers' => $headers,
'json' => $request_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://api.igrant.io/v1/v1.1/users/login");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
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"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://api.igrant.io/v1/v1.1/users/login", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /v1.1/users/login
Login as user
Body parameter
{
"username": "string",
"password": "pa$$word"
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | object | false | Login credentials |
» username | body | string | true | none |
» password | body | string(password) | true | none |
Example responses
200 Response
{
"User": {
"ID": "5daf22cea531351111afc7c8",
"Name": "George Floyd",
"IamID": "9d8c4h69-9fb2-4115-a4c3-53bddb8f2d7f",
"Email": "dmart@yopmail.com",
"Phone": "+46 7252 98991",
"ImageID": "5f1458a5chaa930001e78f12",
"ImageURL": "https:/<server-url>/image/5f1458a5chaa930001e78f12",
"LastVisit": "2020-07-22T18:04:02Z",
"Client": {
"Token": "fEkxEwh4T2mr-B4yQoZ9TT:APA91bHibhwLXkc2l6LxWxHW5TrKBoLrXGCHDO6A9pXQ0ShvDYPfxXm57D8tIsR-fwybjs-_OFXCgCbBQpYVON2svUiooWgJBFETXg_jUGy0B9etUHFnyuCbXPihyoCuJc2Gn6s9XkN_",
"Type": 2
},
"Orgs": [
{
"OrgID": "5dae2a9fa1215e00012103e4",
"Name": "Nordea Bank AB",
"Location": "Stockholm, Sweden",
"Type": "Banking and Finance",
"TypeID": "5d95a566a67c8800012f27d1",
"EulaAccepted": false
}
],
"APIKey": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyaWQiOiI1ZGFmMjJjZWE1MzEzNTAwMDFhZmM3YzgiLCJleHAiOjE2MDQwNjMwNjV9.Irk0XgXfVhIdlgBNz6ggEXlvoIPtzUzJv4-x0VKYBGE",
"Roles": [
{
"RoleID": 1,
"OrgID": "5daf22d0a531350001afc7c9"
}
]
},
"Token": {
"access_token": "eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJDeHhVYTVaQ2NnaENxQUxTZy1wbFVYUkJlNE1ERG9zamF0enNYa1lqMEtFIn0.eyJqdGkiOiIzZDM0NDk3Zi05NDYxLTQyZDItYjA0My01ZTU2MTVhOTg0ODYiLCJleHAiOjE1OTU2MTAwMjksIm5iZiI6MCwiaWF0IjoxNTk1NTg4NDI5LCJpc3MiOiJodHRwczovL3N0YWdpbmctaWFtLmlncmFudC5pby9hdXRoL3JlYWxtcy9pZ3JhbnQtdXNlcnMiLCJhdWQiOiJhY2NvdW50Iiwic3ViIjoiOWQ4YzRkNjktOWZiMi00MTE1LWE0YzMtNTNiY2JiOGYyZDdmIiwidHlwIjoiQmVhcmVyIiwiYXpwIjoiaWdyYW50LWlvcy1hcHAiLCJhdXRoX3RpbWUiOjAsInNlc3Npb25fc3RhdGUiOiIxMWQwYjg3OC0wMWNkLTQ1YmYtYTQxOC04Yzc0ZjkyNTE5NmUiLCJhY3IiOiIxIiwicmVhbG1fYWNjZXNzIjp7InJvbGVzIjpbIm9mZmxpbmVfYWNjZXNzIiwidW1hX2F1dGhvcml6YXRpb24iXX0sInJlc291cmNlX2FjY2VzcyI6eyJhY2NvdW50Ijp7InJvbGVzIjpbIm1hbmFnZS1hY2NvdW50IiwibWFuYWdlLWFjY291bnQtbGlua3MiLCJ2aWV3LXByb2ZpbGUiXX19LCJzY29wZSI6InByb2ZpbGUgZW1haWwiLCJlbWFpbF92ZXJpZmllZCI6ZmFsc2UsIm5hbWUiOiJSYXZpIFNoYW5rYXIiLCJwcmVmZXJyZWRfdXNlcm5hbWUiOiJkbWFydEB5b3BtYWlsLmNvbSIsImdpdmVuX25hbWUiOiJSYXZpIFNoYW5rYXIiLCJmYW1pbHlfbmFtZSI6IiIsImVtYWlsIjoiZG1hcnRAeW9wbWFpbC5jb20ifQ.K6eOOztvymq7W6yq7mjioJ76eZ7djtIjowqBlx9oCXIfbdt7W2HF6zX7FvkXFuta79ObDYeiqjt9Hy-9SWgS4-QGOFEM9pvT1aLC6gspeI2143P8ZPWWjHRuOH6Ht6TR8ML_X-DJ5n9hmoB9LDc8Vk39zTHhdmtSpu-yUrWHs2wFDmwO8yFdf9Em038WGxo4PYKzqzdEjsIVhSJy-BpkjoEluYxNkOGh3uQ4LZ7jbmXM83mwqEg8r-RwLljjqP3d2_7TSrNcO4Z8IVNslLv5wuSk9ZgCsPqE6poMjFLmrvOAcu2Rx6Em_me19RN1bTT2wrm_Joulzc02XcMyN9gDoA",
"expires_in": 21600,
"refresh_expires_in": 36000,
"refresh_token": "eyJhbGciOiJIUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICI5YmJiYTI4Ni1mYzI3LTRmMjItODg5Ny05MGU5NTMyNjE0NjkifQ.eyJqdGkiOiJhMzFlZWZkMS00MDNhLTQyZmYtODQ3Mi1hMjYzMjAwMjNmZjMiLCJleHAiOjE1OTU2MjQ0MjksIm5iZiI6MCwiaWF0IjoxNTk1NTg4NDI5LCJpc3MiOiJodHRwczovL3N0YWdpbmctaWFtLmlncmFudC5pby9hdXRoL3JlYWxtcy9pZ3JhbnQtdXNlcnMiLCJhdWQiOiJodHRwczovL3N0YWdpbmctaWFtLmlncmFudC5pby9hdXRoL3JlYWxtcy9pZ3JhbnQtdXNlcnMiLCJzdWIiOiI5ZDhjNGQ2OS05ZmIyLTQxMTUtYTRjMy01M2JjYmI4ZjJkN2YiLCJ0eXAiOiJSZWZyZXNoIiwiYXpwIjoiaWdyYW50LWlvcy1hcHAiLCJhdXRoX3RpbWUiOjAsInNlc3Npb25fc3RhdGUiOiIxMWQwYjg3OC0wMWNkLTQ1YmYtYTQxOC04Yzc0ZjkyNTE5NmUiLCJyZWFsbV9hY2Nlc3MiOnsicm9sZXMiOlsib2ZmbGluZV9hY2Nlc3MiLCJ1bWFfYXV0aG9yaXphdGlvbiJdfSwicmVzb3VyY2VfYWNjZXNzIjp7ImFjY291bnQiOnsicm9sZXMiOlsibWFuYWdlLWFjY291bnQiLCJtYW5hZ2UtYWNjb3VudC1saW5rcyIsInZpZXctcHJvZmlsZSJdfX0sInNjb3BlIjoicHJvZmlsZSBlbWFpbCJ9.DknM937PZWqwPiczJdNeIbEo0-R-09hBbOJiqRrDmqo",
"token_type": "bearer"
}
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Returns token and user details | Inline |
400 | Bad Request | Bad request | None |
401 | Unauthorized | Invalid user credentials | None |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» User | User | false | none | none |
»» ID | string | false | none | none |
»» Name | string | false | none | none |
»» IamID | string | false | none | none |
string | false | none | none | |
»» Phone | string | false | none | none |
»» ImageID | string | false | none | none |
»» ImageURL | string | false | none | none |
»» LastVisit | string(date-time) | false | none | none |
»» Client | object | false | none | none |
»»» Token | string | false | none | none |
»»» Type | integer | false | none | none |
»» Orgs | [object] | false | none | none |
»»» OrgID | string | false | none | none |
»»» Name | string | false | none | none |
»»» Location | string | false | none | none |
»»» Type | string | false | none | none |
»»» TypeID | string | false | none | none |
»»» EulaAccepted | boolean | false | none | none |
»» APIKey | string | false | none | none |
»» Roles | [object] | false | none | none |
»»» RoleID | integer | false | none | none |
»»» OrgID | string | false | none | none |
» Token | Token | false | none | none |
»» access_token | string | false | none | none |
»» expires_in | integer | false | none | none |
»» refresh_token | string | false | none | none |
»» refresh_expires_in | integer | false | none | none |
»» token_type | string | false | none | none |
Login as user (old)
Code samples
# You can also use wget
curl -X POST https://api.igrant.io/v1/users/login \
-H 'Content-Type: application/json' \
-H 'Accept: application/json'
POST https://api.igrant.io/v1/users/login HTTP/1.1
Host: api.igrant.io
Content-Type: application/json
Accept: application/json
const inputBody = '{
"username": "string",
"password": "pa$$word"
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('https://api.igrant.io/v1/users/login',
{
method: 'POST',
body: 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'
}
result = RestClient.post 'https://api.igrant.io/v1/users/login',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
r = requests.post('https://api.igrant.io/v1/users/login', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/json',
'Accept' => 'application/json',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','https://api.igrant.io/v1/users/login', array(
'headers' => $headers,
'json' => $request_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://api.igrant.io/v1/users/login");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
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"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://api.igrant.io/v1/users/login", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /users/login
Login as user
Body parameter
{
"username": "string",
"password": "pa$$word"
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | object | false | Login credentials |
» username | body | string | true | none |
» password | body | string(password) | true | none |
Example responses
200 Response
{
"access_token": "eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJDeHhVYTVaQ2NnaENxQUxTZy1wbFVYUkJlNE1ERG9zamF0enNYa1lqMEtFIn0.eyJqdGkiOiIzZDM0NDk3Zi05NDYxLTQyZDItYjA0My01ZTU2MTVhOTg0ODYiLCJleHAiOjE1OTU2MTAwMjksIm5iZiI6MCwiaWF0IjoxNTk1NTg4NDI5LCJpc3MiOiJodHRwczovL3N0YWdpbmctaWFtLmlncmFudC5pby9hdXRoL3JlYWxtcy9pZ3JhbnQtdXNlcnMiLCJhdWQiOiJhY2NvdW50Iiwic3ViIjoiOWQ4YzRkNjktOWZiMi00MTE1LWE0YzMtNTNiY2JiOGYyZDdmIiwidHlwIjoiQmVhcmVyIiwiYXpwIjoiaWdyYW50LWlvcy1hcHAiLCJhdXRoX3RpbWUiOjAsInNlc3Npb25fc3RhdGUiOiIxMWQwYjg3OC0wMWNkLTQ1YmYtYTQxOC04Yzc0ZjkyNTE5NmUiLCJhY3IiOiIxIiwicmVhbG1fYWNjZXNzIjp7InJvbGVzIjpbIm9mZmxpbmVfYWNjZXNzIiwidW1hX2F1dGhvcml6YXRpb24iXX0sInJlc291cmNlX2FjY2VzcyI6eyJhY2NvdW50Ijp7InJvbGVzIjpbIm1hbmFnZS1hY2NvdW50IiwibWFuYWdlLWFjY291bnQtbGlua3MiLCJ2aWV3LXByb2ZpbGUiXX19LCJzY29wZSI6InByb2ZpbGUgZW1haWwiLCJlbWFpbF92ZXJpZmllZCI6ZmFsc2UsIm5hbWUiOiJSYXZpIFNoYW5rYXIiLCJwcmVmZXJyZWRfdXNlcm5hbWUiOiJkbWFydEB5b3BtYWlsLmNvbSIsImdpdmVuX25hbWUiOiJSYXZpIFNoYW5rYXIiLCJmYW1pbHlfbmFtZSI6IiIsImVtYWlsIjoiZG1hcnRAeW9wbWFpbC5jb20ifQ.K6eOOztvymq7W6yq7mjioJ76eZ7djtIjowqBlx9oCXIfbdt7W2HF6zX7FvkXFuta79ObDYeiqjt9Hy-9SWgS4-QGOFEM9pvT1aLC6gspeI2143P8ZPWWjHRuOH6Ht6TR8ML_X-DJ5n9hmoB9LDc8Vk39zTHhdmtSpu-yUrWHs2wFDmwO8yFdf9Em038WGxo4PYKzqzdEjsIVhSJy-BpkjoEluYxNkOGh3uQ4LZ7jbmXM83mwqEg8r-RwLljjqP3d2_7TSrNcO4Z8IVNslLv5wuSk9ZgCsPqE6poMjFLmrvOAcu2Rx6Em_me19RN1bTT2wrm_Joulzc02XcMyN9gDoA",
"expires_in": 21600,
"refresh_expires_in": 36000,
"refresh_token": "eyJhbGciOiJIUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICI5YmJiYTI4Ni1mYzI3LTRmMjItODg5Ny05MGU5NTMyNjE0NjkifQ.eyJqdGkiOiJhMzFlZWZkMS00MDNhLTQyZmYtODQ3Mi1hMjYzMjAwMjNmZjMiLCJleHAiOjE1OTU2MjQ0MjksIm5iZiI6MCwiaWF0IjoxNTk1NTg4NDI5LCJpc3MiOiJodHRwczovL3N0YWdpbmctaWFtLmlncmFudC5pby9hdXRoL3JlYWxtcy9pZ3JhbnQtdXNlcnMiLCJhdWQiOiJodHRwczovL3N0YWdpbmctaWFtLmlncmFudC5pby9hdXRoL3JlYWxtcy9pZ3JhbnQtdXNlcnMiLCJzdWIiOiI5ZDhjNGQ2OS05ZmIyLTQxMTUtYTRjMy01M2JjYmI4ZjJkN2YiLCJ0eXAiOiJSZWZyZXNoIiwiYXpwIjoiaWdyYW50LWlvcy1hcHAiLCJhdXRoX3RpbWUiOjAsInNlc3Npb25fc3RhdGUiOiIxMWQwYjg3OC0wMWNkLTQ1YmYtYTQxOC04Yzc0ZjkyNTE5NmUiLCJyZWFsbV9hY2Nlc3MiOnsicm9sZXMiOlsib2ZmbGluZV9hY2Nlc3MiLCJ1bWFfYXV0aG9yaXphdGlvbiJdfSwicmVzb3VyY2VfYWNjZXNzIjp7ImFjY291bnQiOnsicm9sZXMiOlsibWFuYWdlLWFjY291bnQiLCJtYW5hZ2UtYWNjb3VudC1saW5rcyIsInZpZXctcHJvZmlsZSJdfX0sInNjb3BlIjoicHJvZmlsZSBlbWFpbCJ9.DknM937PZWqwPiczJdNeIbEo0-R-09hBbOJiqRrDmqo",
"token_type": "bearer"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Returns token | Token |
400 | Bad Request | Bad request | None |
401 | Unauthorized | Invalid user credentials | None |
Login as organisation admin
Code samples
# You can also use wget
curl -X POST https://api.igrant.io/v1/users/admin/login \
-H 'Content-Type: application/json' \
-H 'Accept: application/json'
POST https://api.igrant.io/v1/users/admin/login HTTP/1.1
Host: api.igrant.io
Content-Type: application/json
Accept: application/json
const inputBody = '{
"username": "string",
"password": "pa$$word"
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('https://api.igrant.io/v1/users/admin/login',
{
method: 'POST',
body: 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'
}
result = RestClient.post 'https://api.igrant.io/v1/users/admin/login',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
r = requests.post('https://api.igrant.io/v1/users/admin/login', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/json',
'Accept' => 'application/json',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','https://api.igrant.io/v1/users/admin/login', array(
'headers' => $headers,
'json' => $request_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://api.igrant.io/v1/users/admin/login");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
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"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://api.igrant.io/v1/users/admin/login", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /users/admin/login
Login as organisation admin
Body parameter
{
"username": "string",
"password": "pa$$word"
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | object | true | Login credentials |
» username | body | string | true | none |
» password | body | string(password) | true | none |
Example responses
200 Response
{
"User": {
"ID": "5daf22cea531351111afc7c8",
"Name": "George Floyd",
"IamID": "9d8c4h69-9fb2-4115-a4c3-53bddb8f2d7f",
"Email": "dmart@yopmail.com",
"Phone": "+46 7252 98991",
"ImageID": "5f1458a5chaa930001e78f12",
"ImageURL": "https:/<server-url>/image/5f1458a5chaa930001e78f12",
"LastVisit": "2020-07-22T18:04:02Z",
"Client": {
"Token": "fEkxEwh4T2mr-B4yQoZ9TT:APA91bHibhwLXkc2l6LxWxHW5TrKBoLrXGCHDO6A9pXQ0ShvDYPfxXm57D8tIsR-fwybjs-_OFXCgCbBQpYVON2svUiooWgJBFETXg_jUGy0B9etUHFnyuCbXPihyoCuJc2Gn6s9XkN_",
"Type": 2
},
"Orgs": [
{
"OrgID": "5dae2a9fa1215e00012103e4",
"Name": "Nordea Bank AB",
"Location": "Stockholm, Sweden",
"Type": "Banking and Finance",
"TypeID": "5d95a566a67c8800012f27d1",
"EulaAccepted": false
}
],
"APIKey": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyaWQiOiI1ZGFmMjJjZWE1MzEzNTAwMDFhZmM3YzgiLCJleHAiOjE2MDQwNjMwNjV9.Irk0XgXfVhIdlgBNz6ggEXlvoIPtzUzJv4-x0VKYBGE",
"Roles": [
{
"RoleID": 1,
"OrgID": "5daf22d0a531350001afc7c9"
}
]
},
"Token": {
"access_token": "eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJDeHhVYTVaQ2NnaENxQUxTZy1wbFVYUkJlNE1ERG9zamF0enNYa1lqMEtFIn0.eyJqdGkiOiIzZDM0NDk3Zi05NDYxLTQyZDItYjA0My01ZTU2MTVhOTg0ODYiLCJleHAiOjE1OTU2MTAwMjksIm5iZiI6MCwiaWF0IjoxNTk1NTg4NDI5LCJpc3MiOiJodHRwczovL3N0YWdpbmctaWFtLmlncmFudC5pby9hdXRoL3JlYWxtcy9pZ3JhbnQtdXNlcnMiLCJhdWQiOiJhY2NvdW50Iiwic3ViIjoiOWQ4YzRkNjktOWZiMi00MTE1LWE0YzMtNTNiY2JiOGYyZDdmIiwidHlwIjoiQmVhcmVyIiwiYXpwIjoiaWdyYW50LWlvcy1hcHAiLCJhdXRoX3RpbWUiOjAsInNlc3Npb25fc3RhdGUiOiIxMWQwYjg3OC0wMWNkLTQ1YmYtYTQxOC04Yzc0ZjkyNTE5NmUiLCJhY3IiOiIxIiwicmVhbG1fYWNjZXNzIjp7InJvbGVzIjpbIm9mZmxpbmVfYWNjZXNzIiwidW1hX2F1dGhvcml6YXRpb24iXX0sInJlc291cmNlX2FjY2VzcyI6eyJhY2NvdW50Ijp7InJvbGVzIjpbIm1hbmFnZS1hY2NvdW50IiwibWFuYWdlLWFjY291bnQtbGlua3MiLCJ2aWV3LXByb2ZpbGUiXX19LCJzY29wZSI6InByb2ZpbGUgZW1haWwiLCJlbWFpbF92ZXJpZmllZCI6ZmFsc2UsIm5hbWUiOiJSYXZpIFNoYW5rYXIiLCJwcmVmZXJyZWRfdXNlcm5hbWUiOiJkbWFydEB5b3BtYWlsLmNvbSIsImdpdmVuX25hbWUiOiJSYXZpIFNoYW5rYXIiLCJmYW1pbHlfbmFtZSI6IiIsImVtYWlsIjoiZG1hcnRAeW9wbWFpbC5jb20ifQ.K6eOOztvymq7W6yq7mjioJ76eZ7djtIjowqBlx9oCXIfbdt7W2HF6zX7FvkXFuta79ObDYeiqjt9Hy-9SWgS4-QGOFEM9pvT1aLC6gspeI2143P8ZPWWjHRuOH6Ht6TR8ML_X-DJ5n9hmoB9LDc8Vk39zTHhdmtSpu-yUrWHs2wFDmwO8yFdf9Em038WGxo4PYKzqzdEjsIVhSJy-BpkjoEluYxNkOGh3uQ4LZ7jbmXM83mwqEg8r-RwLljjqP3d2_7TSrNcO4Z8IVNslLv5wuSk9ZgCsPqE6poMjFLmrvOAcu2Rx6Em_me19RN1bTT2wrm_Joulzc02XcMyN9gDoA",
"expires_in": 21600,
"refresh_expires_in": 36000,
"refresh_token": "eyJhbGciOiJIUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICI5YmJiYTI4Ni1mYzI3LTRmMjItODg5Ny05MGU5NTMyNjE0NjkifQ.eyJqdGkiOiJhMzFlZWZkMS00MDNhLTQyZmYtODQ3Mi1hMjYzMjAwMjNmZjMiLCJleHAiOjE1OTU2MjQ0MjksIm5iZiI6MCwiaWF0IjoxNTk1NTg4NDI5LCJpc3MiOiJodHRwczovL3N0YWdpbmctaWFtLmlncmFudC5pby9hdXRoL3JlYWxtcy9pZ3JhbnQtdXNlcnMiLCJhdWQiOiJodHRwczovL3N0YWdpbmctaWFtLmlncmFudC5pby9hdXRoL3JlYWxtcy9pZ3JhbnQtdXNlcnMiLCJzdWIiOiI5ZDhjNGQ2OS05ZmIyLTQxMTUtYTRjMy01M2JjYmI4ZjJkN2YiLCJ0eXAiOiJSZWZyZXNoIiwiYXpwIjoiaWdyYW50LWlvcy1hcHAiLCJhdXRoX3RpbWUiOjAsInNlc3Npb25fc3RhdGUiOiIxMWQwYjg3OC0wMWNkLTQ1YmYtYTQxOC04Yzc0ZjkyNTE5NmUiLCJyZWFsbV9hY2Nlc3MiOnsicm9sZXMiOlsib2ZmbGluZV9hY2Nlc3MiLCJ1bWFfYXV0aG9yaXphdGlvbiJdfSwicmVzb3VyY2VfYWNjZXNzIjp7ImFjY291bnQiOnsicm9sZXMiOlsibWFuYWdlLWFjY291bnQiLCJtYW5hZ2UtYWNjb3VudC1saW5rcyIsInZpZXctcHJvZmlsZSJdfX0sInNjb3BlIjoicHJvZmlsZSBlbWFpbCJ9.DknM937PZWqwPiczJdNeIbEo0-R-09hBbOJiqRrDmqo",
"token_type": "bearer"
}
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Returns token and user details | Inline |
400 | Bad Request | Bad request | None |
401 | Unauthorized | Invalid user credentials | None |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» User | User | false | none | none |
»» ID | string | false | none | none |
»» Name | string | false | none | none |
»» IamID | string | false | none | none |
string | false | none | none | |
»» Phone | string | false | none | none |
»» ImageID | string | false | none | none |
»» ImageURL | string | false | none | none |
»» LastVisit | string(date-time) | false | none | none |
»» Client | object | false | none | none |
»»» Token | string | false | none | none |
»»» Type | integer | false | none | none |
»» Orgs | [object] | false | none | none |
»»» OrgID | string | false | none | none |
»»» Name | string | false | none | none |
»»» Location | string | false | none | none |
»»» Type | string | false | none | none |
»»» TypeID | string | false | none | none |
»»» EulaAccepted | boolean | false | none | none |
»» APIKey | string | false | none | none |
»» Roles | [object] | false | none | none |
»»» RoleID | integer | false | none | none |
»»» OrgID | string | false | none | none |
» Token | Token | false | none | none |
»» access_token | string | false | none | none |
»» expires_in | integer | false | none | none |
»» refresh_token | string | false | none | none |
»» refresh_expires_in | integer | false | none | none |
»» token_type | string | false | none | none |
Logout user
Code samples
# You can also use wget
curl -X POST https://api.igrant.io/v1/users/logout \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer {access-token}'
POST https://api.igrant.io/v1/users/logout HTTP/1.1
Host: api.igrant.io
Content-Type: application/json
const inputBody = '{
"refreshtoken": "string",
"clientid": "string"
}';
const headers = {
'Content-Type':'application/json',
'Authorization':'Bearer {access-token}'
};
fetch('https://api.igrant.io/v1/users/logout',
{
method: 'POST',
body: 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',
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.post 'https://api.igrant.io/v1/users/logout',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.post('https://api.igrant.io/v1/users/logout', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','https://api.igrant.io/v1/users/logout', array(
'headers' => $headers,
'json' => $request_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://api.igrant.io/v1/users/logout");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
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"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://api.igrant.io/v1/users/logout", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /users/logout
Logout user
Body parameter
{
"refreshtoken": "string",
"clientid": "string"
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | object | true | Refresh token and clientid |
» refreshtoken | body | string | true | none |
» clientid | body | string | true | none |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
204 | No Content | Logout successful | None |
400 | Bad Request | Bad request | None |
Refresh access token
Code samples
# You can also use wget
curl -X POST https://api.igrant.io/v1/users/token \
-H 'Content-Type: application/json' \
-H 'Accept: application/json'
POST https://api.igrant.io/v1/users/token HTTP/1.1
Host: api.igrant.io
Content-Type: application/json
Accept: application/json
const inputBody = '{
"refreshtoken": "string",
"clientid": "string"
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('https://api.igrant.io/v1/users/token',
{
method: 'POST',
body: 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'
}
result = RestClient.post 'https://api.igrant.io/v1/users/token',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
r = requests.post('https://api.igrant.io/v1/users/token', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/json',
'Accept' => 'application/json',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','https://api.igrant.io/v1/users/token', array(
'headers' => $headers,
'json' => $request_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://api.igrant.io/v1/users/token");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
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"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://api.igrant.io/v1/users/token", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /users/token
Refreshes an access token
Body parameter
{
"refreshtoken": "string",
"clientid": "string"
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | object | true | Refresh token and clientid |
» refreshtoken | body | string | true | none |
» clientid | body | string | true | none |
Example responses
200 Response
{
"access_token": "eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJDeHhVYTVaQ2NnaENxQUxTZy1wbFVYUkJlNE1ERG9zamF0enNYa1lqMEtFIn0.eyJqdGkiOiIzZDM0NDk3Zi05NDYxLTQyZDItYjA0My01ZTU2MTVhOTg0ODYiLCJleHAiOjE1OTU2MTAwMjksIm5iZiI6MCwiaWF0IjoxNTk1NTg4NDI5LCJpc3MiOiJodHRwczovL3N0YWdpbmctaWFtLmlncmFudC5pby9hdXRoL3JlYWxtcy9pZ3JhbnQtdXNlcnMiLCJhdWQiOiJhY2NvdW50Iiwic3ViIjoiOWQ4YzRkNjktOWZiMi00MTE1LWE0YzMtNTNiY2JiOGYyZDdmIiwidHlwIjoiQmVhcmVyIiwiYXpwIjoiaWdyYW50LWlvcy1hcHAiLCJhdXRoX3RpbWUiOjAsInNlc3Npb25fc3RhdGUiOiIxMWQwYjg3OC0wMWNkLTQ1YmYtYTQxOC04Yzc0ZjkyNTE5NmUiLCJhY3IiOiIxIiwicmVhbG1fYWNjZXNzIjp7InJvbGVzIjpbIm9mZmxpbmVfYWNjZXNzIiwidW1hX2F1dGhvcml6YXRpb24iXX0sInJlc291cmNlX2FjY2VzcyI6eyJhY2NvdW50Ijp7InJvbGVzIjpbIm1hbmFnZS1hY2NvdW50IiwibWFuYWdlLWFjY291bnQtbGlua3MiLCJ2aWV3LXByb2ZpbGUiXX19LCJzY29wZSI6InByb2ZpbGUgZW1haWwiLCJlbWFpbF92ZXJpZmllZCI6ZmFsc2UsIm5hbWUiOiJSYXZpIFNoYW5rYXIiLCJwcmVmZXJyZWRfdXNlcm5hbWUiOiJkbWFydEB5b3BtYWlsLmNvbSIsImdpdmVuX25hbWUiOiJSYXZpIFNoYW5rYXIiLCJmYW1pbHlfbmFtZSI6IiIsImVtYWlsIjoiZG1hcnRAeW9wbWFpbC5jb20ifQ.K6eOOztvymq7W6yq7mjioJ76eZ7djtIjowqBlx9oCXIfbdt7W2HF6zX7FvkXFuta79ObDYeiqjt9Hy-9SWgS4-QGOFEM9pvT1aLC6gspeI2143P8ZPWWjHRuOH6Ht6TR8ML_X-DJ5n9hmoB9LDc8Vk39zTHhdmtSpu-yUrWHs2wFDmwO8yFdf9Em038WGxo4PYKzqzdEjsIVhSJy-BpkjoEluYxNkOGh3uQ4LZ7jbmXM83mwqEg8r-RwLljjqP3d2_7TSrNcO4Z8IVNslLv5wuSk9ZgCsPqE6poMjFLmrvOAcu2Rx6Em_me19RN1bTT2wrm_Joulzc02XcMyN9gDoA",
"expires_in": 21600,
"refresh_expires_in": 36000,
"refresh_token": "eyJhbGciOiJIUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICI5YmJiYTI4Ni1mYzI3LTRmMjItODg5Ny05MGU5NTMyNjE0NjkifQ.eyJqdGkiOiJhMzFlZWZkMS00MDNhLTQyZmYtODQ3Mi1hMjYzMjAwMjNmZjMiLCJleHAiOjE1OTU2MjQ0MjksIm5iZiI6MCwiaWF0IjoxNTk1NTg4NDI5LCJpc3MiOiJodHRwczovL3N0YWdpbmctaWFtLmlncmFudC5pby9hdXRoL3JlYWxtcy9pZ3JhbnQtdXNlcnMiLCJhdWQiOiJodHRwczovL3N0YWdpbmctaWFtLmlncmFudC5pby9hdXRoL3JlYWxtcy9pZ3JhbnQtdXNlcnMiLCJzdWIiOiI5ZDhjNGQ2OS05ZmIyLTQxMTUtYTRjMy01M2JjYmI4ZjJkN2YiLCJ0eXAiOiJSZWZyZXNoIiwiYXpwIjoiaWdyYW50LWlvcy1hcHAiLCJhdXRoX3RpbWUiOjAsInNlc3Npb25fc3RhdGUiOiIxMWQwYjg3OC0wMWNkLTQ1YmYtYTQxOC04Yzc0ZjkyNTE5NmUiLCJyZWFsbV9hY2Nlc3MiOnsicm9sZXMiOlsib2ZmbGluZV9hY2Nlc3MiLCJ1bWFfYXV0aG9yaXphdGlvbiJdfSwicmVzb3VyY2VfYWNjZXNzIjp7ImFjY291bnQiOnsicm9sZXMiOlsibWFuYWdlLWFjY291bnQiLCJtYW5hZ2UtYWNjb3VudC1saW5rcyIsInZpZXctcHJvZmlsZSJdfX0sInNjb3BlIjoicHJvZmlsZSBlbWFpbCJ9.DknM937PZWqwPiczJdNeIbEo0-R-09hBbOJiqRrDmqo",
"token_type": "bearer"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Returns refreshed token | Token |
400 | Bad Request | Bad request | None |
Add external IDP
Code samples
# You can also use wget
curl -X POST https://api.igrant.io/v1/organizations/{organizationID}/idp/open-id \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
POST https://api.igrant.io/v1/organizations/{organizationID}/idp/open-id HTTP/1.1
Host: api.igrant.io
Content-Type: application/json
Accept: application/json
const inputBody = '{
"authorizationUrl": "string",
"tokenUrl": "string",
"logoutUrl": "string",
"clientId": "string",
"clientSecret": "string",
"jwksUrl": "string",
"userInfoUrl": "string",
"validateSignature": true,
"disableUserInfo": true,
"issuer": "string",
"defaultScope": "string"
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
fetch('https://api.igrant.io/v1/organizations/{organizationID}/idp/open-id',
{
method: 'POST',
body: 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',
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.post 'https://api.igrant.io/v1/organizations/{organizationID}/idp/open-id',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.post('https://api.igrant.io/v1/organizations/{organizationID}/idp/open-id', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','https://api.igrant.io/v1/organizations/{organizationID}/idp/open-id', array(
'headers' => $headers,
'json' => $request_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://api.igrant.io/v1/organizations/{organizationID}/idp/open-id");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
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"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://api.igrant.io/v1/organizations/{organizationID}/idp/open-id", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /organizations/{organizationID}/idp/open-id
Add external IDP
Body parameter
{
"authorizationUrl": "string",
"tokenUrl": "string",
"logoutUrl": "string",
"clientId": "string",
"clientSecret": "string",
"jwksUrl": "string",
"userInfoUrl": "string",
"validateSignature": true,
"disableUserInfo": true,
"issuer": "string",
"defaultScope": "string"
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
organizationID | path | string | true | Organisation ID |
body | body | object | false | OpenID client configuration for external identity provider |
» authorizationUrl | body | string | true | none |
» tokenUrl | body | string | true | none |
» logoutUrl | body | string | true | none |
» clientId | body | string | true | none |
» clientSecret | body | string | true | none |
» jwksUrl | body | string | true | none |
» userInfoUrl | body | string | true | none |
» validateSignature | body | boolean | true | none |
» disableUserInfo | body | boolean | true | none |
» issuer | body | string | true | none |
» defaultScope | body | string | true | none |
Example responses
201 Response
{
"authorizationUrl": "string",
"tokenUrl": "string",
"logoutUrl": "string",
"clientId": "string",
"clientSecret": "string",
"jwksUrl": "string",
"userInfoUrl": "string",
"validateSignature": true,
"disableUserInfo": true,
"issuer": "string",
"defaultScope": "string"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
201 | Created | Configured external identity provider for organisation | Inline |
Response Schema
Status Code 201
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» authorizationUrl | string | false | none | none |
» tokenUrl | string | false | none | none |
» logoutUrl | string | false | none | none |
» clientId | string | false | none | none |
» clientSecret | string | false | none | none |
» jwksUrl | string | false | none | none |
» userInfoUrl | string | false | none | none |
» validateSignature | boolean | false | none | none |
» disableUserInfo | boolean | false | none | none |
» issuer | string | false | none | none |
» defaultScope | string | false | none | none |
Update external IDP
Code samples
# You can also use wget
curl -X PUT https://api.igrant.io/v1/organizations/{organizationID}/idp/open-id \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
PUT https://api.igrant.io/v1/organizations/{organizationID}/idp/open-id HTTP/1.1
Host: api.igrant.io
Content-Type: application/json
Accept: application/json
const inputBody = '{
"authorizationUrl": "string",
"tokenUrl": "string",
"logoutUrl": "string",
"clientId": "string",
"clientSecret": "string",
"jwksUrl": "string",
"userInfoUrl": "string",
"validateSignature": true,
"disableUserInfo": true,
"issuer": "string",
"defaultScope": "string"
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
fetch('https://api.igrant.io/v1/organizations/{organizationID}/idp/open-id',
{
method: 'PUT',
body: 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',
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.put 'https://api.igrant.io/v1/organizations/{organizationID}/idp/open-id',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.put('https://api.igrant.io/v1/organizations/{organizationID}/idp/open-id', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('PUT','https://api.igrant.io/v1/organizations/{organizationID}/idp/open-id', array(
'headers' => $headers,
'json' => $request_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://api.igrant.io/v1/organizations/{organizationID}/idp/open-id");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PUT");
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"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("PUT", "https://api.igrant.io/v1/organizations/{organizationID}/idp/open-id", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
PUT /organizations/{organizationID}/idp/open-id
Update external IDP
Body parameter
{
"authorizationUrl": "string",
"tokenUrl": "string",
"logoutUrl": "string",
"clientId": "string",
"clientSecret": "string",
"jwksUrl": "string",
"userInfoUrl": "string",
"validateSignature": true,
"disableUserInfo": true,
"issuer": "string",
"defaultScope": "string"
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
organizationID | path | string | true | Organisation ID |
body | body | object | false | OpenID client configuration for external identity provider |
» authorizationUrl | body | string | true | none |
» tokenUrl | body | string | true | none |
» logoutUrl | body | string | true | none |
» clientId | body | string | true | none |
» clientSecret | body | string | true | none |
» jwksUrl | body | string | true | none |
» userInfoUrl | body | string | true | none |
» validateSignature | body | boolean | true | none |
» disableUserInfo | body | boolean | true | none |
» issuer | body | string | true | none |
» defaultScope | body | string | true | none |
Example responses
200 Response
{
"authorizationUrl": "string",
"tokenUrl": "string",
"logoutUrl": "string",
"clientId": "string",
"clientSecret": "string",
"jwksUrl": "string",
"userInfoUrl": "string",
"validateSignature": true,
"disableUserInfo": true,
"issuer": "string",
"defaultScope": "string"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Updates configured external identity provider for organisation | Inline |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» authorizationUrl | string | false | none | none |
» tokenUrl | string | false | none | none |
» logoutUrl | string | false | none | none |
» clientId | string | false | none | none |
» clientSecret | string | false | none | none |
» jwksUrl | string | false | none | none |
» userInfoUrl | string | false | none | none |
» validateSignature | boolean | false | none | none |
» disableUserInfo | boolean | false | none | none |
» issuer | string | false | none | none |
» defaultScope | string | false | none | none |
Get external IDP
Code samples
# You can also use wget
curl -X GET https://api.igrant.io/v1/organizations/{organizationID}/idp/open-id \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
GET https://api.igrant.io/v1/organizations/{organizationID}/idp/open-id HTTP/1.1
Host: api.igrant.io
Accept: application/json
const headers = {
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
fetch('https://api.igrant.io/v1/organizations/{organizationID}/idp/open-id',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.get 'https://api.igrant.io/v1/organizations/{organizationID}/idp/open-id',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.get('https://api.igrant.io/v1/organizations/{organizationID}/idp/open-id', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','https://api.igrant.io/v1/organizations/{organizationID}/idp/open-id', array(
'headers' => $headers,
'json' => $request_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://api.igrant.io/v1/organizations/{organizationID}/idp/open-id");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
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"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://api.igrant.io/v1/organizations/{organizationID}/idp/open-id", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /organizations/{organizationID}/idp/open-id
Get external IDP
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
organizationID | path | string | true | Organisation ID |
Example responses
200 Response
{
"authorizationUrl": "string",
"tokenUrl": "string",
"logoutUrl": "string",
"clientId": "string",
"clientSecret": "string",
"jwksUrl": "string",
"userInfoUrl": "string",
"validateSignature": true,
"disableUserInfo": true,
"issuer": "string",
"defaultScope": "string"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Get configured external identity provider for organisation | Inline |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» authorizationUrl | string | false | none | none |
» tokenUrl | string | false | none | none |
» logoutUrl | string | false | none | none |
» clientId | string | false | none | none |
» clientSecret | string | false | none | none |
» jwksUrl | string | false | none | none |
» userInfoUrl | string | false | none | none |
» validateSignature | boolean | false | none | none |
» disableUserInfo | boolean | false | none | none |
» issuer | string | false | none | none |
» defaultScope | string | false | none | none |
Delete external IDP
Code samples
# You can also use wget
curl -X DELETE https://api.igrant.io/v1/organizations/{organizationID}/idp/open-id \
-H 'Authorization: Bearer {access-token}'
DELETE https://api.igrant.io/v1/organizations/{organizationID}/idp/open-id HTTP/1.1
Host: api.igrant.io
const headers = {
'Authorization':'Bearer {access-token}'
};
fetch('https://api.igrant.io/v1/organizations/{organizationID}/idp/open-id',
{
method: 'DELETE',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.delete 'https://api.igrant.io/v1/organizations/{organizationID}/idp/open-id',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Authorization': 'Bearer {access-token}'
}
r = requests.delete('https://api.igrant.io/v1/organizations/{organizationID}/idp/open-id', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('DELETE','https://api.igrant.io/v1/organizations/{organizationID}/idp/open-id', array(
'headers' => $headers,
'json' => $request_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://api.igrant.io/v1/organizations/{organizationID}/idp/open-id");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("DELETE");
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"
)
func main() {
headers := map[string][]string{
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("DELETE", "https://api.igrant.io/v1/organizations/{organizationID}/idp/open-id", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
DELETE /organizations/{organizationID}/idp/open-id
Delete external IDP
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
organizationID | path | string | true | Organisation ID |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
204 | No Content | Removed configured external identity provider for organisation | None |
Exchange auth code
Code samples
# You can also use wget
curl -X POST https://api.igrant.io/v1/organizations/{organizationID}/idp/open-id/exchange?redirect_uri=https%3A%2F%2Fpreference-center.igrant.io%2Flogin&code=string \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
POST https://api.igrant.io/v1/organizations/{organizationID}/idp/open-id/exchange?redirect_uri=https%3A%2F%2Fpreference-center.igrant.io%2Flogin&code=string HTTP/1.1
Host: api.igrant.io
Accept: application/json
const headers = {
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
fetch('https://api.igrant.io/v1/organizations/{organizationID}/idp/open-id/exchange?redirect_uri=https%3A%2F%2Fpreference-center.igrant.io%2Flogin&code=string',
{
method: 'POST',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.post 'https://api.igrant.io/v1/organizations/{organizationID}/idp/open-id/exchange',
params: {
'redirect_uri' => 'string',
'code' => 'string'
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.post('https://api.igrant.io/v1/organizations/{organizationID}/idp/open-id/exchange', params={
'redirect_uri': 'https://preference-center.igrant.io/login', 'code': 'string'
}, headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','https://api.igrant.io/v1/organizations/{organizationID}/idp/open-id/exchange', array(
'headers' => $headers,
'json' => $request_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://api.igrant.io/v1/organizations/{organizationID}/idp/open-id/exchange?redirect_uri=https%3A%2F%2Fpreference-center.igrant.io%2Flogin&code=string");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
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"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://api.igrant.io/v1/organizations/{organizationID}/idp/open-id/exchange", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /organizations/{organizationID}/idp/open-id/exchange
Exchange auth code
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
organizationID | path | string | true | Organisation ID |
redirect_uri | query | string | true | URI to be redirected to after successfully obtaining the authorization code |
code | query | string | true | Authorization code |
Example responses
200 Response
{
"User": {
"ID": "5daf22cea531351111afc7c8",
"Name": "George Floyd",
"IamID": "9d8c4h69-9fb2-4115-a4c3-53bddb8f2d7f",
"Email": "dmart@yopmail.com",
"Phone": "+46 7252 98991",
"ImageID": "5f1458a5chaa930001e78f12",
"ImageURL": "https:/<server-url>/image/5f1458a5chaa930001e78f12",
"LastVisit": "2020-07-22T18:04:02Z",
"Client": {
"Token": "fEkxEwh4T2mr-B4yQoZ9TT:APA91bHibhwLXkc2l6LxWxHW5TrKBoLrXGCHDO6A9pXQ0ShvDYPfxXm57D8tIsR-fwybjs-_OFXCgCbBQpYVON2svUiooWgJBFETXg_jUGy0B9etUHFnyuCbXPihyoCuJc2Gn6s9XkN_",
"Type": 2
},
"Orgs": [
{
"OrgID": "5dae2a9fa1215e00012103e4",
"Name": "Nordea Bank AB",
"Location": "Stockholm, Sweden",
"Type": "Banking and Finance",
"TypeID": "5d95a566a67c8800012f27d1",
"EulaAccepted": false
}
],
"APIKey": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyaWQiOiI1ZGFmMjJjZWE1MzEzNTAwMDFhZmM3YzgiLCJleHAiOjE2MDQwNjMwNjV9.Irk0XgXfVhIdlgBNz6ggEXlvoIPtzUzJv4-x0VKYBGE",
"Roles": [
{
"RoleID": 1,
"OrgID": "5daf22d0a531350001afc7c9"
}
]
},
"Token": {
"access_token": "eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJDeHhVYTVaQ2NnaENxQUxTZy1wbFVYUkJlNE1ERG9zamF0enNYa1lqMEtFIn0.eyJqdGkiOiIzZDM0NDk3Zi05NDYxLTQyZDItYjA0My01ZTU2MTVhOTg0ODYiLCJleHAiOjE1OTU2MTAwMjksIm5iZiI6MCwiaWF0IjoxNTk1NTg4NDI5LCJpc3MiOiJodHRwczovL3N0YWdpbmctaWFtLmlncmFudC5pby9hdXRoL3JlYWxtcy9pZ3JhbnQtdXNlcnMiLCJhdWQiOiJhY2NvdW50Iiwic3ViIjoiOWQ4YzRkNjktOWZiMi00MTE1LWE0YzMtNTNiY2JiOGYyZDdmIiwidHlwIjoiQmVhcmVyIiwiYXpwIjoiaWdyYW50LWlvcy1hcHAiLCJhdXRoX3RpbWUiOjAsInNlc3Npb25fc3RhdGUiOiIxMWQwYjg3OC0wMWNkLTQ1YmYtYTQxOC04Yzc0ZjkyNTE5NmUiLCJhY3IiOiIxIiwicmVhbG1fYWNjZXNzIjp7InJvbGVzIjpbIm9mZmxpbmVfYWNjZXNzIiwidW1hX2F1dGhvcml6YXRpb24iXX0sInJlc291cmNlX2FjY2VzcyI6eyJhY2NvdW50Ijp7InJvbGVzIjpbIm1hbmFnZS1hY2NvdW50IiwibWFuYWdlLWFjY291bnQtbGlua3MiLCJ2aWV3LXByb2ZpbGUiXX19LCJzY29wZSI6InByb2ZpbGUgZW1haWwiLCJlbWFpbF92ZXJpZmllZCI6ZmFsc2UsIm5hbWUiOiJSYXZpIFNoYW5rYXIiLCJwcmVmZXJyZWRfdXNlcm5hbWUiOiJkbWFydEB5b3BtYWlsLmNvbSIsImdpdmVuX25hbWUiOiJSYXZpIFNoYW5rYXIiLCJmYW1pbHlfbmFtZSI6IiIsImVtYWlsIjoiZG1hcnRAeW9wbWFpbC5jb20ifQ.K6eOOztvymq7W6yq7mjioJ76eZ7djtIjowqBlx9oCXIfbdt7W2HF6zX7FvkXFuta79ObDYeiqjt9Hy-9SWgS4-QGOFEM9pvT1aLC6gspeI2143P8ZPWWjHRuOH6Ht6TR8ML_X-DJ5n9hmoB9LDc8Vk39zTHhdmtSpu-yUrWHs2wFDmwO8yFdf9Em038WGxo4PYKzqzdEjsIVhSJy-BpkjoEluYxNkOGh3uQ4LZ7jbmXM83mwqEg8r-RwLljjqP3d2_7TSrNcO4Z8IVNslLv5wuSk9ZgCsPqE6poMjFLmrvOAcu2Rx6Em_me19RN1bTT2wrm_Joulzc02XcMyN9gDoA",
"expires_in": 21600,
"refresh_expires_in": 36000,
"refresh_token": "eyJhbGciOiJIUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICI5YmJiYTI4Ni1mYzI3LTRmMjItODg5Ny05MGU5NTMyNjE0NjkifQ.eyJqdGkiOiJhMzFlZWZkMS00MDNhLTQyZmYtODQ3Mi1hMjYzMjAwMjNmZjMiLCJleHAiOjE1OTU2MjQ0MjksIm5iZiI6MCwiaWF0IjoxNTk1NTg4NDI5LCJpc3MiOiJodHRwczovL3N0YWdpbmctaWFtLmlncmFudC5pby9hdXRoL3JlYWxtcy9pZ3JhbnQtdXNlcnMiLCJhdWQiOiJodHRwczovL3N0YWdpbmctaWFtLmlncmFudC5pby9hdXRoL3JlYWxtcy9pZ3JhbnQtdXNlcnMiLCJzdWIiOiI5ZDhjNGQ2OS05ZmIyLTQxMTUtYTRjMy01M2JjYmI4ZjJkN2YiLCJ0eXAiOiJSZWZyZXNoIiwiYXpwIjoiaWdyYW50LWlvcy1hcHAiLCJhdXRoX3RpbWUiOjAsInNlc3Npb25fc3RhdGUiOiIxMWQwYjg3OC0wMWNkLTQ1YmYtYTQxOC04Yzc0ZjkyNTE5NmUiLCJyZWFsbV9hY2Nlc3MiOnsicm9sZXMiOlsib2ZmbGluZV9hY2Nlc3MiLCJ1bWFfYXV0aG9yaXphdGlvbiJdfSwicmVzb3VyY2VfYWNjZXNzIjp7ImFjY291bnQiOnsicm9sZXMiOlsibWFuYWdlLWFjY291bnQiLCJtYW5hZ2UtYWNjb3VudC1saW5rcyIsInZpZXctcHJvZmlsZSJdfX0sInNjb3BlIjoicHJvZmlsZSBlbWFpbCJ9.DknM937PZWqwPiczJdNeIbEo0-R-09hBbOJiqRrDmqo",
"token_type": "bearer"
}
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Returns token and user details | Inline |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» User | User | false | none | none |
»» ID | string | false | none | none |
»» Name | string | false | none | none |
»» IamID | string | false | none | none |
string | false | none | none | |
»» Phone | string | false | none | none |
»» ImageID | string | false | none | none |
»» ImageURL | string | false | none | none |
»» LastVisit | string(date-time) | false | none | none |
»» Client | object | false | none | none |
»»» Token | string | false | none | none |
»»» Type | integer | false | none | none |
»» Orgs | [object] | false | none | none |
»»» OrgID | string | false | none | none |
»»» Name | string | false | none | none |
»»» Location | string | false | none | none |
»»» Type | string | false | none | none |
»»» TypeID | string | false | none | none |
»»» EulaAccepted | boolean | false | none | none |
»» APIKey | string | false | none | none |
»» Roles | [object] | false | none | none |
»»» RoleID | integer | false | none | none |
»»» OrgID | string | false | none | none |
» Token | Token | false | none | none |
»» access_token | string | false | none | none |
»» expires_in | integer | false | none | none |
»» refresh_token | string | false | none | none |
»» refresh_expires_in | integer | false | none | none |
»» token_type | string | false | none | none |
Logout OpenID client
Code samples
# You can also use wget
curl -X POST https://api.igrant.io/v1/organizations/{organizationID}/idp/open-id/logout \
-H 'Authorization: Bearer {access-token}'
POST https://api.igrant.io/v1/organizations/{organizationID}/idp/open-id/logout HTTP/1.1
Host: api.igrant.io
const headers = {
'Authorization':'Bearer {access-token}'
};
fetch('https://api.igrant.io/v1/organizations/{organizationID}/idp/open-id/logout',
{
method: 'POST',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.post 'https://api.igrant.io/v1/organizations/{organizationID}/idp/open-id/logout',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Authorization': 'Bearer {access-token}'
}
r = requests.post('https://api.igrant.io/v1/organizations/{organizationID}/idp/open-id/logout', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','https://api.igrant.io/v1/organizations/{organizationID}/idp/open-id/logout', array(
'headers' => $headers,
'json' => $request_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://api.igrant.io/v1/organizations/{organizationID}/idp/open-id/logout");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
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"
)
func main() {
headers := map[string][]string{
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://api.igrant.io/v1/organizations/{organizationID}/idp/open-id/logout", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /organizations/{organizationID}/idp/open-id/logout
Logout OpenID client
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
organizationID | path | string | true | Organisation ID |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
204 | No Content | Ended user session in iGrant.io IAM and external IDP (if configured) | None |
Get redirect_uri
Code samples
# You can also use wget
curl -X GET https://api.igrant.io/v1/organizations/{organizationID}/idp/open-id/redirect-uri \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
GET https://api.igrant.io/v1/organizations/{organizationID}/idp/open-id/redirect-uri HTTP/1.1
Host: api.igrant.io
Accept: application/json
const headers = {
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
fetch('https://api.igrant.io/v1/organizations/{organizationID}/idp/open-id/redirect-uri',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.get 'https://api.igrant.io/v1/organizations/{organizationID}/idp/open-id/redirect-uri',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.get('https://api.igrant.io/v1/organizations/{organizationID}/idp/open-id/redirect-uri', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','https://api.igrant.io/v1/organizations/{organizationID}/idp/open-id/redirect-uri', array(
'headers' => $headers,
'json' => $request_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://api.igrant.io/v1/organizations/{organizationID}/idp/open-id/redirect-uri");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
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"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://api.igrant.io/v1/organizations/{organizationID}/idp/open-id/redirect-uri", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /organizations/{organizationID}/idp/open-id/redirect-uri
Get redirect_uri
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
organizationID | path | string | true | Organisation ID |
Example responses
200 Response
{
"RedirectURI": "https://iam.igrant.io/auth/realms/igrant-users/broker/5f5238ddc67001000111f8d9/endpoint"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Returns redirect URI | Inline |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» RedirectURI | string | false | none | none |
Permissions and consents
Permission management enables people to manage and have an overview of data transactions and connections and to execute their legal rights (for example, as per the GDPR Article 6 in the GDPR). Using iGrant.io services, organisations can manage consents from individuals throughout its lifecycle. It can be an active consenting where consent is given in real-time or passive consenting where consents can be given anytime. In either case, individuals can at any time use the service to re-evaluate their consents if the need arise.
Get consents for a user
Code samples
# You can also use wget
curl -X GET https://api.igrant.io/v1/organizations/{orgID}/users/{userID}/consents \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
GET https://api.igrant.io/v1/organizations/{orgID}/users/{userID}/consents HTTP/1.1
Host: api.igrant.io
Accept: application/json
const headers = {
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
fetch('https://api.igrant.io/v1/organizations/{orgID}/users/{userID}/consents',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.get 'https://api.igrant.io/v1/organizations/{orgID}/users/{userID}/consents',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.get('https://api.igrant.io/v1/organizations/{orgID}/users/{userID}/consents', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','https://api.igrant.io/v1/organizations/{orgID}/users/{userID}/consents', array(
'headers' => $headers,
'json' => $request_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://api.igrant.io/v1/organizations/{orgID}/users/{userID}/consents");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
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"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://api.igrant.io/v1/organizations/{orgID}/users/{userID}/consents", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /organizations/{orgID}/users/{userID}/consents
Get consents for a particular user. This will include all consents given for the defined usage purposes and data attributes within the usage purpose.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
orgID | path | string | true | Organization ID |
userID | path | string | true | User ID |
Example responses
200 Response
{
"ID": "5e4e91036c7aa200012aa9da",
"OrgID": "5dae01aa267e930001609aa4",
"UserID": "5dbc02ecb99fd0000157547a",
"ConsentsAndPurposes": [
{
"Purpose": {
"ID": "5db0303ba531350001afc7e0",
"Name": "Marketing and campaign",
"Description": "For this purpose, following personal data attributes shown below are used. You may consent to share your data at attribute level.",
"LawfulUsage": false,
"PolicyURL": "https://orgname.com/policy_default.html"
},
"Count": {
"Total": 4,
"Consented": 4
},
"Consents": [
{
"ID": "5dae01ee267e930001609aa8",
"Description": "Name",
"Value": "",
"Status": {
"Consent": "Allow",
"TimeStamp": "0001-01-01T00:00:00Z",
"Days": 0,
"Remaining": 0
}
}
],
"DataRetention": {
"Expiry": "2020-11-14 03:03:10 +0000 UTC"
}
}
]
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Return consents and purposes | Inline |
401 | Unauthorized | Unauthorized | None |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» ID | string | false | none | none |
» OrgID | string | false | none | none |
» UserID | string | false | none | none |
» ConsentsAndPurposes | [object] | false | none | none |
»» Purpose | Purpose | false | none | none |
»»» ID | string | false | none | none |
»»» Name | string | false | none | none |
»»» Description | string | false | none | none |
»»» LawfulUsage | boolean | false | none | none |
»»» PolicyURL | string | false | none | none |
»» Count | object | false | none | none |
»»» Total | integer | false | none | none |
»»» Consented | integer | false | none | none |
»» Consents | [AttributeConsent] | false | none | none |
»»» ID | string | false | none | none |
»»» Description | string | false | none | none |
»»» Value | string | false | none | none |
»»» Status | object | false | none | none |
»»»» Consent | string | false | none | none |
»»»» TimeStamp | string(date-time) | false | none | none |
»»»» Days | integer | false | none | none |
»»»» Remaining | integer | false | none | none |
»» DataRetention | object | false | none | none |
»»» Expiry | string | false | none | none |
Gets user consent
Code samples
# You can also use wget
curl -X GET https://api.igrant.io/v1/organizations/{orgID}/users/{userID}/consents/{consentID} \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
GET https://api.igrant.io/v1/organizations/{orgID}/users/{userID}/consents/{consentID} HTTP/1.1
Host: api.igrant.io
Accept: application/json
const headers = {
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
fetch('https://api.igrant.io/v1/organizations/{orgID}/users/{userID}/consents/{consentID}',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.get 'https://api.igrant.io/v1/organizations/{orgID}/users/{userID}/consents/{consentID}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.get('https://api.igrant.io/v1/organizations/{orgID}/users/{userID}/consents/{consentID}', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','https://api.igrant.io/v1/organizations/{orgID}/users/{userID}/consents/{consentID}', array(
'headers' => $headers,
'json' => $request_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://api.igrant.io/v1/organizations/{orgID}/users/{userID}/consents/{consentID}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
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"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://api.igrant.io/v1/organizations/{orgID}/users/{userID}/consents/{consentID}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /organizations/{orgID}/users/{userID}/consents/{consentID}
Get user consent by ID
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
orgID | path | string | true | Organization ID |
userID | path | string | true | User ID |
consentID | path | string | true | Consent ID |
Example responses
200 Response
{
"ID": "5e4e91036c7aa200012aa9da",
"OrgID": "5dae01aa267e930001609aa4",
"UserID": "5dbc02ecb99fd0000157547a",
"ConsentsAndPurposes": [
{
"Purpose": {
"ID": "5db0303ba531350001afc7e0",
"Name": "Marketing and campaign",
"Description": "For this purpose, following personal data attributes shown below are used. You may consent to share your data at attribute level.",
"LawfulUsage": false,
"PolicyURL": "https://orgname.com/policy_default.html"
},
"Count": {
"Total": 4,
"Consented": 4
},
"Consents": [
{
"ID": "5dae01ee267e930001609aa8",
"Description": "Name",
"Value": "",
"Status": {
"Consent": "Allow",
"TimeStamp": "0001-01-01T00:00:00Z",
"Days": 0,
"Remaining": 0
}
}
]
}
]
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Return consents and purposes | Inline |
401 | Unauthorized | Unauthorized | None |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» ID | string | false | none | none |
» OrgID | string | false | none | none |
» UserID | string | false | none | none |
» ConsentsAndPurposes | [object] | false | none | none |
»» Purpose | Purpose | false | none | none |
»»» ID | string | false | none | none |
»»» Name | string | false | none | none |
»»» Description | string | false | none | none |
»»» LawfulUsage | boolean | false | none | none |
»»» PolicyURL | string | false | none | none |
»» Count | object | false | none | none |
»»» Total | integer | false | none | none |
»»» Consented | integer | false | none | none |
»» Consents | [AttributeConsent] | false | none | none |
»»» ID | string | false | none | none |
»»» Description | string | false | none | none |
»»» Value | string | false | none | none |
»»» Status | object | false | none | none |
»»»» Consent | string | false | none | none |
»»»» TimeStamp | string(date-time) | false | none | none |
»»»» Days | integer | false | none | none |
»»»» Remaining | integer | false | none | none |
Get all purpose consents
Code samples
# You can also use wget
curl -X GET https://api.igrant.io/v1/organizations/{orgID}/users/{userID}/consents/{consentID}/purposes/{purposeID} \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
GET https://api.igrant.io/v1/organizations/{orgID}/users/{userID}/consents/{consentID}/purposes/{purposeID} HTTP/1.1
Host: api.igrant.io
Accept: application/json
const headers = {
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
fetch('https://api.igrant.io/v1/organizations/{orgID}/users/{userID}/consents/{consentID}/purposes/{purposeID}',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.get 'https://api.igrant.io/v1/organizations/{orgID}/users/{userID}/consents/{consentID}/purposes/{purposeID}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.get('https://api.igrant.io/v1/organizations/{orgID}/users/{userID}/consents/{consentID}/purposes/{purposeID}', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','https://api.igrant.io/v1/organizations/{orgID}/users/{userID}/consents/{consentID}/purposes/{purposeID}', array(
'headers' => $headers,
'json' => $request_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://api.igrant.io/v1/organizations/{orgID}/users/{userID}/consents/{consentID}/purposes/{purposeID}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
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"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://api.igrant.io/v1/organizations/{orgID}/users/{userID}/consents/{consentID}/purposes/{purposeID}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /organizations/{orgID}/users/{userID}/consents/{consentID}/purposes/{purposeID}
Gets all the consents for a given purpose by ID
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
orgID | path | string | true | Organization ID |
userID | path | string | true | User ID |
consentID | path | string | true | Consent ID |
purposeID | path | string | true | Purpose ID |
Example responses
200 Response
{
"ID": "5e4e91036c7aa200012aa9da",
"ConsentID": "5e4e91036c7aa200012aa9da",
"OrgID": "5dae01aa267e930001609aa4",
"UserID": "5dbc02ecb99fd0000157547a",
"DataRetention": {
"Expiry": "2020-11-14 03:03:10 +0000 UTC"
},
"Consents": {
"Purpose": {
"ID": "5db0303ba531350001afc7e0",
"Name": "Marketing and campaign",
"Description": "For this purpose, following personal data attributes shown below are used. You may consent to share your data at attribute level.",
"LawfulUsage": false,
"PolicyURL": "https://orgname.com/policy_default.html"
},
"Count": {
"Total": 4,
"Consented": 4
},
"Consents": [
{
"ID": "5dae01ee267e930001609aa8",
"Description": "Name",
"Value": "",
"Status": {
"Consent": "Allow",
"TimeStamp": "0001-01-01T00:00:00Z",
"Days": 0,
"Remaining": 0
}
}
]
}
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Return consents for a given purpose | Inline |
401 | Unauthorized | Unauthorized | None |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» ID | string | false | none | none |
» ConsentID | string | false | none | none |
» OrgID | string | false | none | none |
» UserID | string | false | none | none |
» DataRetention | object | false | none | none |
»» Expiry | string | false | none | none |
» Consents | object | false | none | none |
»» Purpose | Purpose | false | none | none |
»»» ID | string | false | none | none |
»»» Name | string | false | none | none |
»»» Description | string | false | none | none |
»»» LawfulUsage | boolean | false | none | none |
»»» PolicyURL | string | false | none | none |
»» Count | object | false | none | none |
»»» Total | integer | false | none | none |
»»» Consented | integer | false | none | none |
»» Consents | [AttributeConsent] | false | none | none |
»»» ID | string | false | none | none |
»»» Description | string | false | none | none |
»»» Value | string | false | none | none |
»»» Status | object | false | none | none |
»»»» Consent | string | false | none | none |
»»»» TimeStamp | string(date-time) | false | none | none |
»»»» Days | integer | false | none | none |
»»»» Remaining | integer | false | none | none |
Update consents for attribute
Code samples
# You can also use wget
curl -X PATCH https://api.igrant.io/v1/organizations/{orgID}/users/{userID}/consents/{consentID}/purposes/{purposeID} \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
PATCH https://api.igrant.io/v1/organizations/{orgID}/users/{userID}/consents/{consentID}/purposes/{purposeID} HTTP/1.1
Host: api.igrant.io
Content-Type: application/json
Accept: application/json
const inputBody = '{
"consentattributes": [
{
"attributeid": "5dae01ee267e930001609aa8"
}
],
"consented": "Allow"
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
fetch('https://api.igrant.io/v1/organizations/{orgID}/users/{userID}/consents/{consentID}/purposes/{purposeID}',
{
method: 'PATCH',
body: 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',
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.patch 'https://api.igrant.io/v1/organizations/{orgID}/users/{userID}/consents/{consentID}/purposes/{purposeID}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.patch('https://api.igrant.io/v1/organizations/{orgID}/users/{userID}/consents/{consentID}/purposes/{purposeID}', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('PATCH','https://api.igrant.io/v1/organizations/{orgID}/users/{userID}/consents/{consentID}/purposes/{purposeID}', array(
'headers' => $headers,
'json' => $request_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://api.igrant.io/v1/organizations/{orgID}/users/{userID}/consents/{consentID}/purposes/{purposeID}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PATCH");
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"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("PATCH", "https://api.igrant.io/v1/organizations/{orgID}/users/{userID}/consents/{consentID}/purposes/{purposeID}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
PATCH /organizations/{orgID}/users/{userID}/consents/{consentID}/purposes/{purposeID}
Update attribute consent for a given purpose
Body parameter
{
"consentattributes": [
{
"attributeid": "5dae01ee267e930001609aa8"
}
],
"consented": "Allow"
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
orgID | path | string | true | Organization ID |
userID | path | string | true | User ID |
consentID | path | string | true | Consent ID |
purposeID | path | string | true | Purpose ID |
body | body | object | true | none |
» consentattributes | body | [object] | true | none |
»» attributeid | body | string | true | none |
» consented | body | string | true | none |
Example responses
200 Response
{
"ID": "5e4e91036c7aa200012aa9da",
"OrgID": "5dae01aa267e930001609aa4",
"UserID": "5dbc02ecb99fd0000157547a",
"Purposes": [
{
"ID": "5dae1058a1215e00012103d8",
"AllowAll": false,
"Consents": [
{
"Status": {
"Consented": "Allow",
"TimeStamp": "0001-01-01T00:00:00Z",
"Days": 0
},
"Value": "",
"TemplateID": "5dae01f4267e930001609aa9"
}
]
}
]
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Returns consents for the purpose | Inline |
400 | Bad Request | Invalid request payload | None |
401 | Unauthorized | Unauthorized | None |
404 | Not Found | Not found | None |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» ID | string | false | none | none |
» OrgID | string | false | none | none |
» UserID | string | false | none | none |
» Purposes | [object] | false | none | none |
»» ID | string | false | none | none |
»» AllowAll | boolean | false | none | none |
»» Consents | [object] | false | none | none |
»»» Status | object | false | none | none |
»»»» Consented | string | false | none | none |
»»»» TimeStamp | string(date-time) | false | none | none |
»»»» Days | integer | false | none | none |
»»» Value | string | false | none | none |
»»» TemplateID | string | false | none | none |
Get all consents
Code samples
# You can also use wget
curl -X GET https://api.igrant.io/v1/organizations/{orgID}/users/{userID}/consents/{consentID}/purposes/{purposeID}/status \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
GET https://api.igrant.io/v1/organizations/{orgID}/users/{userID}/consents/{consentID}/purposes/{purposeID}/status HTTP/1.1
Host: api.igrant.io
Accept: application/json
const headers = {
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
fetch('https://api.igrant.io/v1/organizations/{orgID}/users/{userID}/consents/{consentID}/purposes/{purposeID}/status',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.get 'https://api.igrant.io/v1/organizations/{orgID}/users/{userID}/consents/{consentID}/purposes/{purposeID}/status',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.get('https://api.igrant.io/v1/organizations/{orgID}/users/{userID}/consents/{consentID}/purposes/{purposeID}/status', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','https://api.igrant.io/v1/organizations/{orgID}/users/{userID}/consents/{consentID}/purposes/{purposeID}/status', array(
'headers' => $headers,
'json' => $request_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://api.igrant.io/v1/organizations/{orgID}/users/{userID}/consents/{consentID}/purposes/{purposeID}/status");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
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"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://api.igrant.io/v1/organizations/{orgID}/users/{userID}/consents/{consentID}/purposes/{purposeID}/status", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /organizations/{orgID}/users/{userID}/consents/{consentID}/purposes/{purposeID}/status
Gets all consent attributes status for a given usage purpose
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
orgID | path | string | true | Organization ID |
userID | path | string | true | User ID |
consentID | path | string | true | Consent ID |
purposeID | path | string | true | Purpose ID |
Example responses
200 Response
{
"Consented": "Disallow"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Return all consent attributes status for a given usage purpose | Inline |
401 | Unauthorized | Unauthorized | None |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» Consented | string | false | none | none |
Updates attribute consents for purpose
Code samples
# You can also use wget
curl -X POST https://api.igrant.io/v1/organizations/{orgID}/users/{userID}/consents/{consentID}/purposes/{purposeID}/status \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
POST https://api.igrant.io/v1/organizations/{orgID}/users/{userID}/consents/{consentID}/purposes/{purposeID}/status HTTP/1.1
Host: api.igrant.io
Content-Type: application/json
Accept: application/json
const inputBody = '{
"consented": "Allow"
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
fetch('https://api.igrant.io/v1/organizations/{orgID}/users/{userID}/consents/{consentID}/purposes/{purposeID}/status',
{
method: 'POST',
body: 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',
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.post 'https://api.igrant.io/v1/organizations/{orgID}/users/{userID}/consents/{consentID}/purposes/{purposeID}/status',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.post('https://api.igrant.io/v1/organizations/{orgID}/users/{userID}/consents/{consentID}/purposes/{purposeID}/status', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','https://api.igrant.io/v1/organizations/{orgID}/users/{userID}/consents/{consentID}/purposes/{purposeID}/status', array(
'headers' => $headers,
'json' => $request_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://api.igrant.io/v1/organizations/{orgID}/users/{userID}/consents/{consentID}/purposes/{purposeID}/status");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
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"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://api.igrant.io/v1/organizations/{orgID}/users/{userID}/consents/{consentID}/purposes/{purposeID}/status", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /organizations/{orgID}/users/{userID}/consents/{consentID}/purposes/{purposeID}/status
Updates all attribute consents of a given purpose
Body parameter
{
"consented": "Allow"
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
orgID | path | string | true | Organization ID |
userID | path | string | true | User ID |
consentID | path | string | true | Consent ID |
purposeID | path | string | true | Purpose ID |
body | body | object | true | none |
» consented | body | string | true | none |
Example responses
200 Response
{
"ID": "5e4e91036c7aa200012aa9da",
"OrgID": "5dae01aa267e930001609aa4",
"UserID": "5dbc02ecb99fd0000157547a",
"ConsentsAndPurposes": [
{
"Purpose": {
"ID": "5db0303ba531350001afc7e0",
"Name": "Marketing and campaign",
"Description": "For this purpose, following personal data attributes shown below are used. You may consent to share your data at attribute level.",
"LawfulUsage": false,
"PolicyURL": "https://orgname.com/policy_default.html"
},
"DataRetention": {
"Expiry": "2020-11-14 03:03:10 +0000 UTC"
},
"Count": {
"Total": 4,
"Consented": 4
},
"Consents": [
{
"ID": "5dae01ee267e930001609aa8",
"Description": "Name",
"Value": "",
"Status": {
"Consent": "Allow",
"TimeStamp": "0001-01-01T00:00:00Z",
"Days": 0,
"Remaining": 0
}
}
]
}
]
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Return consents and purposes | Inline |
401 | Unauthorized | Unauthorized | None |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» ID | string | false | none | none |
» OrgID | string | false | none | none |
» UserID | string | false | none | none |
» ConsentsAndPurposes | [object] | false | none | none |
»» Purpose | Purpose | false | none | none |
»»» ID | string | false | none | none |
»»» Name | string | false | none | none |
»»» Description | string | false | none | none |
»»» LawfulUsage | boolean | false | none | none |
»»» PolicyURL | string | false | none | none |
»» DataRetention | object | false | none | none |
»»» Expiry | string | false | none | none |
»» Count | object | false | none | none |
»»» Total | integer | false | none | none |
»»» Consented | integer | false | none | none |
»» Consents | [AttributeConsent] | false | none | none |
»»» ID | string | false | none | none |
»»» Description | string | false | none | none |
»»» Value | string | false | none | none |
»»» Status | object | false | none | none |
»»»» Consent | string | false | none | none |
»»»» TimeStamp | string(date-time) | false | none | none |
»»»» Days | integer | false | none | none |
»»»» Remaining | integer | false | none | none |
Update an attribute consent
Code samples
# You can also use wget
curl -X PATCH https://api.igrant.io/v1/organizations/{orgID}/users/{userID}/consents/{consentID}/purposes/{purposeID}/attributes/{attributeID} \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
PATCH https://api.igrant.io/v1/organizations/{orgID}/users/{userID}/consents/{consentID}/purposes/{purposeID}/attributes/{attributeID} HTTP/1.1
Host: api.igrant.io
Content-Type: application/json
Accept: application/json
const inputBody = '{
"consented": "Allow",
"days": 0
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
fetch('https://api.igrant.io/v1/organizations/{orgID}/users/{userID}/consents/{consentID}/purposes/{purposeID}/attributes/{attributeID}',
{
method: 'PATCH',
body: 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',
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.patch 'https://api.igrant.io/v1/organizations/{orgID}/users/{userID}/consents/{consentID}/purposes/{purposeID}/attributes/{attributeID}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.patch('https://api.igrant.io/v1/organizations/{orgID}/users/{userID}/consents/{consentID}/purposes/{purposeID}/attributes/{attributeID}', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('PATCH','https://api.igrant.io/v1/organizations/{orgID}/users/{userID}/consents/{consentID}/purposes/{purposeID}/attributes/{attributeID}', array(
'headers' => $headers,
'json' => $request_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://api.igrant.io/v1/organizations/{orgID}/users/{userID}/consents/{consentID}/purposes/{purposeID}/attributes/{attributeID}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PATCH");
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"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("PATCH", "https://api.igrant.io/v1/organizations/{orgID}/users/{userID}/consents/{consentID}/purposes/{purposeID}/attributes/{attributeID}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
PATCH /organizations/{orgID}/users/{userID}/consents/{consentID}/purposes/{purposeID}/attributes/{attributeID}
Updates a single attribute consent for a usage purpose
Body parameter
{
"consented": "Allow",
"days": 0
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
orgID | path | string | true | Organization ID |
userID | path | string | true | User ID |
consentID | path | string | true | Consent ID |
purposeID | path | string | true | Purpose ID |
attributeID | path | string | true | Attribute ID |
body | body | object | true | none |
» consented | body | string | true | none |
» days | body | integer | true | none |
Example responses
200 Response
{
"Msg": "Consent updated successfully",
"Status": 200
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Consent updated successfully | Inline |
401 | Unauthorized | Unauthorized | None |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» Msg | string | false | none | none |
» Status | integer | false | none | none |
Notify consent requests
Code samples
# You can also use wget
curl -X POST https://api.igrant.io/v1/organizations/{orgID}/purposes/{purposeID}/attributes/consent \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer {access-token}'
POST https://api.igrant.io/v1/organizations/{orgID}/purposes/{purposeID}/attributes/consent HTTP/1.1
Host: api.igrant.io
Content-Type: application/json
const inputBody = '{
"attributeids": [
"5f1df5c84e26ea0001b9f3a7"
]
}';
const headers = {
'Content-Type':'application/json',
'Authorization':'Bearer {access-token}'
};
fetch('https://api.igrant.io/v1/organizations/{orgID}/purposes/{purposeID}/attributes/consent',
{
method: 'POST',
body: 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',
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.post 'https://api.igrant.io/v1/organizations/{orgID}/purposes/{purposeID}/attributes/consent',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.post('https://api.igrant.io/v1/organizations/{orgID}/purposes/{purposeID}/attributes/consent', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','https://api.igrant.io/v1/organizations/{orgID}/purposes/{purposeID}/attributes/consent', array(
'headers' => $headers,
'json' => $request_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://api.igrant.io/v1/organizations/{orgID}/purposes/{purposeID}/attributes/consent");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
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"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://api.igrant.io/v1/organizations/{orgID}/purposes/{purposeID}/attributes/consent", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /organizations/{orgID}/purposes/{purposeID}/attributes/consent
Make special request for consent for an attribute for all users in this organization. A notification is sent if the user consent is not present for the given attribute i.e. it is Disallow (as a notification to mobile app)
Body parameter
{
"attributeids": [
"5f1df5c84e26ea0001b9f3a7"
]
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
orgID | path | string | true | Organization ID |
purposeID | path | string | true | Purpose ID |
body | body | object | false | none |
» attributeids | body | [string] | false | none |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
202 | Accepted | Notification requesting attribute consent is sent to user devices | None |
401 | Unauthorized | Unauthorized | None |
Get all consented users (Attribute)
Code samples
# You can also use wget
curl -X GET https://api.igrant.io/v1/organizations/{orgID}/purposes/{purposeID}/attributes/{attributeID}/consented/users \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
GET https://api.igrant.io/v1/organizations/{orgID}/purposes/{purposeID}/attributes/{attributeID}/consented/users HTTP/1.1
Host: api.igrant.io
Accept: application/json
const headers = {
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
fetch('https://api.igrant.io/v1/organizations/{orgID}/purposes/{purposeID}/attributes/{attributeID}/consented/users',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.get 'https://api.igrant.io/v1/organizations/{orgID}/purposes/{purposeID}/attributes/{attributeID}/consented/users',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.get('https://api.igrant.io/v1/organizations/{orgID}/purposes/{purposeID}/attributes/{attributeID}/consented/users', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','https://api.igrant.io/v1/organizations/{orgID}/purposes/{purposeID}/attributes/{attributeID}/consented/users', array(
'headers' => $headers,
'json' => $request_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://api.igrant.io/v1/organizations/{orgID}/purposes/{purposeID}/attributes/{attributeID}/consented/users");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
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"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://api.igrant.io/v1/organizations/{orgID}/purposes/{purposeID}/attributes/{attributeID}/consented/users", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /organizations/{orgID}/purposes/{purposeID}/attributes/{attributeID}/consented/users
Gets all users who consented to a given attribute for an usage purpose
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
orgID | path | string | true | Organization ID |
purposeID | path | string | true | Purpose ID |
attributeID | path | string | true | Attribute ID |
Example responses
200 Response
{
"Users": [
{
"ID": "5dbc02ecb99fd0000157547a",
"Name": "Donny Yang",
"Phone": "+44 7744 156699",
"Email": "donny@yopmail.com"
}
],
"Links": {
"Self": "https://<server-url>/5dae01aa267e930001609aa4/purposes/5dae1058a1215e00012103d8/attributes/5dae106ba1215e00012103d9/consented/users?limit=50",
"Next": "https://<server-url>/5dae01aa267e930001609aa4/purposes/5dae1058a1215e00012103d8/attributes/5dae106ba1215e00012103d9/consented/users?limit=50&startid=5dbc02ecb99fd0000157547a"
}
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Returns users | Inline |
401 | Unauthorized | Unauthorized | None |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» Users | [object] | false | none | none |
»» ID | string | false | none | none |
»» Name | string | false | none | none |
»» Phone | string | false | none | none |
string | false | none | none | |
» Links | object | false | none | none |
»» Self | string | false | none | none |
»» Next | string | false | none | none |
Get all consented users (Purpose)
Code samples
# You can also use wget
curl -X GET https://api.igrant.io/v1/organizations/{orgID}/purposes/{purposeID}/consented/users \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
GET https://api.igrant.io/v1/organizations/{orgID}/purposes/{purposeID}/consented/users HTTP/1.1
Host: api.igrant.io
Accept: application/json
const headers = {
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
fetch('https://api.igrant.io/v1/organizations/{orgID}/purposes/{purposeID}/consented/users',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.get 'https://api.igrant.io/v1/organizations/{orgID}/purposes/{purposeID}/consented/users',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.get('https://api.igrant.io/v1/organizations/{orgID}/purposes/{purposeID}/consented/users', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','https://api.igrant.io/v1/organizations/{orgID}/purposes/{purposeID}/consented/users', array(
'headers' => $headers,
'json' => $request_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://api.igrant.io/v1/organizations/{orgID}/purposes/{purposeID}/consented/users");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
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"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://api.igrant.io/v1/organizations/{orgID}/purposes/{purposeID}/consented/users", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /organizations/{orgID}/purposes/{purposeID}/consented/users
Gets all users who consented to a given usage purpose
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
orgID | path | string | true | Organization ID |
purposeID | path | string | true | Purpose ID |
limit | query | integer | false | Pagination limit |
startid | query | string | false | Pagination start ID (for e.g. action log ID) |
Example responses
200 Response
{
"Users": [
{
"ID": "5dbc02ecb99fd0000157547a",
"Name": "Donny Yang",
"Phone": "+44 7744 156699",
"Email": "donny@yopmail.com"
}
],
"Links": {
"Self": "https://<server-url>/5dae01aa267e930001609aa4/purposes/5dae1058a1215e00012103d8/consented/users?limit=50",
"Next": "https://<server-url>/5dae01aa267e930001609aa4/purposes/5dae1058a1215e00012103d8/consented/users?limit=50&startid=5db0181fa531350001afc7d5"
}
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Returns users | Inline |
401 | Unauthorized | Unauthorized | None |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» Users | [object] | false | none | none |
»» ID | string | false | none | none |
»» Name | string | false | none | none |
»» Phone | string | false | none | none |
string | false | none | none | |
» Links | object | false | none | none |
»» Self | string | false | none | none |
»» Next | string | false | none | none |
Service management (User)
iGrant.io enables a multi-operator environment via a distributed service registry. The service management functions are at two levels: one at the individual level and the other at the organisational level. This section lists all service management functions towards individual users. This includes functions like registrations, user profile management, subscription to a specific organisatione etc.
Add anonymous user
Code samples
# You can also use wget
curl -X POST https://api.igrant.io/v1/organizations/{organizationID}/users/anonymous \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
POST https://api.igrant.io/v1/organizations/{organizationID}/users/anonymous HTTP/1.1
Host: api.igrant.io
Accept: application/json
const headers = {
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
fetch('https://api.igrant.io/v1/organizations/{organizationID}/users/anonymous',
{
method: 'POST',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.post 'https://api.igrant.io/v1/organizations/{organizationID}/users/anonymous',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.post('https://api.igrant.io/v1/organizations/{organizationID}/users/anonymous', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','https://api.igrant.io/v1/organizations/{organizationID}/users/anonymous', array(
'headers' => $headers,
'json' => $request_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://api.igrant.io/v1/organizations/{organizationID}/users/anonymous");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
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"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://api.igrant.io/v1/organizations/{organizationID}/users/anonymous", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /organizations/{organizationID}/users/anonymous
Add anonymous user
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
organizationID | path | string | true | Organisation ID |
Example responses
201 Response
{
"ID": "5daf22cea531351111afc7c8",
"Name": "George Floyd",
"IamID": "9d8c4h69-9fb2-4115-a4c3-53bddb8f2d7f",
"Email": "dmart@yopmail.com",
"Phone": "+46 7252 98991",
"ImageID": "5f1458a5chaa930001e78f12",
"ImageURL": "https:/<server-url>/image/5f1458a5chaa930001e78f12",
"LastVisit": "2020-07-22T18:04:02Z",
"Client": {
"Token": "fEkxEwh4T2mr-B4yQoZ9TT:APA91bHibhwLXkc2l6LxWxHW5TrKBoLrXGCHDO6A9pXQ0ShvDYPfxXm57D8tIsR-fwybjs-_OFXCgCbBQpYVON2svUiooWgJBFETXg_jUGy0B9etUHFnyuCbXPihyoCuJc2Gn6s9XkN_",
"Type": 2
},
"Orgs": [
{
"OrgID": "5dae2a9fa1215e00012103e4",
"Name": "Nordea Bank AB",
"Location": "Stockholm, Sweden",
"Type": "Banking and Finance",
"TypeID": "5d95a566a67c8800012f27d1",
"EulaAccepted": false
}
],
"APIKey": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyaWQiOiI1ZGFmMjJjZWE1MzEzNTAwMDFhZmM3YzgiLCJleHAiOjE2MDQwNjMwNjV9.Irk0XgXfVhIdlgBNz6ggEXlvoIPtzUzJv4-x0VKYBGE",
"Roles": [
{
"RoleID": 1,
"OrgID": "5daf22d0a531350001afc7c9"
}
]
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
201 | Created | Returns user | User |
Reset user password
Code samples
# You can also use wget
curl -X POST https://api.igrant.io/v1/user/password/reset \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer {access-token}'
POST https://api.igrant.io/v1/user/password/reset HTTP/1.1
Host: api.igrant.io
Content-Type: application/json
const inputBody = '{
"password": "qwerty123"
}';
const headers = {
'Content-Type':'application/json',
'Authorization':'Bearer {access-token}'
};
fetch('https://api.igrant.io/v1/user/password/reset',
{
method: 'POST',
body: 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',
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.post 'https://api.igrant.io/v1/user/password/reset',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.post('https://api.igrant.io/v1/user/password/reset', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','https://api.igrant.io/v1/user/password/reset', array(
'headers' => $headers,
'json' => $request_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://api.igrant.io/v1/user/password/reset");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
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"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://api.igrant.io/v1/user/password/reset", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /user/password/reset
Resets a user password using the current password.
Body parameter
{
"password": "qwerty123"
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | object | true | Current password |
» password | body | string | true | none |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | User password resetted successfully | None |
400 | Bad Request | Bad request | None |
401 | Unauthorized | Unauthorized | None |
Forgot user password
Code samples
# You can also use wget
curl -X PUT https://api.igrant.io/v1/user/password/forgot \
-H 'Content-Type: application/json'
PUT https://api.igrant.io/v1/user/password/forgot HTTP/1.1
Host: api.igrant.io
Content-Type: application/json
const inputBody = '{
"username": "admin@abc.com"
}';
const headers = {
'Content-Type':'application/json'
};
fetch('https://api.igrant.io/v1/user/password/forgot',
{
method: 'PUT',
body: 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'
}
result = RestClient.put 'https://api.igrant.io/v1/user/password/forgot',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json'
}
r = requests.put('https://api.igrant.io/v1/user/password/forgot', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/json',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('PUT','https://api.igrant.io/v1/user/password/forgot', array(
'headers' => $headers,
'json' => $request_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://api.igrant.io/v1/user/password/forgot");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PUT");
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"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("PUT", "https://api.igrant.io/v1/user/password/forgot", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
PUT /user/password/forgot
Forgot user password is used to request a password reset. A notification is sent to the user reset the password to the registered email ID.
Body parameter
{
"username": "admin@abc.com"
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | object | true | Username |
» username | body | string | false | none |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | User forgot password action handled successfully | None |
400 | Bad Request | Bad request | None |
401 | Unauthorized | Unauthorized | None |
Get user image
Code samples
# You can also use wget
curl -X GET https://api.igrant.io/v1/users/{userID}/image/{imageID} \
-H 'Accept: image/jpeg' \
-H 'Authorization: Bearer {access-token}'
GET https://api.igrant.io/v1/users/{userID}/image/{imageID} HTTP/1.1
Host: api.igrant.io
Accept: image/jpeg
const headers = {
'Accept':'image/jpeg',
'Authorization':'Bearer {access-token}'
};
fetch('https://api.igrant.io/v1/users/{userID}/image/{imageID}',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'image/jpeg',
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.get 'https://api.igrant.io/v1/users/{userID}/image/{imageID}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'image/jpeg',
'Authorization': 'Bearer {access-token}'
}
r = requests.get('https://api.igrant.io/v1/users/{userID}/image/{imageID}', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'image/jpeg',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','https://api.igrant.io/v1/users/{userID}/image/{imageID}', array(
'headers' => $headers,
'json' => $request_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://api.igrant.io/v1/users/{userID}/image/{imageID}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
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"
)
func main() {
headers := map[string][]string{
"Accept": []string{"image/jpeg"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://api.igrant.io/v1/users/{userID}/image/{imageID}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /users/{userID}/image/{imageID}
Get the image for a particular user
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
userID | path | string | true | User ID |
imageID | path | string | true | Image ID |
Example responses
200 Response
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Returns user image | string |
401 | Unauthorized | Unauthorized | None |
404 | Not Found | 404 not found | None |
Update users image
Code samples
# You can also use wget
curl -X POST https://api.igrant.io/v1/users/{userID}/image \
-H 'Content-Type: multipart/form-data' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
POST https://api.igrant.io/v1/users/{userID}/image HTTP/1.1
Host: api.igrant.io
Content-Type: multipart/form-data
Accept: application/json
const inputBody = '{
"userimage": "string"
}';
const headers = {
'Content-Type':'multipart/form-data',
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
fetch('https://api.igrant.io/v1/users/{userID}/image',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'multipart/form-data',
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.post 'https://api.igrant.io/v1/users/{userID}/image',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'multipart/form-data',
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.post('https://api.igrant.io/v1/users/{userID}/image', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'multipart/form-data',
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','https://api.igrant.io/v1/users/{userID}/image', array(
'headers' => $headers,
'json' => $request_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://api.igrant.io/v1/users/{userID}/image");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
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"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"multipart/form-data"},
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://api.igrant.io/v1/users/{userID}/image", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /users/{userID}/image
Updates the image of a particular user
Body parameter
userimage: string
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
userID | path | string | true | User ID |
body | body | object | true | none |
» userimage | body | string(binary) | true | none |
Example responses
200 Response
{
"User": {
"ID": "5daf22cea531351111afc7c8",
"Name": "George Floyd",
"IamID": "9d8c4h69-9fb2-4115-a4c3-53bddb8f2d7f",
"Email": "dmart@yopmail.com",
"Phone": "+46 7252 98991",
"ImageID": "5f1458a5chaa930001e78f12",
"ImageURL": "https:/<server-url>/image/5f1458a5chaa930001e78f12",
"LastVisit": "2020-07-22T18:04:02Z",
"Client": {
"Token": "fEkxEwh4T2mr-B4yQoZ9TT:APA91bHibhwLXkc2l6LxWxHW5TrKBoLrXGCHDO6A9pXQ0ShvDYPfxXm57D8tIsR-fwybjs-_OFXCgCbBQpYVON2svUiooWgJBFETXg_jUGy0B9etUHFnyuCbXPihyoCuJc2Gn6s9XkN_",
"Type": 2
},
"Orgs": [
{
"OrgID": "5dae2a9fa1215e00012103e4",
"Name": "Nordea Bank AB",
"Location": "Stockholm, Sweden",
"Type": "Banking and Finance",
"TypeID": "5d95a566a67c8800012f27d1",
"EulaAccepted": false
}
],
"APIKey": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyaWQiOiI1ZGFmMjJjZWE1MzEzNTAwMDFhZmM3YzgiLCJleHAiOjE2MDQwNjMwNjV9.Irk0XgXfVhIdlgBNz6ggEXlvoIPtzUzJv4-x0VKYBGE",
"Roles": [
{
"RoleID": 1,
"OrgID": "5daf22d0a531350001afc7c9"
}
]
}
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Returns user | Inline |
401 | Unauthorized | Unauthorized | None |
500 | Internal Server Error | Invalid user image provided | None |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» User | User | false | none | none |
»» ID | string | false | none | none |
»» Name | string | false | none | none |
»» IamID | string | false | none | none |
string | false | none | none | |
»» Phone | string | false | none | none |
»» ImageID | string | false | none | none |
»» ImageURL | string | false | none | none |
»» LastVisit | string(date-time) | false | none | none |
»» Client | object | false | none | none |
»»» Token | string | false | none | none |
»»» Type | integer | false | none | none |
»» Orgs | [object] | false | none | none |
»»» OrgID | string | false | none | none |
»»» Name | string | false | none | none |
»»» Location | string | false | none | none |
»»» Type | string | false | none | none |
»»» TypeID | string | false | none | none |
»»» EulaAccepted | boolean | false | none | none |
»» APIKey | string | false | none | none |
»» Roles | [object] | false | none | none |
»»» RoleID | integer | false | none | none |
»»» OrgID | string | false | none | none |
Delete user image
Code samples
# You can also use wget
curl -X DELETE https://api.igrant.io/v1/users/{userID}/image \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
DELETE https://api.igrant.io/v1/users/{userID}/image HTTP/1.1
Host: api.igrant.io
Accept: application/json
const headers = {
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
fetch('https://api.igrant.io/v1/users/{userID}/image',
{
method: 'DELETE',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.delete 'https://api.igrant.io/v1/users/{userID}/image',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.delete('https://api.igrant.io/v1/users/{userID}/image', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('DELETE','https://api.igrant.io/v1/users/{userID}/image', array(
'headers' => $headers,
'json' => $request_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://api.igrant.io/v1/users/{userID}/image");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("DELETE");
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"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("DELETE", "https://api.igrant.io/v1/users/{userID}/image", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
DELETE /users/{userID}/image
Deletes a particular user image
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
userID | path | string | true | User ID |
Example responses
200 Response
{
"User": {
"ID": "5daf22cea531351111afc7c8",
"Name": "George Floyd",
"IamID": "9d8c4h69-9fb2-4115-a4c3-53bddb8f2d7f",
"Email": "dmart@yopmail.com",
"Phone": "+46 7252 98991",
"ImageID": "5f1458a5chaa930001e78f12",
"ImageURL": "https:/<server-url>/image/5f1458a5chaa930001e78f12",
"LastVisit": "2020-07-22T18:04:02Z",
"Client": {
"Token": "fEkxEwh4T2mr-B4yQoZ9TT:APA91bHibhwLXkc2l6LxWxHW5TrKBoLrXGCHDO6A9pXQ0ShvDYPfxXm57D8tIsR-fwybjs-_OFXCgCbBQpYVON2svUiooWgJBFETXg_jUGy0B9etUHFnyuCbXPihyoCuJc2Gn6s9XkN_",
"Type": 2
},
"Orgs": [
{
"OrgID": "5dae2a9fa1215e00012103e4",
"Name": "Nordea Bank AB",
"Location": "Stockholm, Sweden",
"Type": "Banking and Finance",
"TypeID": "5d95a566a67c8800012f27d1",
"EulaAccepted": false
}
],
"APIKey": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyaWQiOiI1ZGFmMjJjZWE1MzEzNTAwMDFhZmM3YzgiLCJleHAiOjE2MDQwNjMwNjV9.Irk0XgXfVhIdlgBNz6ggEXlvoIPtzUzJv4-x0VKYBGE",
"Roles": [
{
"RoleID": 1,
"OrgID": "5daf22d0a531350001afc7c9"
}
]
}
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Returns user | Inline |
401 | Unauthorized | Unauthorized | None |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» User | User | false | none | none |
»» ID | string | false | none | none |
»» Name | string | false | none | none |
»» IamID | string | false | none | none |
string | false | none | none | |
»» Phone | string | false | none | none |
»» ImageID | string | false | none | none |
»» ImageURL | string | false | none | none |
»» LastVisit | string(date-time) | false | none | none |
»» Client | object | false | none | none |
»»» Token | string | false | none | none |
»»» Type | integer | false | none | none |
»» Orgs | [object] | false | none | none |
»»» OrgID | string | false | none | none |
»»» Name | string | false | none | none |
»»» Location | string | false | none | none |
»»» Type | string | false | none | none |
»»» TypeID | string | false | none | none |
»»» EulaAccepted | boolean | false | none | none |
»» APIKey | string | false | none | none |
»» Roles | [object] | false | none | none |
»»» RoleID | integer | false | none | none |
»»» OrgID | string | false | none | none |
Service management (Organization)
iGrant.io enables a multi-operator environment via a distributed service registry. The service management functions are at two levels: one at the individual level and the other at the organisational level. This section lists all service management functions towards organisations. This includes functions like organisation onboarding/provisioning, managing organisation users, adding end users or consumers to organisation, agreement handling between a organisations for data exchange etc.
Register an organisation
Code samples
# You can also use wget
curl -X POST https://api.igrant.io/v1/organizations \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
POST https://api.igrant.io/v1/organizations HTTP/1.1
Host: api.igrant.io
Content-Type: application/json
Accept: application/json
const inputBody = '{
"name": "Delphyx LLP",
"location": "London, GB",
"typeid": "5f0570c04a05b00001a05cc2"
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
fetch('https://api.igrant.io/v1/organizations',
{
method: 'POST',
body: 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',
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.post 'https://api.igrant.io/v1/organizations',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.post('https://api.igrant.io/v1/organizations', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','https://api.igrant.io/v1/organizations', array(
'headers' => $headers,
'json' => $request_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://api.igrant.io/v1/organizations");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
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"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://api.igrant.io/v1/organizations", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /organizations
Registers an organisation to the system
Body parameter
{
"name": "Delphyx LLP",
"location": "London, GB",
"typeid": "5f0570c04a05b00001a05cc2"
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | object | true | none |
» name | body | string | true | none |
» location | body | string | true | none |
» typeid | body | string | true | none |
» eulaurl | body | string | false | none |
» hlcsupport | body | boolean | false | none |
» description | body | string | false | none |
Example responses
201 Response
{
"ID": "5daf22d0a531350001afc7c9",
"Name": "DMart Retail Chain",
"CoverImageID": "",
"CoverImageURL": "",
"LogoImageID": "5ecf5f979a273200016a13ef",
"LogoImageURL": "https://<server-url>/5daf22d0a531350001afc7c9/image/5ecf5f979a273200016a13ef",
"Location": "Stockholm, Sweden",
"Type": {
"ID": "5d17cc114dacb40001b29094",
"Type": "Retail",
"ImageID": "5d17cc7f4dacb40001b29095",
"ImageURL": "https://staging-api.igrant.io/v1/organizations/types/5d17cc114dacb40001b29094/image"
},
"Description": "",
"Enabled": true,
"PolicyURL": "",
"EulaURL": "",
"Templates": [
{
"ID": "5f187f9efd59960001434c2e",
"Consent": "Age",
"PurposeIDs": [
"5db0303ba531350001afc7e0",
"5db03048a531350001afc7e1"
]
}
],
"Purposes": [
{
"ID": "5db0303ba531350001afc7e0",
"Name": "Marketing and campaign",
"Description": "For this purpose, following personal data attributes shown below are used. You may consent to share your data at attribute level.",
"LawfulUsage": false,
"PolicyURL": "https://orgname.com/policy_default.html"
}
],
"Admins": [
{
"UserID": "5daf22cea531350001afc7c8",
"RoleID": 1
}
],
"BillingInfo": {
"BillingRegistrationID": "cus_G2URbi8W6DT7hh",
"MaxUserCounter": 4,
"DefaultChargeNotified": false,
"CurrentPeriodEnd": 0,
"PrevMonthUsers": 1,
"PayPerUserInfo": {
"UserCommitment": 0,
"TimeCommitment": "",
"CancelOnCommitmentEnd": false,
"CommitmentPeriodRemaining": 0
},
"DefaultPaymentSource": {
"Brand": "Visa",
"ExpiryMonth": 4,
"ExpiryYear": 2024,
"Last4Digits": "4242"
},
"Address": {
"Name": "George Floyd",
"City": "Stockholm",
"Country": "Sweden",
"Line1": "",
"Line2": "",
"PostalCode": "",
"State": ""
},
"ServiceAgreementVersion": "v2.0",
"FreeTrialExpired": true
},
"Subs": {
"Method": 0,
"Key": ""
},
"HlcSupport": false,
"PrivacyDashboard": {
"HostName": "dmart.igrant.io",
"Version": "v1.1.7",
"Status": 2,
"Delete": false
},
"DataRetention": {
"RetentionPeriod": 800,
"Enabled": true
}
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
201 | Created | Returns created organisation | Organisation |
401 | Unauthorized | Unauthorized | None |
Get org user roles
Code samples
# You can also use wget
curl -X GET https://api.igrant.io/v1/organizations/roles \
-H 'Accept: application/json'
GET https://api.igrant.io/v1/organizations/roles HTTP/1.1
Host: api.igrant.io
Accept: application/json
const headers = {
'Accept':'application/json'
};
fetch('https://api.igrant.io/v1/organizations/roles',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json'
}
result = RestClient.get 'https://api.igrant.io/v1/organizations/roles',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json'
}
r = requests.get('https://api.igrant.io/v1/organizations/roles', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','https://api.igrant.io/v1/organizations/roles', array(
'headers' => $headers,
'json' => $request_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://api.igrant.io/v1/organizations/roles");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
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"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://api.igrant.io/v1/organizations/roles", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /organizations/roles
Get the list of organisational user roles
Example responses
200 Response
[
{
"ID": 1,
"Role": "Admin"
},
{
"ID": 2,
"Role": "Dpo"
},
{
"ID": 3,
"Role": "Developer"
}
]
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Returns the list of organisation roles | Inline |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» ID | integer | false | none | none |
» Role | string | false | none | none |
Get subscription methods
Code samples
# You can also use wget
curl -X GET https://api.igrant.io/v1/organizations/subscribe-methods \
-H 'Accept: application/json'
GET https://api.igrant.io/v1/organizations/subscribe-methods HTTP/1.1
Host: api.igrant.io
Accept: application/json
const headers = {
'Accept':'application/json'
};
fetch('https://api.igrant.io/v1/organizations/subscribe-methods',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json'
}
result = RestClient.get 'https://api.igrant.io/v1/organizations/subscribe-methods',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json'
}
r = requests.get('https://api.igrant.io/v1/organizations/subscribe-methods', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','https://api.igrant.io/v1/organizations/subscribe-methods', array(
'headers' => $headers,
'json' => $request_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://api.igrant.io/v1/organizations/subscribe-methods");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
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"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://api.igrant.io/v1/organizations/subscribe-methods", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /organizations/subscribe-methods
Gets all organisation subscription methods configured in the system
Example responses
200 Response
{
"Methods": [
{
"ID": 1,
"Method": "Key-Based"
}
]
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Returns all organisation subscription methods | Inline |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» Methods | [object] | false | none | none |
»» ID | integer | false | none | none |
»» Method | string | false | none | none |
Gets organization type
Code samples
# You can also use wget
curl -X GET https://api.igrant.io/v1/organizations/types/{typeID} \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
GET https://api.igrant.io/v1/organizations/types/{typeID} HTTP/1.1
Host: api.igrant.io
Accept: application/json
const headers = {
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
fetch('https://api.igrant.io/v1/organizations/types/{typeID}',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.get 'https://api.igrant.io/v1/organizations/types/{typeID}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.get('https://api.igrant.io/v1/organizations/types/{typeID}', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','https://api.igrant.io/v1/organizations/types/{typeID}', array(
'headers' => $headers,
'json' => $request_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://api.igrant.io/v1/organizations/types/{typeID}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
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"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://api.igrant.io/v1/organizations/types/{typeID}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /organizations/types/{typeID}
Gets organization catogory type by given ID
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
typeID | path | string | true | Organisation type ID |
Example responses
200 Response
{
"ID": "5d17cc114dacb40001b29094",
"Type": "Retail",
"ImageID": "5d17cc7f4dacb40001b29095",
"ImageURL": "https://staging-api.igrant.io/v1/organizations/types/5d17cc114dacb40001b29094/image"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Returns the organization type | OrganisationType |
401 | Unauthorized | Unauthorized | None |
Get organization
Code samples
# You can also use wget
curl -X GET https://api.igrant.io/v1/organizations/{organizationID} \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
GET https://api.igrant.io/v1/organizations/{organizationID} HTTP/1.1
Host: api.igrant.io
Accept: application/json
const headers = {
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
fetch('https://api.igrant.io/v1/organizations/{organizationID}',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.get 'https://api.igrant.io/v1/organizations/{organizationID}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.get('https://api.igrant.io/v1/organizations/{organizationID}', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','https://api.igrant.io/v1/organizations/{organizationID}', array(
'headers' => $headers,
'json' => $request_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://api.igrant.io/v1/organizations/{organizationID}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
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"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://api.igrant.io/v1/organizations/{organizationID}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /organizations/{organizationID}
Get organization by ID
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
organizationID | path | string | true | Organisation ID |
Example responses
200 Response
{
"Organization": {
"ID": "5daf22d0a531350001afc7c9",
"Name": "DMart Retail Chain",
"CoverImageID": "",
"CoverImageURL": "",
"LogoImageID": "5ecf5f979a273200016a13ef",
"LogoImageURL": "https://<server-url>/5daf22d0a531350001afc7c9/image/5ecf5f979a273200016a13ef",
"Location": "Stockholm, Sweden",
"Type": {
"ID": "5d17cc114dacb40001b29094",
"Type": "Retail",
"ImageID": "5d17cc7f4dacb40001b29095",
"ImageURL": "https://staging-api.igrant.io/v1/organizations/types/5d17cc114dacb40001b29094/image"
},
"Description": "",
"Enabled": true,
"PolicyURL": "",
"EulaURL": "",
"Templates": [
{
"ID": "5f187f9efd59960001434c2e",
"Consent": "Age",
"PurposeIDs": [
"5db0303ba531350001afc7e0",
"5db03048a531350001afc7e1"
]
}
],
"Purposes": [
{
"ID": "5db0303ba531350001afc7e0",
"Name": "Marketing and campaign",
"Description": "For this purpose, following personal data attributes shown below are used. You may consent to share your data at attribute level.",
"LawfulUsage": false,
"PolicyURL": "https://orgname.com/policy_default.html"
}
],
"Admins": [
{
"UserID": "5daf22cea531350001afc7c8",
"RoleID": 1
}
],
"BillingInfo": {
"BillingRegistrationID": "cus_G2URbi8W6DT7hh",
"MaxUserCounter": 4,
"DefaultChargeNotified": false,
"CurrentPeriodEnd": 0,
"PrevMonthUsers": 1,
"PayPerUserInfo": {
"UserCommitment": 0,
"TimeCommitment": "",
"CancelOnCommitmentEnd": false,
"CommitmentPeriodRemaining": 0
},
"DefaultPaymentSource": {
"Brand": "Visa",
"ExpiryMonth": 4,
"ExpiryYear": 2024,
"Last4Digits": "4242"
},
"Address": {
"Name": "George Floyd",
"City": "Stockholm",
"Country": "Sweden",
"Line1": "",
"Line2": "",
"PostalCode": "",
"State": ""
},
"ServiceAgreementVersion": "v2.0",
"FreeTrialExpired": true
},
"Subs": {
"Method": 0,
"Key": ""
},
"HlcSupport": false,
"PrivacyDashboard": {
"HostName": "dmart.igrant.io",
"Version": "v1.1.7",
"Status": 2,
"Delete": false
},
"DataRetention": {
"RetentionPeriod": 800,
"Enabled": true
}
}
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Returns organization | Inline |
401 | Unauthorized | Unauthorized | None |
404 | Not Found | 404 not found | None |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» Organization | Organisation | false | none | none |
»» ID | string | false | none | none |
»» Name | string | false | none | none |
»» CoverImageID | string | false | none | none |
»» CoverImageURL | string | false | none | none |
»» LogoImageID | string | false | none | none |
»» LogoImageURL | string | false | none | none |
»» Location | string | false | none | none |
»» Type | OrganisationType | false | none | none |
»»» ID | string | false | none | none |
»»» Type | string | false | none | none |
»»» ImageID | string | false | none | none |
»»» ImageURL | string | false | none | none |
»» Description | string | false | none | none |
»» Enabled | boolean | false | none | none |
»» PolicyURL | string | false | none | none |
»» EulaURL | string | false | none | none |
»» Templates | [allOf] | false | none | none |
allOf
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
»»» anonymous | Template | false | none | none |
»»»» ID | string | false | none | none |
»»»» Consent | string | false | none | none |
and
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
»»» anonymous | object | false | none | none |
»»»» PurposeIDs | [string] | false | none | none |
continued
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
»» Purposes | [Purpose] | false | none | none |
»»» ID | string | false | none | none |
»»» Name | string | false | none | none |
»»» Description | string | false | none | none |
»»» LawfulUsage | boolean | false | none | none |
»»» PolicyURL | string | false | none | none |
»» Admins | [object] | false | none | none |
»»» UserID | string | false | none | none |
»»» RoleID | string | false | none | none |
»» BillingInfo | OrganisationBillingInfo | false | none | none |
»»» BillingRegistrationID | string | false | none | none |
»»» MaxUserCounter | integer | false | none | none |
»»» DefaultChargeNotified | boolean | false | none | none |
»»» CurrentPeriodEnd | integer | false | none | none |
»»» PrevMonthUsers | integer | false | none | none |
»»» PayPerUserInfo | object | false | none | none |
»»»» UserCommitment | integer | false | none | none |
»»»» TimeCommitment | string | false | none | none |
»»»» CancelOnCommitmentEnd | boolean | false | none | none |
»»»» CommitmentPeriodRemaining | integer | false | none | none |
»»» DefaultPaymentSource | object | false | none | none |
»»»» Brand | string | false | none | none |
»»»» ExpiryMonth | integer | false | none | none |
»»»» ExpiryYear | integer | false | none | none |
»»»» Last4Digits | string | false | none | none |
»»» Address | object | false | none | none |
»»»» Name | string | false | none | none |
»»»» City | string | false | none | none |
»»»» Country | string | false | none | none |
»»»» Line1 | string | false | none | none |
»»»» Line2 | string | false | none | none |
»»»» PostalCode | string | false | none | none |
»»»» State | string | false | none | none |
»»» ServiceAgreementVersion | string | false | none | none |
»»» FreeTrialExpired | boolean | false | none | none |
»» Subs | object | false | none | none |
»»» Method | integer | false | none | none |
»»» Key | string | false | none | none |
»» HlcSupport | boolean | false | none | none |
»» PrivacyDashboard | OrganisationPrivacyBoard | false | none | none |
»»» HostName | string | false | none | none |
»»» Version | string | false | none | none |
»»» Status | integer | false | none | none |
»»» Delete | boolean | false | none | none |
»» DataRetention | OrganisationDataRetention | false | none | none |
»»» RetentionPeriod | integer | false | none | none |
»»» Enabled | boolean | false | none | none |
Update an organization
Code samples
# You can also use wget
curl -X PATCH https://api.igrant.io/v1/organizations/{organizationID} \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer {access-token}'
PATCH https://api.igrant.io/v1/organizations/{organizationID} HTTP/1.1
Host: api.igrant.io
Content-Type: application/json
const inputBody = '{
"name": "string",
"location": "string",
"description": "string",
"policyurl": "string"
}';
const headers = {
'Content-Type':'application/json',
'Authorization':'Bearer {access-token}'
};
fetch('https://api.igrant.io/v1/organizations/{organizationID}',
{
method: 'PATCH',
body: 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',
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.patch 'https://api.igrant.io/v1/organizations/{organizationID}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.patch('https://api.igrant.io/v1/organizations/{organizationID}', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('PATCH','https://api.igrant.io/v1/organizations/{organizationID}', array(
'headers' => $headers,
'json' => $request_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://api.igrant.io/v1/organizations/{organizationID}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PATCH");
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"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("PATCH", "https://api.igrant.io/v1/organizations/{organizationID}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
PATCH /organizations/{organizationID}
Updates an organization
Body parameter
{
"name": "string",
"location": "string",
"description": "string",
"policyurl": "string"
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
organizationID | path | string | true | Organisation ID |
body | body | object | false | none |
» name | body | string | false | none |
» location | body | string | false | none |
» description | body | string | false | none |
» policyurl | body | string | false | none |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
202 | Accepted | Updated organization | None |
401 | Unauthorized | Unauthorized | None |
404 | Not Found | 404 not found | None |
Get subscription key
Code samples
# You can also use wget
curl -X GET https://api.igrant.io/v1/organizations/{organizationID}/subscribe-key \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
GET https://api.igrant.io/v1/organizations/{organizationID}/subscribe-key HTTP/1.1
Host: api.igrant.io
Accept: application/json
const headers = {
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
fetch('https://api.igrant.io/v1/organizations/{organizationID}/subscribe-key',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.get 'https://api.igrant.io/v1/organizations/{organizationID}/subscribe-key',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.get('https://api.igrant.io/v1/organizations/{organizationID}/subscribe-key', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','https://api.igrant.io/v1/organizations/{organizationID}/subscribe-key', array(
'headers' => $headers,
'json' => $request_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://api.igrant.io/v1/organizations/{organizationID}/subscribe-key");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
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"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://api.igrant.io/v1/organizations/{organizationID}/subscribe-key", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /organizations/{organizationID}/subscribe-key
Gets subscription key if the subscription method is key based
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
organizationID | path | string | true | Organisation ID |
Example responses
200 Response
{
"SubscribeKey": "IT43-YO37-I6GG",
"SubscribeMethod": "Key-Based"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Returns the subscription key and method | Inline |
401 | Unauthorized | Unauthorized | None |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» SubscribeKey | string | false | none | none |
» SubscribeMethod | string | false | none | none |
Renew the subscription key
Code samples
# You can also use wget
curl -X POST https://api.igrant.io/v1/organizations/{organizationID}/subscribe-key/renew \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
POST https://api.igrant.io/v1/organizations/{organizationID}/subscribe-key/renew HTTP/1.1
Host: api.igrant.io
Accept: application/json
const headers = {
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
fetch('https://api.igrant.io/v1/organizations/{organizationID}/subscribe-key/renew',
{
method: 'POST',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.post 'https://api.igrant.io/v1/organizations/{organizationID}/subscribe-key/renew',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.post('https://api.igrant.io/v1/organizations/{organizationID}/subscribe-key/renew', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','https://api.igrant.io/v1/organizations/{organizationID}/subscribe-key/renew', array(
'headers' => $headers,
'json' => $request_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://api.igrant.io/v1/organizations/{organizationID}/subscribe-key/renew");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
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"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://api.igrant.io/v1/organizations/{organizationID}/subscribe-key/renew", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /organizations/{organizationID}/subscribe-key/renew
Renew the subscription key if the subscription method is key based
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
organizationID | path | string | true | Organisation ID |
Example responses
200 Response
{
"SubscribeKey": "69H7-RWT4-CHQJ",
"SubscribeMethod": "Key-Based"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Returns the renewed subscription key | Inline |
400 | Bad Request | Unable to renew since, existing subscription method is not key based | None |
401 | Unauthorized | Unauthorized | None |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» SubscribeKey | string | false | none | none |
» SubscribeMethod | string | false | none | none |
Get subscription method
Code samples
# You can also use wget
curl -X GET https://api.igrant.io/v1/organizations/{organizationID}/subscribe-method \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
GET https://api.igrant.io/v1/organizations/{organizationID}/subscribe-method HTTP/1.1
Host: api.igrant.io
Accept: application/json
const headers = {
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
fetch('https://api.igrant.io/v1/organizations/{organizationID}/subscribe-method',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.get 'https://api.igrant.io/v1/organizations/{organizationID}/subscribe-method',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.get('https://api.igrant.io/v1/organizations/{organizationID}/subscribe-method', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','https://api.igrant.io/v1/organizations/{organizationID}/subscribe-method', array(
'headers' => $headers,
'json' => $request_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://api.igrant.io/v1/organizations/{organizationID}/subscribe-method");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
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"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://api.igrant.io/v1/organizations/{organizationID}/subscribe-method", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /organizations/{organizationID}/subscribe-method
Get the existing subscription method for an organization
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
organizationID | path | string | true | Organisation ID |
Example responses
200 Response
{
"ID": 1,
"Method": "Key-Based"
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Returns subscription method | Inline |
401 | Unauthorized | Unauthorized | None |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» ID | integer | false | none | none |
» Method | string | false | none | none |
Set subscription method
Code samples
# You can also use wget
curl -X POST https://api.igrant.io/v1/organizations/{organizationID}/subscribe-method \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer {access-token}'
POST https://api.igrant.io/v1/organizations/{organizationID}/subscribe-method HTTP/1.1
Host: api.igrant.io
Content-Type: application/json
const inputBody = '{
"subscribemethodid": 1
}';
const headers = {
'Content-Type':'application/json',
'Authorization':'Bearer {access-token}'
};
fetch('https://api.igrant.io/v1/organizations/{organizationID}/subscribe-method',
{
method: 'POST',
body: 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',
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.post 'https://api.igrant.io/v1/organizations/{organizationID}/subscribe-method',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.post('https://api.igrant.io/v1/organizations/{organizationID}/subscribe-method', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','https://api.igrant.io/v1/organizations/{organizationID}/subscribe-method', array(
'headers' => $headers,
'json' => $request_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://api.igrant.io/v1/organizations/{organizationID}/subscribe-method");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
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"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://api.igrant.io/v1/organizations/{organizationID}/subscribe-method", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /organizations/{organizationID}/subscribe-method
Sets how users can subscribe to an organization
Body parameter
{
"subscribemethodid": 1
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
organizationID | path | string | true | Organization ID |
body | body | object | true | none |
» subscribemethodid | body | integer | true | none |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
204 | No Content | Updated subscription method | None |
401 | Unauthorized | Unauthorized | None |
Get subscription status
Code samples
# You can also use wget
curl -X GET https://api.igrant.io/v1/organizations/{organizationID}/subscription \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
GET https://api.igrant.io/v1/organizations/{organizationID}/subscription HTTP/1.1
Host: api.igrant.io
Accept: application/json
const headers = {
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
fetch('https://api.igrant.io/v1/organizations/{organizationID}/subscription',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.get 'https://api.igrant.io/v1/organizations/{organizationID}/subscription',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.get('https://api.igrant.io/v1/organizations/{organizationID}/subscription', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','https://api.igrant.io/v1/organizations/{organizationID}/subscription', array(
'headers' => $headers,
'json' => $request_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://api.igrant.io/v1/organizations/{organizationID}/subscription");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
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"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://api.igrant.io/v1/organizations/{organizationID}/subscription", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /organizations/{organizationID}/subscription
Gets the subscription status of an organisation towards users. Used for troubleshooting purposes or used by Enterprise Dashboards.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
organizationID | path | string | true | Organisation ID |
Example responses
200 Response
{
"Enabled": true
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Returns subscription status | Inline |
401 | Unauthorized | Unauthorized | None |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» Enabled | boolean | false | none | none |
Enable organization
Code samples
# You can also use wget
curl -X POST https://api.igrant.io/v1/organizations/{organizationID}/subscription/enable \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
POST https://api.igrant.io/v1/organizations/{organizationID}/subscription/enable HTTP/1.1
Host: api.igrant.io
Accept: application/json
const headers = {
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
fetch('https://api.igrant.io/v1/organizations/{organizationID}/subscription/enable',
{
method: 'POST',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.post 'https://api.igrant.io/v1/organizations/{organizationID}/subscription/enable',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.post('https://api.igrant.io/v1/organizations/{organizationID}/subscription/enable', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','https://api.igrant.io/v1/organizations/{organizationID}/subscription/enable', array(
'headers' => $headers,
'json' => $request_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://api.igrant.io/v1/organizations/{organizationID}/subscription/enable");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
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"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://api.igrant.io/v1/organizations/{organizationID}/subscription/enable", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /organizations/{organizationID}/subscription/enable
Enable organization for subscription towards users. This is performed once the data model is all uploaded and the organisation is ready for consent management and data exchange.
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
organizationID | path | string | true | Organisation ID |
Example responses
200 Response
{
"Organization": {
"ID": "5daf22d0a531350001afc7c9",
"Name": "DMart Retail Chain",
"CoverImageID": "",
"CoverImageURL": "",
"LogoImageID": "5ecf5f979a273200016a13ef",
"LogoImageURL": "https://<server-url>/5daf22d0a531350001afc7c9/image/5ecf5f979a273200016a13ef",
"Location": "Stockholm, Sweden",
"Type": {
"ID": "5d17cc114dacb40001b29094",
"Type": "Retail",
"ImageID": "5d17cc7f4dacb40001b29095",
"ImageURL": "https://staging-api.igrant.io/v1/organizations/types/5d17cc114dacb40001b29094/image"
},
"Description": "",
"Enabled": true,
"PolicyURL": "",
"EulaURL": "",
"Templates": [
{
"ID": "5f187f9efd59960001434c2e",
"Consent": "Age",
"PurposeIDs": [
"5db0303ba531350001afc7e0",
"5db03048a531350001afc7e1"
]
}
],
"Purposes": [
{
"ID": "5db0303ba531350001afc7e0",
"Name": "Marketing and campaign",
"Description": "For this purpose, following personal data attributes shown below are used. You may consent to share your data at attribute level.",
"LawfulUsage": false,
"PolicyURL": "https://orgname.com/policy_default.html"
}
],
"Admins": [
{
"UserID": "5daf22cea531350001afc7c8",
"RoleID": 1
}
],
"BillingInfo": {
"BillingRegistrationID": "cus_G2URbi8W6DT7hh",
"MaxUserCounter": 4,
"DefaultChargeNotified": false,
"CurrentPeriodEnd": 0,
"PrevMonthUsers": 1,
"PayPerUserInfo": {
"UserCommitment": 0,
"TimeCommitment": "",
"CancelOnCommitmentEnd": false,
"CommitmentPeriodRemaining": 0
},
"DefaultPaymentSource": {
"Brand": "Visa",
"ExpiryMonth": 4,
"ExpiryYear": 2024,
"Last4Digits": "4242"
},
"Address": {
"Name": "George Floyd",
"City": "Stockholm",
"Country": "Sweden",
"Line1": "",
"Line2": "",
"PostalCode": "",
"State": ""
},
"ServiceAgreementVersion": "v2.0",
"FreeTrialExpired": true
},
"Subs": {
"Method": 0,
"Key": ""
},
"HlcSupport": false,
"PrivacyDashboard": {
"HostName": "dmart.igrant.io",
"Version": "v1.1.7",
"Status": 2,
"Delete": false
},
"DataRetention": {
"RetentionPeriod": 800,
"Enabled": true
}
}
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Enabled organisation for subscription | Inline |
401 | Unauthorized | Unauthorized | None |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» Organization | Organisation | false | none | none |
»» ID | string | false | none | none |
»» Name | string | false | none | none |
»» CoverImageID | string | false | none | none |
»» CoverImageURL | string | false | none | none |
»» LogoImageID | string | false | none | none |
»» LogoImageURL | string | false | none | none |
»» Location | string | false | none | none |
»» Type | OrganisationType | false | none | none |
»»» ID | string | false | none | none |
»»» Type | string | false | none | none |
»»» ImageID | string | false | none | none |
»»» ImageURL | string | false | none | none |
»» Description | string | false | none | none |
»» Enabled | boolean | false | none | none |
»» PolicyURL | string | false | none | none |
»» EulaURL | string | false | none | none |
»» Templates | [allOf] | false | none | none |
allOf
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
»»» anonymous | Template | false | none | none |
»»»» ID | string | false | none | none |
»»»» Consent | string | false | none | none |
and
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
»»» anonymous | object | false | none | none |
»»»» PurposeIDs | [string] | false | none | none |
continued
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
»» Purposes | [Purpose] | false | none | none |
»»» ID | string | false | none | none |
»»» Name | string | false | none | none |
»»» Description | string | false | none | none |
»»» LawfulUsage | boolean | false | none | none |
»»» PolicyURL | string | false | none | none |
»» Admins | [object] | false | none | none |
»»» UserID | string | false | none | none |
»»» RoleID | string | false | none | none |
»» BillingInfo | OrganisationBillingInfo | false | none | none |
»»» BillingRegistrationID | string | false | none | none |
»»» MaxUserCounter | integer | false | none | none |
»»» DefaultChargeNotified | boolean | false | none | none |
»»» CurrentPeriodEnd | integer | false | none | none |
»»» PrevMonthUsers | integer | false | none | none |
»»» PayPerUserInfo | object | false | none | none |
»»»» UserCommitment | integer | false | none | none |
»»»» TimeCommitment | string | false | none | none |
»»»» CancelOnCommitmentEnd | boolean | false | none | none |
»»»» CommitmentPeriodRemaining | integer | false | none | none |
»»» DefaultPaymentSource | object | false | none | none |
»»»» Brand | string | false | none | none |
»»»» ExpiryMonth | integer | false | none | none |
»»»» ExpiryYear | integer | false | none | none |
»»»» Last4Digits | string | false | none | none |
»»» Address | object | false | none | none |
»»»» Name | string | false | none | none |
»»»» City | string | false | none | none |
»»»» Country | string | false | none | none |
»»»» Line1 | string | false | none | none |
»»»» Line2 | string | false | none | none |
»»»» PostalCode | string | false | none | none |
»»»» State | string | false | none | none |
»»» ServiceAgreementVersion | string | false | none | none |
»»» FreeTrialExpired | boolean | false | none | none |
»» Subs | object | false | none | none |
»»» Method | integer | false | none | none |
»»» Key | string | false | none | none |
»» HlcSupport | boolean | false | none | none |
»» PrivacyDashboard | OrganisationPrivacyBoard | false | none | none |
»»» HostName | string | false | none | none |
»»» Version | string | false | none | none |
»»» Status | integer | false | none | none |
»»» Delete | boolean | false | none | none |
»» DataRetention | OrganisationDataRetention | false | none | none |
»»» RetentionPeriod | integer | false | none | none |
»»» Enabled | boolean | false | none | none |
Disable organization
Code samples
# You can also use wget
curl -X POST https://api.igrant.io/v1/organizations/{organizationID}/subscription/disable \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
POST https://api.igrant.io/v1/organizations/{organizationID}/subscription/disable HTTP/1.1
Host: api.igrant.io
Accept: application/json
const headers = {
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
fetch('https://api.igrant.io/v1/organizations/{organizationID}/subscription/disable',
{
method: 'POST',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.post 'https://api.igrant.io/v1/organizations/{organizationID}/subscription/disable',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.post('https://api.igrant.io/v1/organizations/{organizationID}/subscription/disable', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','https://api.igrant.io/v1/organizations/{organizationID}/subscription/disable', array(
'headers' => $headers,
'json' => $request_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://api.igrant.io/v1/organizations/{organizationID}/subscription/disable");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
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"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://api.igrant.io/v1/organizations/{organizationID}/subscription/disable", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /organizations/{organizationID}/subscription/disable
Disables an organisation towards users. This can be manually triggered by the organisation as part of maintainenace or can be forced by a super admin, example if the license conditions fail
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
organizationID | path | string | true | Organisation ID |
Example responses
200 Response
{
"Organization": {
"ID": "5daf22d0a531350001afc7c9",
"Name": "DMart Retail Chain",
"CoverImageID": "",
"CoverImageURL": "",
"LogoImageID": "5ecf5f979a273200016a13ef",
"LogoImageURL": "https://<server-url>/5daf22d0a531350001afc7c9/image/5ecf5f979a273200016a13ef",
"Location": "Stockholm, Sweden",
"Type": {
"ID": "5d17cc114dacb40001b29094",
"Type": "Retail",
"ImageID": "5d17cc7f4dacb40001b29095",
"ImageURL": "https://staging-api.igrant.io/v1/organizations/types/5d17cc114dacb40001b29094/image"
},
"Description": "",
"Enabled": true,
"PolicyURL": "",
"EulaURL": "",
"Templates": [
{
"ID": "5f187f9efd59960001434c2e",
"Consent": "Age",
"PurposeIDs": [
"5db0303ba531350001afc7e0",
"5db03048a531350001afc7e1"
]
}
],
"Purposes": [
{
"ID": "5db0303ba531350001afc7e0",
"Name": "Marketing and campaign",
"Description": "For this purpose, following personal data attributes shown below are used. You may consent to share your data at attribute level.",
"LawfulUsage": false,
"PolicyURL": "https://orgname.com/policy_default.html"
}
],
"Admins": [
{
"UserID": "5daf22cea531350001afc7c8",
"RoleID": 1
}
],
"BillingInfo": {
"BillingRegistrationID": "cus_G2URbi8W6DT7hh",
"MaxUserCounter": 4,
"DefaultChargeNotified": false,
"CurrentPeriodEnd": 0,
"PrevMonthUsers": 1,
"PayPerUserInfo": {
"UserCommitment": 0,
"TimeCommitment": "",
"CancelOnCommitmentEnd": false,
"CommitmentPeriodRemaining": 0
},
"DefaultPaymentSource": {
"Brand": "Visa",
"ExpiryMonth": 4,
"ExpiryYear": 2024,
"Last4Digits": "4242"
},
"Address": {
"Name": "George Floyd",
"City": "Stockholm",
"Country": "Sweden",
"Line1": "",
"Line2": "",
"PostalCode": "",
"State": ""
},
"ServiceAgreementVersion": "v2.0",
"FreeTrialExpired": true
},
"Subs": {
"Method": 0,
"Key": ""
},
"HlcSupport": false,
"PrivacyDashboard": {
"HostName": "dmart.igrant.io",
"Version": "v1.1.7",
"Status": 2,
"Delete": false
},
"DataRetention": {
"RetentionPeriod": 800,
"Enabled": true
}
}
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Disabled organisation for subscription | Inline |
401 | Unauthorized | Unauthorized | None |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» Organization | Organisation | false | none | none |
»» ID | string | false | none | none |
»» Name | string | false | none | none |
»» CoverImageID | string | false | none | none |
»» CoverImageURL | string | false | none | none |
»» LogoImageID | string | false | none | none |
»» LogoImageURL | string | false | none | none |
»» Location | string | false | none | none |
»» Type | OrganisationType | false | none | none |
»»» ID | string | false | none | none |
»»» Type | string | false | none | none |
»»» ImageID | string | false | none | none |
»»» ImageURL | string | false | none | none |
»» Description | string | false | none | none |
»» Enabled | boolean | false | none | none |
»» PolicyURL | string | false | none | none |
»» EulaURL | string | false | none | none |
»» Templates | [allOf] | false | none | none |
allOf
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
»»» anonymous | Template | false | none | none |
»»»» ID | string | false | none | none |
»»»» Consent | string | false | none | none |
and
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
»»» anonymous | object | false | none | none |
»»»» PurposeIDs | [string] | false | none | none |
continued
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
»» Purposes | [Purpose] | false | none | none |
»»» ID | string | false | none | none |
»»» Name | string | false | none | none |
»»» Description | string | false | none | none |
»»» LawfulUsage | boolean | false | none | none |
»»» PolicyURL | string | false | none | none |
»» Admins | [object] | false | none | none |
»»» UserID | string | false | none | none |
»»» RoleID | string | false | none | none |
»» BillingInfo | OrganisationBillingInfo | false | none | none |
»»» BillingRegistrationID | string | false | none | none |
»»» MaxUserCounter | integer | false | none | none |
»»» DefaultChargeNotified | boolean | false | none | none |
»»» CurrentPeriodEnd | integer | false | none | none |
»»» PrevMonthUsers | integer | false | none | none |
»»» PayPerUserInfo | object | false | none | none |
»»»» UserCommitment | integer | false | none | none |
»»»» TimeCommitment | string | false | none | none |
»»»» CancelOnCommitmentEnd | boolean | false | none | none |
»»»» CommitmentPeriodRemaining | integer | false | none | none |
»»» DefaultPaymentSource | object | false | none | none |
»»»» Brand | string | false | none | none |
»»»» ExpiryMonth | integer | false | none | none |
»»»» ExpiryYear | integer | false | none | none |
»»»» Last4Digits | string | false | none | none |
»»» Address | object | false | none | none |
»»»» Name | string | false | none | none |
»»»» City | string | false | none | none |
»»»» Country | string | false | none | none |
»»»» Line1 | string | false | none | none |
»»»» Line2 | string | false | none | none |
»»»» PostalCode | string | false | none | none |
»»»» State | string | false | none | none |
»»» ServiceAgreementVersion | string | false | none | none |
»»» FreeTrialExpired | boolean | false | none | none |
»» Subs | object | false | none | none |
»»» Method | integer | false | none | none |
»»» Key | string | false | none | none |
»» HlcSupport | boolean | false | none | none |
»» PrivacyDashboard | OrganisationPrivacyBoard | false | none | none |
»»» HostName | string | false | none | none |
»»» Version | string | false | none | none |
»»» Status | integer | false | none | none |
»»» Delete | boolean | false | none | none |
»» DataRetention | OrganisationDataRetention | false | none | none |
»»» RetentionPeriod | integer | false | none | none |
»»» Enabled | boolean | false | none | none |
Update EULA URL
Code samples
# You can also use wget
curl -X POST https://api.igrant.io/v1/organizations/{organizationID}/eulaURL \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer {access-token}'
POST https://api.igrant.io/v1/organizations/{organizationID}/eulaURL HTTP/1.1
Host: api.igrant.io
Content-Type: application/json
const inputBody = '{
"eulaurl": "https://igrant.io/eula.html"
}';
const headers = {
'Content-Type':'application/json',
'Authorization':'Bearer {access-token}'
};
fetch('https://api.igrant.io/v1/organizations/{organizationID}/eulaURL',
{
method: 'POST',
body: 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',
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.post 'https://api.igrant.io/v1/organizations/{organizationID}/eulaURL',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.post('https://api.igrant.io/v1/organizations/{organizationID}/eulaURL', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','https://api.igrant.io/v1/organizations/{organizationID}/eulaURL', array(
'headers' => $headers,
'json' => $request_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://api.igrant.io/v1/organizations/{organizationID}/eulaURL");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
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"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://api.igrant.io/v1/organizations/{organizationID}/eulaURL", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /organizations/{organizationID}/eulaURL
Updates an organization's EULA URL. This is used if the organisation wishes to notify users if there are any updates to its EULA agrements.
Body parameter
{
"eulaurl": "https://igrant.io/eula.html"
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
organizationID | path | string | true | Organisation ID |
body | body | object | true | none |
» eulaurl | body | string | true | none |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
202 | Accepted | Updated EULA URL for an organization | None |
400 | Bad Request | Invalid EULA URL provided | None |
401 | Unauthorized | Unauthorized | None |
Delete aorganization EULA url
Code samples
# You can also use wget
curl -X DELETE https://api.igrant.io/v1/organizations/{organizationID}/eulaURL \
-H 'Authorization: Bearer {access-token}'
DELETE https://api.igrant.io/v1/organizations/{organizationID}/eulaURL HTTP/1.1
Host: api.igrant.io
const headers = {
'Authorization':'Bearer {access-token}'
};
fetch('https://api.igrant.io/v1/organizations/{organizationID}/eulaURL',
{
method: 'DELETE',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.delete 'https://api.igrant.io/v1/organizations/{organizationID}/eulaURL',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Authorization': 'Bearer {access-token}'
}
r = requests.delete('https://api.igrant.io/v1/organizations/{organizationID}/eulaURL', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('DELETE','https://api.igrant.io/v1/organizations/{organizationID}/eulaURL', array(
'headers' => $headers,
'json' => $request_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://api.igrant.io/v1/organizations/{organizationID}/eulaURL");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("DELETE");
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"
)
func main() {
headers := map[string][]string{
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("DELETE", "https://api.igrant.io/v1/organizations/{organizationID}/eulaURL", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
DELETE /organizations/{organizationID}/eulaURL
Deletes an organization EULA URL
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
organizationID | path | string | true | Organisation ID |
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
202 | Accepted | Deleted EULA URL for an organization | None |
400 | Bad Request | Invalid EULA URL provided | None |
401 | Unauthorized | Unauthorized | None |
Delete admin user
Code samples
# You can also use wget
curl -X DELETE https://api.igrant.io/v1/organizations/{organizationID}/admins \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
DELETE https://api.igrant.io/v1/organizations/{organizationID}/admins HTTP/1.1
Host: api.igrant.io
Accept: application/json
const headers = {
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
fetch('https://api.igrant.io/v1/organizations/{organizationID}/admins',
{
method: 'DELETE',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.delete 'https://api.igrant.io/v1/organizations/{organizationID}/admins',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.delete('https://api.igrant.io/v1/organizations/{organizationID}/admins', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('DELETE','https://api.igrant.io/v1/organizations/{organizationID}/admins', array(
'headers' => $headers,
'json' => $request_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://api.igrant.io/v1/organizations/{organizationID}/admins");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("DELETE");
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"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("DELETE", "https://api.igrant.io/v1/organizations/{organizationID}/admins", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
DELETE /organizations/{organizationID}/admins
Deletes an admin user from an organization
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
organizationID | path | string | true | Organisation ID |
Example responses
200 Response
{
"Organization": {
"ID": "5daf22d0a531350001afc7c9",
"Name": "DMart Retail Chain",
"CoverImageID": "",
"CoverImageURL": "",
"LogoImageID": "5ecf5f979a273200016a13ef",
"LogoImageURL": "https://<server-url>/5daf22d0a531350001afc7c9/image/5ecf5f979a273200016a13ef",
"Location": "Stockholm, Sweden",
"Type": {
"ID": "5d17cc114dacb40001b29094",
"Type": "Retail",
"ImageID": "5d17cc7f4dacb40001b29095",
"ImageURL": "https://staging-api.igrant.io/v1/organizations/types/5d17cc114dacb40001b29094/image"
},
"Description": "",
"Enabled": true,
"PolicyURL": "",
"EulaURL": "",
"Templates": [
{
"ID": "5f187f9efd59960001434c2e",
"Consent": "Age",
"PurposeIDs": [
"5db0303ba531350001afc7e0",
"5db03048a531350001afc7e1"
]
}
],
"Purposes": [
{
"ID": "5db0303ba531350001afc7e0",
"Name": "Marketing and campaign",
"Description": "For this purpose, following personal data attributes shown below are used. You may consent to share your data at attribute level.",
"LawfulUsage": false,
"PolicyURL": "https://orgname.com/policy_default.html"
}
],
"Admins": [
{
"UserID": "5daf22cea531350001afc7c8",
"RoleID": 1
}
],
"BillingInfo": {
"BillingRegistrationID": "cus_G2URbi8W6DT7hh",
"MaxUserCounter": 4,
"DefaultChargeNotified": false,
"CurrentPeriodEnd": 0,
"PrevMonthUsers": 1,
"PayPerUserInfo": {
"UserCommitment": 0,
"TimeCommitment": "",
"CancelOnCommitmentEnd": false,
"CommitmentPeriodRemaining": 0
},
"DefaultPaymentSource": {
"Brand": "Visa",
"ExpiryMonth": 4,
"ExpiryYear": 2024,
"Last4Digits": "4242"
},
"Address": {
"Name": "George Floyd",
"City": "Stockholm",
"Country": "Sweden",
"Line1": "",
"Line2": "",
"PostalCode": "",
"State": ""
},
"ServiceAgreementVersion": "v2.0",
"FreeTrialExpired": true
},
"Subs": {
"Method": 0,
"Key": ""
},
"HlcSupport": false,
"PrivacyDashboard": {
"HostName": "dmart.igrant.io",
"Version": "v1.1.7",
"Status": 2,
"Delete": false
},
"DataRetention": {
"RetentionPeriod": 800,
"Enabled": true
}
}
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Returns organisation | Inline |
401 | Unauthorized | Unauthorized | None |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» Organization | Organisation | false | none | none |
»» ID | string | false | none | none |
»» Name | string | false | none | none |
»» CoverImageID | string | false | none | none |
»» CoverImageURL | string | false | none | none |
»» LogoImageID | string | false | none | none |
»» LogoImageURL | string | false | none | none |
»» Location | string | false | none | none |
»» Type | OrganisationType | false | none | none |
»»» ID | string | false | none | none |
»»» Type | string | false | none | none |
»»» ImageID | string | false | none | none |
»»» ImageURL | string | false | none | none |
»» Description | string | false | none | none |
»» Enabled | boolean | false | none | none |
»» PolicyURL | string | false | none | none |
»» EulaURL | string | false | none | none |
»» Templates | [allOf] | false | none | none |
allOf
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
»»» anonymous | Template | false | none | none |
»»»» ID | string | false | none | none |
»»»» Consent | string | false | none | none |
and
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
»»» anonymous | object | false | none | none |
»»»» PurposeIDs | [string] | false | none | none |
continued
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
»» Purposes | [Purpose] | false | none | none |
»»» ID | string | false | none | none |
»»» Name | string | false | none | none |
»»» Description | string | false | none | none |
»»» LawfulUsage | boolean | false | none | none |
»»» PolicyURL | string | false | none | none |
»» Admins | [object] | false | none | none |
»»» UserID | string | false | none | none |
»»» RoleID | string | false | none | none |
»» BillingInfo | OrganisationBillingInfo | false | none | none |
»»» BillingRegistrationID | string | false | none | none |
»»» MaxUserCounter | integer | false | none | none |
»»» DefaultChargeNotified | boolean | false | none | none |
»»» CurrentPeriodEnd | integer | false | none | none |
»»» PrevMonthUsers | integer | false | none | none |
»»» PayPerUserInfo | object | false | none | none |
»»»» UserCommitment | integer | false | none | none |
»»»» TimeCommitment | string | false | none | none |
»»»» CancelOnCommitmentEnd | boolean | false | none | none |
»»»» CommitmentPeriodRemaining | integer | false | none | none |
»»» DefaultPaymentSource | object | false | none | none |
»»»» Brand | string | false | none | none |
»»»» ExpiryMonth | integer | false | none | none |
»»»» ExpiryYear | integer | false | none | none |
»»»» Last4Digits | string | false | none | none |
»»» Address | object | false | none | none |
»»»» Name | string | false | none | none |
»»»» City | string | false | none | none |
»»»» Country | string | false | none | none |
»»»» Line1 | string | false | none | none |
»»»» Line2 | string | false | none | none |
»»»» PostalCode | string | false | none | none |
»»»» State | string | false | none | none |
»»» ServiceAgreementVersion | string | false | none | none |
»»» FreeTrialExpired | boolean | false | none | none |
»» Subs | object | false | none | none |
»»» Method | integer | false | none | none |
»»» Key | string | false | none | none |
»» HlcSupport | boolean | false | none | none |
»» PrivacyDashboard | OrganisationPrivacyBoard | false | none | none |
»»» HostName | string | false | none | none |
»»» Version | string | false | none | none |
»»» Status | integer | false | none | none |
»»» Delete | boolean | false | none | none |
»» DataRetention | OrganisationDataRetention | false | none | none |
»»» RetentionPeriod | integer | false | none | none |
»»» Enabled | boolean | false | none | none |
Update org cover image
Code samples
# You can also use wget
curl -X POST https://api.igrant.io/v1/organizations/{organizationID}/coverimage \
-H 'Content-Type: multipart/form-data' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
POST https://api.igrant.io/v1/organizations/{organizationID}/coverimage HTTP/1.1
Host: api.igrant.io
Content-Type: multipart/form-data
Accept: application/json
const inputBody = '{
"orgimage": "string"
}';
const headers = {
'Content-Type':'multipart/form-data',
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
fetch('https://api.igrant.io/v1/organizations/{organizationID}/coverimage',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'multipart/form-data',
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.post 'https://api.igrant.io/v1/organizations/{organizationID}/coverimage',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'multipart/form-data',
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.post('https://api.igrant.io/v1/organizations/{organizationID}/coverimage', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'multipart/form-data',
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','https://api.igrant.io/v1/organizations/{organizationID}/coverimage', array(
'headers' => $headers,
'json' => $request_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://api.igrant.io/v1/organizations/{organizationID}/coverimage");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
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"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"multipart/form-data"},
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://api.igrant.io/v1/organizations/{organizationID}/coverimage", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /organizations/{organizationID}/coverimage
Updates an organizations cover image. This images are seen by the users in their app, portal etc.
Body parameter
orgimage: string
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
organizationID | path | string | true | Organisation ID |
body | body | object | true | none |
» orgimage | body | string(binary) | true | none |
Example responses
200 Response
{
"Organization": {
"ID": "5daf22d0a531350001afc7c9",
"Name": "DMart Retail Chain",
"CoverImageID": "",
"CoverImageURL": "",
"LogoImageID": "5ecf5f979a273200016a13ef",
"LogoImageURL": "https://<server-url>/5daf22d0a531350001afc7c9/image/5ecf5f979a273200016a13ef",
"Location": "Stockholm, Sweden",
"Type": {
"ID": "5d17cc114dacb40001b29094",
"Type": "Retail",
"ImageID": "5d17cc7f4dacb40001b29095",
"ImageURL": "https://staging-api.igrant.io/v1/organizations/types/5d17cc114dacb40001b29094/image"
},
"Description": "",
"Enabled": true,
"PolicyURL": "",
"EulaURL": "",
"Templates": [
{
"ID": "5f187f9efd59960001434c2e",
"Consent": "Age",
"PurposeIDs": [
"5db0303ba531350001afc7e0",
"5db03048a531350001afc7e1"
]
}
],
"Purposes": [
{
"ID": "5db0303ba531350001afc7e0",
"Name": "Marketing and campaign",
"Description": "For this purpose, following personal data attributes shown below are used. You may consent to share your data at attribute level.",
"LawfulUsage": false,
"PolicyURL": "https://orgname.com/policy_default.html"
}
],
"Admins": [
{
"UserID": "5daf22cea531350001afc7c8",
"RoleID": 1
}
],
"BillingInfo": {
"BillingRegistrationID": "cus_G2URbi8W6DT7hh",
"MaxUserCounter": 4,
"DefaultChargeNotified": false,
"CurrentPeriodEnd": 0,
"PrevMonthUsers": 1,
"PayPerUserInfo": {
"UserCommitment": 0,
"TimeCommitment": "",
"CancelOnCommitmentEnd": false,
"CommitmentPeriodRemaining": 0
},
"DefaultPaymentSource": {
"Brand": "Visa",
"ExpiryMonth": 4,
"ExpiryYear": 2024,
"Last4Digits": "4242"
},
"Address": {
"Name": "George Floyd",
"City": "Stockholm",
"Country": "Sweden",
"Line1": "",
"Line2": "",
"PostalCode": "",
"State": ""
},
"ServiceAgreementVersion": "v2.0",
"FreeTrialExpired": true
},
"Subs": {
"Method": 0,
"Key": ""
},
"HlcSupport": false,
"PrivacyDashboard": {
"HostName": "dmart.igrant.io",
"Version": "v1.1.7",
"Status": 2,
"Delete": false
},
"DataRetention": {
"RetentionPeriod": 800,
"Enabled": true
}
}
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Returns organisation | Inline |
401 | Unauthorized | Unauthorized | None |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» Organization | Organisation | false | none | none |
»» ID | string | false | none | none |
»» Name | string | false | none | none |
»» CoverImageID | string | false | none | none |
»» CoverImageURL | string | false | none | none |
»» LogoImageID | string | false | none | none |
»» LogoImageURL | string | false | none | none |
»» Location | string | false | none | none |
»» Type | OrganisationType | false | none | none |
»»» ID | string | false | none | none |
»»» Type | string | false | none | none |
»»» ImageID | string | false | none | none |
»»» ImageURL | string | false | none | none |
»» Description | string | false | none | none |
»» Enabled | boolean | false | none | none |
»» PolicyURL | string | false | none | none |
»» EulaURL | string | false | none | none |
»» Templates | [allOf] | false | none | none |
allOf
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
»»» anonymous | Template | false | none | none |
»»»» ID | string | false | none | none |
»»»» Consent | string | false | none | none |
and
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
»»» anonymous | object | false | none | none |
»»»» PurposeIDs | [string] | false | none | none |
continued
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
»» Purposes | [Purpose] | false | none | none |
»»» ID | string | false | none | none |
»»» Name | string | false | none | none |
»»» Description | string | false | none | none |
»»» LawfulUsage | boolean | false | none | none |
»»» PolicyURL | string | false | none | none |
»» Admins | [object] | false | none | none |
»»» UserID | string | false | none | none |
»»» RoleID | string | false | none | none |
»» BillingInfo | OrganisationBillingInfo | false | none | none |
»»» BillingRegistrationID | string | false | none | none |
»»» MaxUserCounter | integer | false | none | none |
»»» DefaultChargeNotified | boolean | false | none | none |
»»» CurrentPeriodEnd | integer | false | none | none |
»»» PrevMonthUsers | integer | false | none | none |
»»» PayPerUserInfo | object | false | none | none |
»»»» UserCommitment | integer | false | none | none |
»»»» TimeCommitment | string | false | none | none |
»»»» CancelOnCommitmentEnd | boolean | false | none | none |
»»»» CommitmentPeriodRemaining | integer | false | none | none |
»»» DefaultPaymentSource | object | false | none | none |
»»»» Brand | string | false | none | none |
»»»» ExpiryMonth | integer | false | none | none |
»»»» ExpiryYear | integer | false | none | none |
»»»» Last4Digits | string | false | none | none |
»»» Address | object | false | none | none |
»»»» Name | string | false | none | none |
»»»» City | string | false | none | none |
»»»» Country | string | false | none | none |
»»»» Line1 | string | false | none | none |
»»»» Line2 | string | false | none | none |
»»»» PostalCode | string | false | none | none |
»»»» State | string | false | none | none |
»»» ServiceAgreementVersion | string | false | none | none |
»»» FreeTrialExpired | boolean | false | none | none |
»» Subs | object | false | none | none |
»»» Method | integer | false | none | none |
»»» Key | string | false | none | none |
»» HlcSupport | boolean | false | none | none |
»» PrivacyDashboard | OrganisationPrivacyBoard | false | none | none |
»»» HostName | string | false | none | none |
»»» Version | string | false | none | none |
»»» Status | integer | false | none | none |
»»» Delete | boolean | false | none | none |
»» DataRetention | OrganisationDataRetention | false | none | none |
»»» RetentionPeriod | integer | false | none | none |
»»» Enabled | boolean | false | none | none |
Get org image
Code samples
# You can also use wget
curl -X GET https://api.igrant.io/v1/organizations/{organizationID}/image/{imageID} \
-H 'Accept: image/jpeg' \
-H 'Authorization: Bearer {access-token}'
GET https://api.igrant.io/v1/organizations/{organizationID}/image/{imageID} HTTP/1.1
Host: api.igrant.io
Accept: image/jpeg
const headers = {
'Accept':'image/jpeg',
'Authorization':'Bearer {access-token}'
};
fetch('https://api.igrant.io/v1/organizations/{organizationID}/image/{imageID}',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'image/jpeg',
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.get 'https://api.igrant.io/v1/organizations/{organizationID}/image/{imageID}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'image/jpeg',
'Authorization': 'Bearer {access-token}'
}
r = requests.get('https://api.igrant.io/v1/organizations/{organizationID}/image/{imageID}', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'image/jpeg',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','https://api.igrant.io/v1/organizations/{organizationID}/image/{imageID}', array(
'headers' => $headers,
'json' => $request_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://api.igrant.io/v1/organizations/{organizationID}/image/{imageID}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
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"
)
func main() {
headers := map[string][]string{
"Accept": []string{"image/jpeg"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://api.igrant.io/v1/organizations/{organizationID}/image/{imageID}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /organizations/{organizationID}/image/{imageID}
Gets the organization image with the image ID
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
organizationID | path | string | true | Organisation ID |
imageID | path | string | true | Image ID |
Example responses
200 Response
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Returns organization image | string |
401 | Unauthorized | Unauthorized | None |
404 | Not Found | 404 not found | None |
Updates logo image
Code samples
# You can also use wget
curl -X POST https://api.igrant.io/v1/organizations/{organizationID}/logoimage \
-H 'Content-Type: multipart/form-data' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
POST https://api.igrant.io/v1/organizations/{organizationID}/logoimage HTTP/1.1
Host: api.igrant.io
Content-Type: multipart/form-data
Accept: application/json
const inputBody = '{
"orgimage": "string"
}';
const headers = {
'Content-Type':'multipart/form-data',
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
fetch('https://api.igrant.io/v1/organizations/{organizationID}/logoimage',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'multipart/form-data',
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.post 'https://api.igrant.io/v1/organizations/{organizationID}/logoimage',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'multipart/form-data',
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.post('https://api.igrant.io/v1/organizations/{organizationID}/logoimage', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'multipart/form-data',
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','https://api.igrant.io/v1/organizations/{organizationID}/logoimage', array(
'headers' => $headers,
'json' => $request_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://api.igrant.io/v1/organizations/{organizationID}/logoimage");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
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"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"multipart/form-data"},
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://api.igrant.io/v1/organizations/{organizationID}/logoimage", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /organizations/{organizationID}/logoimage
Updates an organization logo image
Body parameter
orgimage: string
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
organizationID | path | string | true | Organisation ID |
body | body | object | true | none |
» orgimage | body | string(binary) | true | none |
Example responses
200 Response
{
"Organization": {
"ID": "5daf22d0a531350001afc7c9",
"Name": "DMart Retail Chain",
"CoverImageID": "",
"CoverImageURL": "",
"LogoImageID": "5ecf5f979a273200016a13ef",
"LogoImageURL": "https://<server-url>/5daf22d0a531350001afc7c9/image/5ecf5f979a273200016a13ef",
"Location": "Stockholm, Sweden",
"Type": {
"ID": "5d17cc114dacb40001b29094",
"Type": "Retail",
"ImageID": "5d17cc7f4dacb40001b29095",
"ImageURL": "https://staging-api.igrant.io/v1/organizations/types/5d17cc114dacb40001b29094/image"
},
"Description": "",
"Enabled": true,
"PolicyURL": "",
"EulaURL": "",
"Templates": [
{
"ID": "5f187f9efd59960001434c2e",
"Consent": "Age",
"PurposeIDs": [
"5db0303ba531350001afc7e0",
"5db03048a531350001afc7e1"
]
}
],
"Purposes": [
{
"ID": "5db0303ba531350001afc7e0",
"Name": "Marketing and campaign",
"Description": "For this purpose, following personal data attributes shown below are used. You may consent to share your data at attribute level.",
"LawfulUsage": false,
"PolicyURL": "https://orgname.com/policy_default.html"
}
],
"Admins": [
{
"UserID": "5daf22cea531350001afc7c8",
"RoleID": 1
}
],
"BillingInfo": {
"BillingRegistrationID": "cus_G2URbi8W6DT7hh",
"MaxUserCounter": 4,
"DefaultChargeNotified": false,
"CurrentPeriodEnd": 0,
"PrevMonthUsers": 1,
"PayPerUserInfo": {
"UserCommitment": 0,
"TimeCommitment": "",
"CancelOnCommitmentEnd": false,
"CommitmentPeriodRemaining": 0
},
"DefaultPaymentSource": {
"Brand": "Visa",
"ExpiryMonth": 4,
"ExpiryYear": 2024,
"Last4Digits": "4242"
},
"Address": {
"Name": "George Floyd",
"City": "Stockholm",
"Country": "Sweden",
"Line1": "",
"Line2": "",
"PostalCode": "",
"State": ""
},
"ServiceAgreementVersion": "v2.0",
"FreeTrialExpired": true
},
"Subs": {
"Method": 0,
"Key": ""
},
"HlcSupport": false,
"PrivacyDashboard": {
"HostName": "dmart.igrant.io",
"Version": "v1.1.7",
"Status": 2,
"Delete": false
},
"DataRetention": {
"RetentionPeriod": 800,
"Enabled": true
}
}
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Returns organisation | Inline |
401 | Unauthorized | Unauthorized | None |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» Organization | Organisation | false | none | none |
»» ID | string | false | none | none |
»» Name | string | false | none | none |
»» CoverImageID | string | false | none | none |
»» CoverImageURL | string | false | none | none |
»» LogoImageID | string | false | none | none |
»» LogoImageURL | string | false | none | none |
»» Location | string | false | none | none |
»» Type | OrganisationType | false | none | none |
»»» ID | string | false | none | none |
»»» Type | string | false | none | none |
»»» ImageID | string | false | none | none |
»»» ImageURL | string | false | none | none |
»» Description | string | false | none | none |
»» Enabled | boolean | false | none | none |
»» PolicyURL | string | false | none | none |
»» EulaURL | string | false | none | none |
»» Templates | [allOf] | false | none | none |
allOf
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
»»» anonymous | Template | false | none | none |
»»»» ID | string | false | none | none |
»»»» Consent | string | false | none | none |
and
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
»»» anonymous | object | false | none | none |
»»»» PurposeIDs | [string] | false | none | none |
continued
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
»» Purposes | [Purpose] | false | none | none |
»»» ID | string | false | none | none |
»»» Name | string | false | none | none |
»»» Description | string | false | none | none |
»»» LawfulUsage | boolean | false | none | none |
»»» PolicyURL | string | false | none | none |
»» Admins | [object] | false | none | none |
»»» UserID | string | false | none | none |
»»» RoleID | string | false | none | none |
»» BillingInfo | OrganisationBillingInfo | false | none | none |
»»» BillingRegistrationID | string | false | none | none |
»»» MaxUserCounter | integer | false | none | none |
»»» DefaultChargeNotified | boolean | false | none | none |
»»» CurrentPeriodEnd | integer | false | none | none |
»»» PrevMonthUsers | integer | false | none | none |
»»» PayPerUserInfo | object | false | none | none |
»»»» UserCommitment | integer | false | none | none |
»»»» TimeCommitment | string | false | none | none |
»»»» CancelOnCommitmentEnd | boolean | false | none | none |
»»»» CommitmentPeriodRemaining | integer | false | none | none |
»»» DefaultPaymentSource | object | false | none | none |
»»»» Brand | string | false | none | none |
»»»» ExpiryMonth | integer | false | none | none |
»»»» ExpiryYear | integer | false | none | none |
»»»» Last4Digits | string | false | none | none |
»»» Address | object | false | none | none |
»»»» Name | string | false | none | none |
»»»» City | string | false | none | none |
»»»» Country | string | false | none | none |
»»»» Line1 | string | false | none | none |
»»»» Line2 | string | false | none | none |
»»»» PostalCode | string | false | none | none |
»»»» State | string | false | none | none |
»»» ServiceAgreementVersion | string | false | none | none |
»»» FreeTrialExpired | boolean | false | none | none |
»» Subs | object | false | none | none |
»»» Method | integer | false | none | none |
»»» Key | string | false | none | none |
»» HlcSupport | boolean | false | none | none |
»» PrivacyDashboard | OrganisationPrivacyBoard | false | none | none |
»»» HostName | string | false | none | none |
»»» Version | string | false | none | none |
»»» Status | integer | false | none | none |
»»» Delete | boolean | false | none | none |
»» DataRetention | OrganisationDataRetention | false | none | none |
»»» RetentionPeriod | integer | false | none | none |
»»» Enabled | boolean | false | none | none |
Get subscribed users
Code samples
# You can also use wget
curl -X GET https://api.igrant.io/v1/organizations/{organizationID}/users \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
GET https://api.igrant.io/v1/organizations/{organizationID}/users HTTP/1.1
Host: api.igrant.io
Accept: application/json
const headers = {
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
fetch('https://api.igrant.io/v1/organizations/{organizationID}/users',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.get 'https://api.igrant.io/v1/organizations/{organizationID}/users',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.get('https://api.igrant.io/v1/organizations/{organizationID}/users', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','https://api.igrant.io/v1/organizations/{organizationID}/users', array(
'headers' => $headers,
'json' => $request_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://api.igrant.io/v1/organizations/{organizationID}/users");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
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"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://api.igrant.io/v1/organizations/{organizationID}/users", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /organizations/{organizationID}/users
Gets the list of users who are subscribed or registerd with an organisation
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
organizationID | path | string | true | Organisation ID |
limit | query | integer | false | Pagination limit (No of results) |
startid | query | string | false | Pagination start offset (ID of the result object for e.g. user ID, organisation ID e.t.c.) |
Example responses
200 Response
{
"Users": [
{
"ID": "5e8468d19380c40001f3ef69",
"Name": "Joseph George",
"Phone": "+467252844669",
"Email": "george@orgmail.com"
}
],
"Links": {
"Self": "https://<image-server>/5dae01aa267e930001609aa4/users?limit=20",
"Next": "https://<image-server>/5dae01aa267e930001609aa4/users?limit=1&startid=5e833b4d9380c40001f3ef65"
}
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Returns organization users | Inline |
401 | Unauthorized | Unauthorized | None |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» Users | [object] | false | none | none |
»» ID | string | false | none | none |
»» Name | string | false | none | none |
»» Phone | string | false | none | none |
string | false | none | none | |
» Links | object | false | none | none |
»» Self | string | false | none | none |
»» Next | string | false | none | none |
Add user to organization
Code samples
# You can also use wget
curl -X POST https://api.igrant.io/v1/organizations/{organizationID}/users \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
POST https://api.igrant.io/v1/organizations/{organizationID}/users HTTP/1.1
Host: api.igrant.io
Content-Type: application/json
Accept: application/json
const inputBody = '{
"userid": "5f0c2ec1d6f0970001fae263",
"subscribekey": "GBDL-SQPR-QN1O"
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
fetch('https://api.igrant.io/v1/organizations/{organizationID}/users',
{
method: 'POST',
body: 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',
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.post 'https://api.igrant.io/v1/organizations/{organizationID}/users',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.post('https://api.igrant.io/v1/organizations/{organizationID}/users', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','https://api.igrant.io/v1/organizations/{organizationID}/users', array(
'headers' => $headers,
'json' => $request_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://api.igrant.io/v1/organizations/{organizationID}/users");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
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"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "https://api.igrant.io/v1/organizations/{organizationID}/users", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /organizations/{organizationID}/users
Provisions individual users to organisations. This is used when organisation onboards their users or when users subscribe to organisations, for example in a data wallet.
Body parameter
{
"userid": "5f0c2ec1d6f0970001fae263",
"subscribekey": "GBDL-SQPR-QN1O"
}
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
organizationID | path | string | true | Organisation ID |
body | body | object | false | none |
» userid | body | string | false | none |
» subscribekey | body | string | false | none |
Example responses
200 Response
{
"User": {
"ID": "5daf22cea531351111afc7c8",
"Name": "George Floyd",
"IamID": "9d8c4h69-9fb2-4115-a4c3-53bddb8f2d7f",
"Email": "dmart@yopmail.com",
"Phone": "+46 7252 98991",
"ImageID": "5f1458a5chaa930001e78f12",
"ImageURL": "https:/<server-url>/image/5f1458a5chaa930001e78f12",
"LastVisit": "2020-07-22T18:04:02Z",
"Client": {
"Token": "fEkxEwh4T2mr-B4yQoZ9TT:APA91bHibhwLXkc2l6LxWxHW5TrKBoLrXGCHDO6A9pXQ0ShvDYPfxXm57D8tIsR-fwybjs-_OFXCgCbBQpYVON2svUiooWgJBFETXg_jUGy0B9etUHFnyuCbXPihyoCuJc2Gn6s9XkN_",
"Type": 2
},
"Orgs": [
{
"OrgID": "5dae2a9fa1215e00012103e4",
"Name": "Nordea Bank AB",
"Location": "Stockholm, Sweden",
"Type": "Banking and Finance",
"TypeID": "5d95a566a67c8800012f27d1",
"EulaAccepted": false
}
],
"APIKey": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyaWQiOiI1ZGFmMjJjZWE1MzEzNTAwMDFhZmM3YzgiLCJleHAiOjE2MDQwNjMwNjV9.Irk0XgXfVhIdlgBNz6ggEXlvoIPtzUzJv4-x0VKYBGE",
"Roles": [
{
"RoleID": 1,
"OrgID": "5daf22d0a531350001afc7c9"
}
]
}
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Returns the added user | Inline |
400 | Bad Request | Invalid subscription token | None |
401 | Unauthorized | Unauthorized | None |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» User | User | false | none | none |
»» ID | string | false | none | none |
»» Name | string | false | none | none |
»» IamID | string | false | none | none |
string | false | none | none | |
»» Phone | string | false | none | none |
»» ImageID | string | false | none | none |
»» ImageURL | string | false | none | none |
»» LastVisit | string(date-time) | false | none | none |
»» Client | object | false | none | none |
»»» Token | string | false | none | none |
»»» Type | integer | false | none | none |
»» Orgs | [object] | false | none | none |
»»» OrgID | string | false | none | none |
»»» Name | string | false | none | none |
»»» Location | string | false | none | none |
»»» Type | string | false | none | none |
»»» TypeID | string | false | none | none |
»»» EulaAccepted | boolean | false | none | none |
»» APIKey | string | false | none | none |
»» Roles | [object] | false | none | none |
»»» RoleID | integer | false | none | none |
»»» OrgID | string | false | none | none |
Get total subscribed users
Code samples
# You can also use wget
curl -X GET https://api.igrant.io/v1/organizations/{organizationID}/users/count \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
GET https://api.igrant.io/v1/organizations/{organizationID}/users/count HTTP/1.1
Host: api.igrant.io
Accept: application/json
const headers = {
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
fetch('https://api.igrant.io/v1/organizations/{organizationID}/users/count',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.get 'https://api.igrant.io/v1/organizations/{organizationID}/users/count',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.get('https://api.igrant.io/v1/organizations/{organizationID}/users/count', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','https://api.igrant.io/v1/organizations/{organizationID}/users/count', array(
'headers' => $headers,
'json' => $request_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://api.igrant.io/v1/organizations/{organizationID}/users/count");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
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"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "https://api.igrant.io/v1/organizations/{organizationID}/users/count", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /organizations/{organizationID}/users/count
Gets the total number of users subscribed to an organisation
Parameters
Name | In | Type | Required | Description |
---|---|---|---|---|
organizationID | path | string | true | Organisation ID |
Example responses
200 Response
{
"SubscribeUserCount": 7
}
Responses
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Returns subscribed users count | Inline |
401 | Unauthorized | Unauthorized | None |
Response Schema
Status Code 200
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
» SubscribeUserCount | integer | false | none | none |
Remove user
Code samples
# You can also use wget
curl -X DELETE https://api.igrant.io/v1/organizations/{organizationID}/users/{userID} \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
DELETE https://api.igrant.io/v1/organizations/{organizationID}/users/{userID} HTTP/1.1
Host: api.igrant.io
Accept: application/json
const headers = {
'Accept':'application/json',
'Authorization':'Bearer {access-token}'
};
fetch('https://api.igrant.io/v1/organizations/{organizationID}/users/{userID}',
{
method: 'DELETE',
headers: headers
})
.then(