NAV Navbar
Shell HTTP JavaScript Node.JS Ruby Python Java Go

Introduction

Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.

The API end point is 'https://api.igrant.io/v1'.

This is version 1.5.4

This specification is documented in OpenAPI format, it describes the REST APIs of iGrant.io.

Authentication

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 requests.

Base URLs:

Organizations

Below you can find a collection of endpoints that respond to GET, POST, PUT, PATCH and DELETE requests.

Get organizations

Code samples

# You can also use wget
curl -X GET https://api.igrant.io/v1/organizations \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer API_KEY'

GET https://api.igrant.io/v1/organizations HTTP/1.1
Host: api.igrant.io
Accept: application/json

var headers = {
  'Accept':'application/json',
  'Authorization':'API_KEY'

};

$.ajax({
  url: 'https://api.igrant.io/v1/organizations',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'Authorization':'API_KEY'

};

fetch('https://api.igrant.io/v1/organizations',
{
  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' => 'API_KEY'
}

result = RestClient.get 'https://api.igrant.io/v1/organizations',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'API_KEY'
}

r = requests.get('https://api.igrant.io/v1/organizations', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://api.igrant.io/v1/organizations");
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{"API_KEY"},

    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://api.igrant.io/v1/organizations", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /organizations

Gets existing organizations whose consent data is managed.

Example responses

200 Response

{
  "Organizations": [
    {
      "ID": "OrgID",
      "Name": "TestOrg",
      "CoverImageID": "ID",
      "CoverImageurl": "url",
      "LogoImageID": "ID",
      "LogoImageURL": "url",
      "Location": "Turku",
      "Type": {
        "ID": "ID",
        "Type": "Retail",
        "ImageID": "imageID",
        "ImageURL": "url"
      },
      "Description": "Testorg stores and processes the following data of yours. For each of your personal data attributes, you can view what is used as contractual basis in order for us to carry out a business relation with you. You can view the current status for all your personal data attributes, the purpose in which they are used and provide you the choice to opt-in or opt-out. \\n\\nYes, We are GDPR compliant.",
      "Enabled": true,
      "Policyurl": "URL",
      "EulaURL": "EulaURL",
      "Templates": [
        {
          "ID": "TemplateID",
          "Consent": "Spouse",
          "PurposeIDs": [
            "IDs.."
          ]
        }
      ],
      "Purposes": [
        {
          "ID": "PurposeID",
          "Description": "Contractual purpose",
          "LawfulUsage": false,
          "PolicyURL": "URL"
        }
      ],
      "Admins": [
        {
          "UserID": "UserID",
          "RoleID": 1
        }
      ],
      "BillingInfo": {
        "BillingRegistrationID": "",
        "PlanType": ""
      }
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK List of available organizations. Organizations

Add an organization

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 API_KEY'

POST https://api.igrant.io/v1/organizations HTTP/1.1
Host: api.igrant.io
Content-Type: application/json
Accept: application/json

var headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'API_KEY'

};

$.ajax({
  url: 'https://api.igrant.io/v1/organizations',
  method: 'post',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');
const inputBody = '{
  "Name": "string",
  "Location": "string",
  "Description": "string",
  "TypeID": "string"
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'API_KEY'

};

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' => 'API_KEY'
}

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': 'API_KEY'
}

r = requests.post('https://api.igrant.io/v1/organizations', params={

}, headers = headers)

print r.json()

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{"API_KEY"},

    }

    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

Adds a new organization

Body parameter

{
  "Name": "string",
  "Location": "string",
  "Description": "string",
  "TypeID": "string"
}

Parameters

Name In Type Required Description
body body CreateOrganization true none

Example responses

201 Response

{
  "Organization": {
    "ID": "string",
    "Name": "string",
    "CoverImageID": "string",
    "CoverImageurl": "string",
    "LogoImageID": "string",
    "LogoImageURL": "string",
    "Location": "string",
    "Type": {
      "ID": "5bba67ba98135900010927a5",
      "Type": "Retail",
      "ImageID": "5bba67e798135900010927a7",
      "ImageURL": "https://api.igrant.io/v1/organizations/types/5bba67ba98135900010927a5/image"
    },
    "Description": "string",
    "Enabled": true,
    "Policyurl": "string",
    "EulaURL": "string",
    "Template": [
      {
        "ID": "5bba6a9998135900010927ba",
        "Consent": "Spouse",
        "PurposeIDs": [
          "5bba69db98135900010927ac, 8bba69db98135900010927af"
        ]
      }
    ],
    "Purposes": [
      {
        "ID": "string",
        "Description": "string",
        "LawfulUsage": true,
        "PolicyURL": "string"
      }
    ],
    "Admins": [
      {
        "userID": "string",
        "roleID": 0
      }
    ],
    "BillingInfo": {
      "BillingRegistrationID": "string",
      "PlanType": "string"
    }
  }
}

Responses

Status Meaning Description Schema
201 Created New Organization added successfully. OrganizationObject

Get existing roles

Code samples

# You can also use wget
curl -X GET https://api.igrant.io/v1/organizations/roles \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer API_KEY'

GET https://api.igrant.io/v1/organizations/roles HTTP/1.1
Host: api.igrant.io
Accept: application/json

var headers = {
  'Accept':'application/json',
  'Authorization':'API_KEY'

};

$.ajax({
  url: 'https://api.igrant.io/v1/organizations/roles',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'Authorization':'API_KEY'

};

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',
  'Authorization' => 'API_KEY'
}

result = RestClient.get 'https://api.igrant.io/v1/organizations/roles',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'API_KEY'
}

r = requests.get('https://api.igrant.io/v1/organizations/roles', params={

}, headers = headers)

print r.json()

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"},
        "Authorization": []string{"API_KEY"},

    }

    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

Gets existing roles.

Example responses

200 Response

{
  "ID": 1,
  "Role": "Admin"
}

Responses

Status Meaning Description Schema
200 OK List of available roles. Roles

View organizations

Code samples

# You can also use wget
curl -X GET https://api.igrant.io/v1/organizations/{organizationId} \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer API_KEY'

GET https://api.igrant.io/v1/organizations/{organizationId} HTTP/1.1
Host: api.igrant.io
Accept: application/json

var headers = {
  'Accept':'application/json',
  'Authorization':'API_KEY'

};

$.ajax({
  url: 'https://api.igrant.io/v1/organizations/{organizationId}',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'Authorization':'API_KEY'

};

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' => 'API_KEY'
}

result = RestClient.get 'https://api.igrant.io/v1/organizations/{organizationId}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'API_KEY'
}

r = requests.get('https://api.igrant.io/v1/organizations/{organizationId}', params={

}, headers = headers)

print r.json()

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{"API_KEY"},

    }

    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 details.

Parameters

Name In Type Required Description
organizationId path string true ID of the organization

Example responses

200 Response

{
  "Organization": {
    "ID": "string",
    "Name": "string",
    "CoverImageID": "string",
    "CoverImageurl": "string",
    "LogoImageID": "string",
    "LogoImageURL": "string",
    "Location": "string",
    "Type": {
      "ID": "5bba67ba98135900010927a5",
      "Type": "Retail",
      "ImageID": "5bba67e798135900010927a7",
      "ImageURL": "https://api.igrant.io/v1/organizations/types/5bba67ba98135900010927a5/image"
    },
    "Description": "string",
    "Enabled": true,
    "Policyurl": "string",
    "EulaURL": "string",
    "Template": [
      {
        "ID": "5bba6a9998135900010927ba",
        "Consent": "Spouse",
        "PurposeIDs": [
          "5bba69db98135900010927ac, 8bba69db98135900010927af"
        ]
      }
    ],
    "Purposes": [
      {
        "ID": "string",
        "Description": "string",
        "LawfulUsage": true,
        "PolicyURL": "string"
      }
    ],
    "Admins": [
      {
        "userID": "string",
        "roleID": 0
      }
    ],
    "BillingInfo": {
      "BillingRegistrationID": "string",
      "PlanType": "string"
    }
  }
}

Responses

Status Meaning Description Schema
200 OK Successful response OrganizationObject
404 Not Found Organization id not found None

Delete an organization

Code samples

# You can also use wget
curl -X DELETE https://api.igrant.io/v1/organizations/{organizationId} \
  -H 'Authorization: Bearer API_KEY'

DELETE https://api.igrant.io/v1/organizations/{organizationId} HTTP/1.1
Host: api.igrant.io

var headers = {
  'Authorization':'API_KEY'

};

$.ajax({
  url: 'https://api.igrant.io/v1/organizations/{organizationId}',
  method: 'delete',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Authorization':'API_KEY'

};

fetch('https://api.igrant.io/v1/organizations/{organizationId}',
{
  method: 'DELETE',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Authorization' => 'API_KEY'
}

result = RestClient.delete 'https://api.igrant.io/v1/organizations/{organizationId}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Authorization': 'API_KEY'
}

r = requests.delete('https://api.igrant.io/v1/organizations/{organizationId}', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://api.igrant.io/v1/organizations/{organizationId}");
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{"API_KEY"},

    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("DELETE", "https://api.igrant.io/v1/organizations/{organizationId}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

DELETE /organizations/{organizationId}

Deletes a given organization by ID.

Parameters

Name In Type Required Description
organizationId path string true ID of the organization

Responses

Status Meaning Description Schema
200 OK Deleted successfully. None
404 Not Found Organization ID not found. None

Update 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 API_KEY'

PATCH https://api.igrant.io/v1/organizations/{organizationId} HTTP/1.1
Host: api.igrant.io
Content-Type: application/json

var headers = {
  'Content-Type':'application/json',
  'Authorization':'API_KEY'

};

$.ajax({
  url: 'https://api.igrant.io/v1/organizations/{organizationId}',
  method: 'patch',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');
const inputBody = '{
  "Location": "string",
  "Description": "string",
  "Policyurl": "string"
}';
const headers = {
  'Content-Type':'application/json',
  'Authorization':'API_KEY'

};

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' => 'API_KEY'
}

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': 'API_KEY'
}

r = requests.patch('https://api.igrant.io/v1/organizations/{organizationId}', params={

}, headers = headers)

print r.json()

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{"API_KEY"},

    }

    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}

Update organization information

Body parameter

{
  "Location": "string",
  "Description": "string",
  "Policyurl": "string"
}

Parameters

Name In Type Required Description
organizationId path string true ID of the organization
body body object false none
» Location body string false location of the organization
» Description body string false description of the organization
» Policyurl body string false Organization's policyURL

Responses

Status Meaning Description Schema
202 Accepted Updated organization data successfully. None

Get subscribed tokens

Code samples

# You can also use wget
curl -X GET https://api.igrant.io/v1/organizations/{organizationID}/subscribe-token \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer API_KEY'

GET https://api.igrant.io/v1/organizations/{organizationID}/subscribe-token HTTP/1.1
Host: api.igrant.io
Accept: application/json

var headers = {
  'Accept':'application/json',
  'Authorization':'API_KEY'

};

$.ajax({
  url: 'https://api.igrant.io/v1/organizations/{organizationID}/subscribe-token',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'Authorization':'API_KEY'

};

fetch('https://api.igrant.io/v1/organizations/{organizationID}/subscribe-token',
{
  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' => 'API_KEY'
}

result = RestClient.get 'https://api.igrant.io/v1/organizations/{organizationID}/subscribe-token',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'API_KEY'
}

r = requests.get('https://api.igrant.io/v1/organizations/{organizationID}/subscribe-token', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://api.igrant.io/v1/organizations/{organizationID}/subscribe-token");
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{"API_KEY"},

    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://api.igrant.io/v1/organizations/{organizationID}/subscribe-token", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /organizations/{organizationID}/subscribe-token

Gets all tokens subscribed to an organization

Parameters

Name In Type Required Description
organizationID path string true id of the organization

Example responses

200 Response

{
  "SubscribeToken": "string",
  "SubscribeMethod": "string"
}

Responses

Status Meaning Description Schema
200 OK OK SubscribeToken

Create token

Code samples

# You can also use wget
curl -X POST https://api.igrant.io/v1/organizations/{organizationID}/subscribe-token \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer API_KEY'

POST https://api.igrant.io/v1/organizations/{organizationID}/subscribe-token HTTP/1.1
Host: api.igrant.io
Content-Type: application/json
Accept: application/json

var headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'API_KEY'

};

$.ajax({
  url: 'https://api.igrant.io/v1/organizations/{organizationID}/subscribe-token',
  method: 'post',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');
const inputBody = '{
  "SubscribeToken": "string",
  "SubscribeMethod": "string"
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'API_KEY'

};

fetch('https://api.igrant.io/v1/organizations/{organizationID}/subscribe-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',
  'Authorization' => 'API_KEY'
}

result = RestClient.post 'https://api.igrant.io/v1/organizations/{organizationID}/subscribe-token',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'API_KEY'
}

r = requests.post('https://api.igrant.io/v1/organizations/{organizationID}/subscribe-token', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://api.igrant.io/v1/organizations/{organizationID}/subscribe-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"},
        "Authorization": []string{"API_KEY"},

    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "https://api.igrant.io/v1/organizations/{organizationID}/subscribe-token", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

POST /organizations/{organizationID}/subscribe-token

Creates a token for an organization

Body parameter

{
  "SubscribeToken": "string",
  "SubscribeMethod": "string"
}

Parameters

Name In Type Required Description
organizationID path string true id of the organization
body body SubscribeToken true none

Example responses

200 Response

{
  "SubscribeToken": "string",
  "SubscribeMethod": "string"
}

Responses

Status Meaning Description Schema
200 OK OK SubscribeToken

Delete token

Code samples

# You can also use wget
curl -X DELETE https://api.igrant.io/v1/organizations/{organizationID}/subscribe-token \
  -H 'Authorization: Bearer API_KEY'

DELETE https://api.igrant.io/v1/organizations/{organizationID}/subscribe-token HTTP/1.1
Host: api.igrant.io

var headers = {
  'Authorization':'API_KEY'

};

$.ajax({
  url: 'https://api.igrant.io/v1/organizations/{organizationID}/subscribe-token',
  method: 'delete',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Authorization':'API_KEY'

};

fetch('https://api.igrant.io/v1/organizations/{organizationID}/subscribe-token',
{
  method: 'DELETE',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Authorization' => 'API_KEY'
}

result = RestClient.delete 'https://api.igrant.io/v1/organizations/{organizationID}/subscribe-token',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Authorization': 'API_KEY'
}

r = requests.delete('https://api.igrant.io/v1/organizations/{organizationID}/subscribe-token', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://api.igrant.io/v1/organizations/{organizationID}/subscribe-token");
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{"API_KEY"},

    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("DELETE", "https://api.igrant.io/v1/organizations/{organizationID}/subscribe-token", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

DELETE /organizations/{organizationID}/subscribe-token

Deletes a token for an organization

Parameters

Name In Type Required Description
organizationID path string true id of the organization

Responses

Status Meaning Description Schema
204 No Content No content None

Enable organization

Code samples

# You can also use wget
curl -X POST https://api.igrant.io/v1/organizations/{organizationId}/enable \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer API_KEY'

POST https://api.igrant.io/v1/organizations/{organizationId}/enable HTTP/1.1
Host: api.igrant.io
Accept: application/json

var headers = {
  'Accept':'application/json',
  'Authorization':'API_KEY'

};

$.ajax({
  url: 'https://api.igrant.io/v1/organizations/{organizationId}/enable',
  method: 'post',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'Authorization':'API_KEY'

};

fetch('https://api.igrant.io/v1/organizations/{organizationId}/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' => 'API_KEY'
}

result = RestClient.post 'https://api.igrant.io/v1/organizations/{organizationId}/enable',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'API_KEY'
}

r = requests.post('https://api.igrant.io/v1/organizations/{organizationId}/enable', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://api.igrant.io/v1/organizations/{organizationId}/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{"API_KEY"},

    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "https://api.igrant.io/v1/organizations/{organizationId}/enable", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

POST /organizations/{organizationId}/enable

Enables an organization

Parameters

Name In Type Required Description
organizationId path string true id of the organization

Example responses

200 Response

{
  "Organization": {
    "ID": "string",
    "Name": "string",
    "CoverImageID": "string",
    "CoverImageurl": "string",
    "LogoImageID": "string",
    "LogoImageURL": "string",
    "Location": "string",
    "Type": {
      "ID": "5bba67ba98135900010927a5",
      "Type": "Retail",
      "ImageID": "5bba67e798135900010927a7",
      "ImageURL": "https://api.igrant.io/v1/organizations/types/5bba67ba98135900010927a5/image"
    },
    "Description": "string",
    "Enabled": true,
    "Policyurl": "string",
    "EulaURL": "string",
    "Template": [
      {
        "ID": "5bba6a9998135900010927ba",
        "Consent": "Spouse",
        "PurposeIDs": [
          "5bba69db98135900010927ac, 8bba69db98135900010927af"
        ]
      }
    ],
    "Purposes": [
      {
        "ID": "string",
        "Description": "string",
        "LawfulUsage": true,
        "PolicyURL": "string"
      }
    ],
    "Admins": [
      {
        "userID": "string",
        "roleID": 0
      }
    ],
    "BillingInfo": {
      "BillingRegistrationID": "string",
      "PlanType": "string"
    }
  }
}

Responses

Status Meaning Description Schema
200 OK OK, Enabled OrganizationObject

Disable organization

Code samples

# You can also use wget
curl -X DELETE https://api.igrant.io/v1/organizations/{organizationId}/enable \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer API_KEY'

DELETE https://api.igrant.io/v1/organizations/{organizationId}/enable HTTP/1.1
Host: api.igrant.io
Accept: application/json

var headers = {
  'Accept':'application/json',
  'Authorization':'API_KEY'

};

$.ajax({
  url: 'https://api.igrant.io/v1/organizations/{organizationId}/enable',
  method: 'delete',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'Authorization':'API_KEY'

};

fetch('https://api.igrant.io/v1/organizations/{organizationId}/enable',
{
  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' => 'API_KEY'
}

result = RestClient.delete 'https://api.igrant.io/v1/organizations/{organizationId}/enable',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'API_KEY'
}

r = requests.delete('https://api.igrant.io/v1/organizations/{organizationId}/enable', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://api.igrant.io/v1/organizations/{organizationId}/enable");
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{"API_KEY"},

    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("DELETE", "https://api.igrant.io/v1/organizations/{organizationId}/enable", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

DELETE /organizations/{organizationId}/enable

Disables an organization

Parameters

Name In Type Required Description
organizationId path string true id of the organization

Example responses

200 Response

{
  "Organization": {
    "ID": "string",
    "Name": "string",
    "CoverImageID": "string",
    "CoverImageurl": "string",
    "LogoImageID": "string",
    "LogoImageURL": "string",
    "Location": "string",
    "Type": {
      "ID": "5bba67ba98135900010927a5",
      "Type": "Retail",
      "ImageID": "5bba67e798135900010927a7",
      "ImageURL": "https://api.igrant.io/v1/organizations/types/5bba67ba98135900010927a5/image"
    },
    "Description": "string",
    "Enabled": true,
    "Policyurl": "string",
    "EulaURL": "string",
    "Template": [
      {
        "ID": "5bba6a9998135900010927ba",
        "Consent": "Spouse",
        "PurposeIDs": [
          "5bba69db98135900010927ac, 8bba69db98135900010927af"
        ]
      }
    ],
    "Purposes": [
      {
        "ID": "string",
        "Description": "string",
        "LawfulUsage": true,
        "PolicyURL": "string"
      }
    ],
    "Admins": [
      {
        "userID": "string",
        "roleID": 0
      }
    ],
    "BillingInfo": {
      "BillingRegistrationID": "string",
      "PlanType": "string"
    }
  }
}

Responses

Status Meaning Description Schema
200 OK OK, disabled OrganizationObject

Update eulaURL

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 API_KEY'

POST https://api.igrant.io/v1/organizations/{organizationId}/eulaURL HTTP/1.1
Host: api.igrant.io
Content-Type: application/json

var headers = {
  'Content-Type':'application/json',
  'Authorization':'API_KEY'

};

$.ajax({
  url: 'https://api.igrant.io/v1/organizations/{organizationId}/eulaURL',
  method: 'post',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');
const inputBody = '{
  "eulaURL": "string"
}';
const headers = {
  'Content-Type':'application/json',
  'Authorization':'API_KEY'

};

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' => 'API_KEY'
}

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': 'API_KEY'
}

r = requests.post('https://api.igrant.io/v1/organizations/{organizationId}/eulaURL', params={

}, headers = headers)

print r.json()

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{"API_KEY"},

    }

    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 the EULA URL for an organization

Body parameter

{
  "eulaURL": "string"
}

Parameters

Name In Type Required Description
organizationId path string true ID of the organizaton
body body object true none
» eulaURL body string false URL

Responses

Status Meaning Description Schema
202 Accepted Accepted None

Update logo image

Code samples

# You can also use wget
curl -X POST https://api.igrant.io/v1/organizations/{organizationId}/logoimage \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer API_KEY'

POST https://api.igrant.io/v1/organizations/{organizationId}/logoimage HTTP/1.1
Host: api.igrant.io
Content-Type: application/json
Accept: application/json

var headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'API_KEY'

};

$.ajax({
  url: 'https://api.igrant.io/v1/organizations/{organizationId}/logoimage',
  method: 'post',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');
const inputBody = '{
  "orgimage": "string"
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'API_KEY'

};

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' => 'application/json',
  'Accept' => 'application/json',
  'Authorization' => 'API_KEY'
}

result = RestClient.post 'https://api.igrant.io/v1/organizations/{organizationId}/logoimage',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'API_KEY'
}

r = requests.post('https://api.igrant.io/v1/organizations/{organizationId}/logoimage', params={

}, headers = headers)

print r.json()

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{"application/json"},
        "Accept": []string{"application/json"},
        "Authorization": []string{"API_KEY"},

    }

    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 the logo image for an organization

Body parameter

{
  "orgimage": "string"
}

Parameters

Name In Type Required Description
organizationId path string true ID of the organizaton
body body object true none
» orgimage body string false link to logo

Example responses

200 Response

{
  "Organization": {
    "ID": "string",
    "Name": "string",
    "CoverImageID": "string",
    "CoverImageurl": "string",
    "LogoImageID": "string",
    "LogoImageURL": "string",
    "Location": "string",
    "Type": {
      "ID": "5bba67ba98135900010927a5",
      "Type": "Retail",
      "ImageID": "5bba67e798135900010927a7",
      "ImageURL": "https://api.igrant.io/v1/organizations/types/5bba67ba98135900010927a5/image"
    },
    "Description": "string",
    "Enabled": true,
    "Policyurl": "string",
    "EulaURL": "string",
    "Template": [
      {
        "ID": "5bba6a9998135900010927ba",
        "Consent": "Spouse",
        "PurposeIDs": [
          "5bba69db98135900010927ac, 8bba69db98135900010927af"
        ]
      }
    ],
    "Purposes": [
      {
        "ID": "string",
        "Description": "string",
        "LawfulUsage": true,
        "PolicyURL": "string"
      }
    ],
    "Admins": [
      {
        "userID": "string",
        "roleID": 0
      }
    ],
    "BillingInfo": {
      "BillingRegistrationID": "string",
      "PlanType": "string"
    }
  }
}

Responses

Status Meaning Description Schema
200 OK Updated logo image OrganizationObject

Update cover image

Code samples

# You can also use wget
curl -X POST https://api.igrant.io/v1/organizations/{organizationId}/coverimage \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer API_KEY'

POST https://api.igrant.io/v1/organizations/{organizationId}/coverimage HTTP/1.1
Host: api.igrant.io
Content-Type: application/json
Accept: application/json

var headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'API_KEY'

};

$.ajax({
  url: 'https://api.igrant.io/v1/organizations/{organizationId}/coverimage',
  method: 'post',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');
const inputBody = '{
  "orgimage": "string"
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'API_KEY'

};

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' => 'application/json',
  'Accept' => 'application/json',
  'Authorization' => 'API_KEY'
}

result = RestClient.post 'https://api.igrant.io/v1/organizations/{organizationId}/coverimage',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'API_KEY'
}

r = requests.post('https://api.igrant.io/v1/organizations/{organizationId}/coverimage', params={

}, headers = headers)

print r.json()

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{"application/json"},
        "Accept": []string{"application/json"},
        "Authorization": []string{"API_KEY"},

    }

    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 the cover image for an organization

Body parameter

{
  "orgimage": "string"
}

Parameters

Name In Type Required Description
organizationId path string true ID of the organizaton
body body object true none
» orgimage body string false link to image

Example responses

200 Response

{
  "Organization": {
    "ID": "string",
    "Name": "string",
    "CoverImageID": "string",
    "CoverImageurl": "string",
    "LogoImageID": "string",
    "LogoImageURL": "string",
    "Location": "string",
    "Type": {
      "ID": "5bba67ba98135900010927a5",
      "Type": "Retail",
      "ImageID": "5bba67e798135900010927a7",
      "ImageURL": "https://api.igrant.io/v1/organizations/types/5bba67ba98135900010927a5/image"
    },
    "Description": "string",
    "Enabled": true,
    "Policyurl": "string",
    "EulaURL": "string",
    "Template": [
      {
        "ID": "5bba6a9998135900010927ba",
        "Consent": "Spouse",
        "PurposeIDs": [
          "5bba69db98135900010927ac, 8bba69db98135900010927af"
        ]
      }
    ],
    "Purposes": [
      {
        "ID": "string",
        "Description": "string",
        "LawfulUsage": true,
        "PolicyURL": "string"
      }
    ],
    "Admins": [
      {
        "userID": "string",
        "roleID": 0
      }
    ],
    "BillingInfo": {
      "BillingRegistrationID": "string",
      "PlanType": "string"
    }
  }
}

Responses

Status Meaning Description Schema
200 OK Updated cover image OrganizationObject

Add admins to an organization

Code samples

# You can also use wget
curl -X POST https://api.igrant.io/v1/organizations/{organizationId}/admins \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer API_KEY'

POST https://api.igrant.io/v1/organizations/{organizationId}/admins HTTP/1.1
Host: api.igrant.io
Content-Type: application/json
Accept: application/json

var headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'API_KEY'

};

$.ajax({
  url: 'https://api.igrant.io/v1/organizations/{organizationId}/admins',
  method: 'post',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');
const inputBody = '{
  "userID": "string",
  "roleID": 0
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'API_KEY'

};

fetch('https://api.igrant.io/v1/organizations/{organizationId}/admins',
{
  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' => 'API_KEY'
}

result = RestClient.post 'https://api.igrant.io/v1/organizations/{organizationId}/admins',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'API_KEY'
}

r = requests.post('https://api.igrant.io/v1/organizations/{organizationId}/admins', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://api.igrant.io/v1/organizations/{organizationId}/admins");
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{"API_KEY"},

    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "https://api.igrant.io/v1/organizations/{organizationId}/admins", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

POST /organizations/{organizationId}/admins

Add admins to an organization

Body parameter

{
  "userID": "string",
  "roleID": 1
}

Parameters

Name In Type Required Description
organizationId path string true Id of the organization to which add a user
body body userDataAdmin true none

Example responses

200 Response

{
  "Organization": {
    "ID": "string",
    "Name": "string",
    "CoverImageID": "string",
    "CoverImageurl": "string",
    "LogoImageID": "string",
    "LogoImageURL": "string",
    "Location": "string",
    "Type": {
      "ID": "5bba67ba98135900010927a5",
      "Type": "Retail",
      "ImageID": "5bba67e798135900010927a7",
      "ImageURL": "https://api.igrant.io/v1/organizations/types/5bba67ba98135900010927a5/image"
    },
    "Description": "string",
    "Enabled": true,
    "Policyurl": "string",
    "EulaURL": "string",
    "Template": [
      {
        "ID": "5bba6a9998135900010927ba",
        "Consent": "Spouse",
        "PurposeIDs": [
          "5bba69db98135900010927ac, 8bba69db98135900010927af"
        ]
      }
    ],
    "Purposes": [
      {
        "ID": "string",
        "Description": "string",
        "LawfulUsage": true,
        "PolicyURL": "string"
      }
    ],
    "Admins": [
      {
        "userID": "string",
        "roleID": 0
      }
    ],
    "BillingInfo": {
      "BillingRegistrationID": "string",
      "PlanType": "string"
    }
  }
}

Responses

Status Meaning Description Schema
200 OK Success; returns organization details OrganizationObject
500 Internal Server Error Failed to add admin user to organization None

Delete admins

Code samples

# You can also use wget
curl -X DELETE https://api.igrant.io/v1/organizations/{organizationId}/admins \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer API_KEY'

DELETE https://api.igrant.io/v1/organizations/{organizationId}/admins HTTP/1.1
Host: api.igrant.io
Content-Type: application/json
Accept: application/json

var headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'API_KEY'

};

$.ajax({
  url: 'https://api.igrant.io/v1/organizations/{organizationId}/admins',
  method: 'delete',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');
const inputBody = '{
  "userID": "string",
  "roleID": 0
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'API_KEY'

};

fetch('https://api.igrant.io/v1/organizations/{organizationId}/admins',
{
  method: 'DELETE',
  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' => 'API_KEY'
}

result = RestClient.delete 'https://api.igrant.io/v1/organizations/{organizationId}/admins',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'API_KEY'
}

r = requests.delete('https://api.igrant.io/v1/organizations/{organizationId}/admins', params={

}, headers = headers)

print r.json()

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{
        "Content-Type": []string{"application/json"},
        "Accept": []string{"application/json"},
        "Authorization": []string{"API_KEY"},

    }

    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

Delete admins from an organization

Body parameter

{
  "userID": "string",
  "roleID": 0
}

Parameters

Name In Type Required Description
organizationId path string true Id of the organization for which a user shall be deleted
body body userDataAdmin true none

Example responses

200 Response

{
  "Organization": {
    "ID": "string",
    "Name": "string",
    "CoverImageID": "string",
    "CoverImageurl": "string",
    "LogoImageID": "string",
    "LogoImageURL": "string",
    "Location": "string",
    "Type": {
      "ID": "5bba67ba98135900010927a5",
      "Type": "Retail",
      "ImageID": "5bba67e798135900010927a7",
      "ImageURL": "https://api.igrant.io/v1/organizations/types/5bba67ba98135900010927a5/image"
    },
    "Description": "string",
    "Enabled": true,
    "Policyurl": "string",
    "EulaURL": "string",
    "Template": [
      {
        "ID": "5bba6a9998135900010927ba",
        "Consent": "Spouse",
        "PurposeIDs": [
          "5bba69db98135900010927ac, 8bba69db98135900010927af"
        ]
      }
    ],
    "Purposes": [
      {
        "ID": "string",
        "Description": "string",
        "LawfulUsage": true,
        "PolicyURL": "string"
      }
    ],
    "Admins": [
      {
        "userID": "string",
        "roleID": 0
      }
    ],
    "BillingInfo": {
      "BillingRegistrationID": "string",
      "PlanType": "string"
    }
  }
}

Responses

Status Meaning Description Schema
200 OK Success; Organization details with deleted admin OrganizationObject
500 Internal Server Error Failed to delete admin user to organization None

Get all 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 API_KEY'

GET https://api.igrant.io/v1/organizations/{organizationId}/users HTTP/1.1
Host: api.igrant.io
Accept: application/json

var headers = {
  'Accept':'application/json',
  'Authorization':'API_KEY'

};

$.ajax({
  url: 'https://api.igrant.io/v1/organizations/{organizationId}/users',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'Authorization':'API_KEY'

};

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' => 'API_KEY'
}

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': 'API_KEY'
}

r = requests.get('https://api.igrant.io/v1/organizations/{organizationId}/users', params={

}, headers = headers)

print r.json()

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{"API_KEY"},

    }

    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 all users associated with an organization

Parameters

Name In Type Required Description
organizationId path string true ID of the organization

Example responses

200 Response

{
  "User": {
    "ID": "5b9025defef8d50001ebb6f2",
    "Name": "Test production",
    "IamID": "7c7591e507",
    "Email": "p@p.io",
    "Phone": "+358 549 45043",
    "ImageID": "423049",
    "ImageURL": "imageurl.fi",
    "LastVisit": "2018-09-05 18:55:21",
    "Client": {
      "Token": 34234234,
      "Type": 0
    },
    "Orgs": [
      {
        "OrgID": "5b4ab3f926eddc0001ad3885",
        "Name": "iGrant.io",
        "Location": "Stockholm, Sweden",
        "Type": "RegTech",
        "TypeID\"": "b4ab3bf26eddc0001ad3883"
      }
    ]
  }
}

Responses

Status Meaning Description Schema
200 OK Successful response User
404 Not Found Organization id not found None

Subscribe user

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 API_KEY'

POST https://api.igrant.io/v1/organizations/{organizationId}/users HTTP/1.1
Host: api.igrant.io
Content-Type: application/json
Accept: application/json

var headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'API_KEY'

};

$.ajax({
  url: 'https://api.igrant.io/v1/organizations/{organizationId}/users',
  method: 'post',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');
const inputBody = '{
  "userId": "string"
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'API_KEY'

};

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' => 'API_KEY'
}

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': 'API_KEY'
}

r = requests.post('https://api.igrant.io/v1/organizations/{organizationId}/users', params={

}, headers = headers)

print r.json()

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{"API_KEY"},

    }

    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

Subscribe a user to an organization

Body parameter

{
  "userId": "string"
}

Parameters

Name In Type Required Description
organizationId path string true ID of the organization to which a user shall be added
body body object true none
userId body string false none

Example responses

200 Response

{
  "User": {
    "ID": "5b9025defef8d50001ebb6f2",
    "Name": "Test production",
    "IamID": "7c7591e507",
    "Email": "p@p.io",
    "Phone": "+358 549 45043",
    "ImageID": "423049",
    "ImageURL": "imageurl.fi",
    "LastVisit": "2018-09-05 18:55:21",
    "Client": {
      "Token": 34234234,
      "Type": 0
    },
    "Orgs": [
      {
        "OrgID": "5b4ab3f926eddc0001ad3885",
        "Name": "iGrant.io",
        "Location": "Stockholm, Sweden",
        "Type": "RegTech",
        "TypeID\"": "b4ab3bf26eddc0001ad3883"
      }
    ]
  }
}

Responses

Status Meaning Description Schema
200 OK success, returns the user details User
400 Bad Request Failure, cannot subscribe to disabled organization None

Get subscribed users count

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 API_KEY'

GET https://api.igrant.io/v1/organizations/{organizationId}/users/count HTTP/1.1
Host: api.igrant.io
Accept: application/json

var headers = {
  'Accept':'application/json',
  'Authorization':'API_KEY'

};

$.ajax({
  url: 'https://api.igrant.io/v1/organizations/{organizationId}/users/count',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'Authorization':'API_KEY'

};

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' => 'API_KEY'
}

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': 'API_KEY'
}

r = requests.get('https://api.igrant.io/v1/organizations/{organizationId}/users/count', params={

}, headers = headers)

print r.json()

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{"API_KEY"},

    }

    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 subscribed user count

Parameters

Name In Type Required Description
organizationId path string true ID of the organization

Example responses

200 Response

{
  "SubscribeUserCount": 7
}

Responses

Status Meaning Description Schema
200 OK Returns SubscribeUserCount SubscribeUserCount

Get user details

Code samples

# You can also use wget
curl -X GET https://api.igrant.io/v1/organizations/{organizationId}/users/{userId} \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer API_KEY'

GET https://api.igrant.io/v1/organizations/{organizationId}/users/{userId} HTTP/1.1
Host: api.igrant.io
Accept: application/json

var headers = {
  'Accept':'application/json',
  'Authorization':'API_KEY'

};

$.ajax({
  url: 'https://api.igrant.io/v1/organizations/{organizationId}/users/{userId}',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'Authorization':'API_KEY'

};

fetch('https://api.igrant.io/v1/organizations/{organizationId}/users/{userId}',
{
  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' => 'API_KEY'
}

result = RestClient.get 'https://api.igrant.io/v1/organizations/{organizationId}/users/{userId}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'API_KEY'
}

r = requests.get('https://api.igrant.io/v1/organizations/{organizationId}/users/{userId}', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://api.igrant.io/v1/organizations/{organizationId}/users/{userId}");
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{"API_KEY"},

    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://api.igrant.io/v1/organizations/{organizationId}/users/{userId}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /organizations/{organizationId}/users/{userId}

Gets user details

Parameters

Name In Type Required Description
organizationId path string true ID of the organization
userId path string true ID of the user

Example responses

200 Response

{
  "User": {
    "ID": "5b9025defef8d50001ebb6f2",
    "Name": "Test production",
    "IamID": "7c7591e507",
    "Email": "p@p.io",
    "Phone": "+358 549 45043",
    "ImageID": "423049",
    "ImageURL": "imageurl.fi",
    "LastVisit": "2018-09-05 18:55:21",
    "Client": {
      "Token": 34234234,
      "Type": 0
    },
    "Orgs": [
      {
        "OrgID": "5b4ab3f926eddc0001ad3885",
        "Name": "iGrant.io",
        "Location": "Stockholm, Sweden",
        "Type": "RegTech",
        "TypeID\"": "b4ab3bf26eddc0001ad3883"
      }
    ]
  }
}

Responses

Status Meaning Description Schema
200 OK Successful response User
404 Not Found Organization id or User id not found None

Delete 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 API_KEY'

DELETE https://api.igrant.io/v1/organizations/{organizationId}/users/{userId} HTTP/1.1
Host: api.igrant.io
Accept: application/json

var headers = {
  'Accept':'application/json',
  'Authorization':'API_KEY'

};

$.ajax({
  url: 'https://api.igrant.io/v1/organizations/{organizationId}/users/{userId}',
  method: 'delete',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'Authorization':'API_KEY'

};

fetch('https://api.igrant.io/v1/organizations/{organizationId}/users/{userId}',
{
  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' => 'API_KEY'
}

result = RestClient.delete 'https://api.igrant.io/v1/organizations/{organizationId}/users/{userId}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'API_KEY'
}

r = requests.delete('https://api.igrant.io/v1/organizations/{organizationId}/users/{userId}', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://api.igrant.io/v1/organizations/{organizationId}/users/{userId}");
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{"API_KEY"},

    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("DELETE", "https://api.igrant.io/v1/organizations/{organizationId}/users/{userId}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

DELETE /organizations/{organizationId}/users/{userId}

Removes a given user from the organization.

Parameters

Name In Type Required Description
organizationId path string true ID of the organization
userId path string true ID of the user

Example responses

200 Response

{
  "User": {
    "ID": "5b9025defef8d50001ebb6f2",
    "Name": "Test production",
    "IamID": "7c7591e507",
    "Email": "p@p.io",
    "Phone": "+358 549 45043",
    "ImageID": "423049",
    "ImageURL": "imageurl.fi",
    "LastVisit": "2018-09-05 18:55:21",
    "Client": {
      "Token": 34234234,
      "Type": 0
    },
    "Orgs": [
      {
        "OrgID": "5b4ab3f926eddc0001ad3885",
        "Name": "iGrant.io",
        "Location": "Stockholm, Sweden",
        "Type": "RegTech",
        "TypeID\"": "b4ab3bf26eddc0001ad3883"
      }
    ]
  }
}

Responses

Status Meaning Description Schema
200 OK Removed user successfully from organization. User
404 Not Found Organization id or User id not found None

Code samples

# You can also use wget
curl -X GET https://api.igrant.io/v1/organizations/{organizationId}/users/{userId}/consents \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer API_KEY'

GET https://api.igrant.io/v1/organizations/{organizationId}/users/{userId}/consents HTTP/1.1
Host: api.igrant.io
Accept: application/json

var headers = {
  'Accept':'application/json',
  'Authorization':'API_KEY'

};

$.ajax({
  url: 'https://api.igrant.io/v1/organizations/{organizationId}/users/{userId}/consents',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'Authorization':'API_KEY'

};

fetch('https://api.igrant.io/v1/organizations/{organizationId}/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' => 'API_KEY'
}

result = RestClient.get 'https://api.igrant.io/v1/organizations/{organizationId}/users/{userId}/consents',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'API_KEY'
}

r = requests.get('https://api.igrant.io/v1/organizations/{organizationId}/users/{userId}/consents', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://api.igrant.io/v1/organizations/{organizationId}/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{"API_KEY"},

    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://api.igrant.io/v1/organizations/{organizationId}/users/{userId}/consents", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /organizations/{organizationId}/users/{userId}/consents

Gets existing user data sets stored with an organization

Parameters

Name In Type Required Description
organizationId path string true ID of the organization
userId path string true ID of the user

Example responses

200 Response

{
  "ID": "5bba6a9998135900010927bb",
  "OrgID": "5bba686e98135900010927a8",
  "UserID": "5bc786ea90e2a00001de6de1",
  "ConsentsAndPurposes": [
    {
      "Purpose": {
        "ID": "5bba69db98135900010927ac",
        "Description": "Contractual Purpose",
        "LawfulUsage": "False",
        "PolicyUrl": "https://www.ica.se/policies/behandling-av-personuppgifter/"
      },
      "Count": {
        "Total": "2",
        "Consented": "2"
      },
      "Consents": [
        {
          "ID": "5bba6a9998135900010927bb",
          "Description": "No. of kids",
          "Value": "",
          "Status": {
            "Consented": "Allow",
            "TimeStamp": "0001-01-01T00:00:00Z",
            "Days": 0,
            "Remaining": 0
          }
        }
      ]
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK Successful response Consent
404 Not Found Organization id or User id not found None

Update user consents

Code samples

# You can also use wget
curl -X PATCH https://api.igrant.io/v1/organizations/{organizationId}/users/{userId}/consents \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer API_KEY'

PATCH https://api.igrant.io/v1/organizations/{organizationId}/users/{userId}/consents HTTP/1.1
Host: api.igrant.io
Content-Type: application/json

var headers = {
  'Content-Type':'application/json',
  'Authorization':'API_KEY'

};

$.ajax({
  url: 'https://api.igrant.io/v1/organizations/{organizationId}/users/{userId}/consents',
  method: 'patch',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');
const inputBody = '{
  "ID": "5bba6a9998135900010927bb",
  "OrgID": "5bba686e98135900010927a8",
  "UserID": "5bc786ea90e2a00001de6de1",
  "ConsentsAndPurposes": [
    {
      "Purpose": {
        "ID": "5bba69db98135900010927ac",
        "Description": "Contractual Purpose",
        "LawfulUsage": "False",
        "PolicyUrl": "https://www.ica.se/policies/behandling-av-personuppgifter/"
      },
      "Count": {
        "Total": "2",
        "Consented": "2"
      },
      "Consents": [
        {
          "ID": "5bba6a9998135900010927bb",
          "Description": "No. of kids",
          "Value": "",
          "Status": {
            "Consented": "Allow",
            "TimeStamp": "0001-01-01T00:00:00Z",
            "Days": 0,
            "Remaining": 0
          }
        }
      ]
    }
  ]
}';
const headers = {
  'Content-Type':'application/json',
  'Authorization':'API_KEY'

};

fetch('https://api.igrant.io/v1/organizations/{organizationId}/users/{userId}/consents',
{
  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' => 'API_KEY'
}

result = RestClient.patch 'https://api.igrant.io/v1/organizations/{organizationId}/users/{userId}/consents',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'API_KEY'
}

r = requests.patch('https://api.igrant.io/v1/organizations/{organizationId}/users/{userId}/consents', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://api.igrant.io/v1/organizations/{organizationId}/users/{userId}/consents");
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{"API_KEY"},

    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("PATCH", "https://api.igrant.io/v1/organizations/{organizationId}/users/{userId}/consents", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

PATCH /organizations/{organizationId}/users/{userId}/consents

Update the user consents.

Body parameter

{
  "ID": "5bba6a9998135900010927bb",
  "OrgID": "5bba686e98135900010927a8",
  "UserID": "5bc786ea90e2a00001de6de1",
  "ConsentsAndPurposes": [
    {
      "Purpose": {
        "ID": "5bba69db98135900010927ac",
        "Description": "Contractual Purpose",
        "LawfulUsage": "False",
        "PolicyUrl": "https://www.ica.se/policies/behandling-av-personuppgifter/"
      },
      "Count": {
        "Total": "2",
        "Consented": "2"
      },
      "Consents": [
        {
          "ID": "5bba6a9998135900010927bb",
          "Description": "No. of kids",
          "Value": "",
          "Status": {
            "Consented": "Allow",
            "TimeStamp": "0001-01-01T00:00:00Z",
            "Days": 0,
            "Remaining": 0
          }
        }
      ]
    }
  ]
}

Parameters

Name In Type Required Description
organizationId path string true ID of the organization
userId path string true ID of the user
body body Consent true User consents

Responses

Status Meaning Description Schema
201 Created Successfully modified the user consents None
404 Not Found Organization id or User id not found None

Code samples

# You can also use wget
curl -X GET https://api.igrant.io/v1/organizations/{organizationId}/users/{userId}/consents/{consentId} \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer API_KEY'

GET https://api.igrant.io/v1/organizations/{organizationId}/users/{userId}/consents/{consentId} HTTP/1.1
Host: api.igrant.io
Accept: application/json

var headers = {
  'Accept':'application/json',
  'Authorization':'API_KEY'

};

$.ajax({
  url: 'https://api.igrant.io/v1/organizations/{organizationId}/users/{userId}/consents/{consentId}',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'Authorization':'API_KEY'

};

fetch('https://api.igrant.io/v1/organizations/{organizationId}/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' => 'API_KEY'
}

result = RestClient.get 'https://api.igrant.io/v1/organizations/{organizationId}/users/{userId}/consents/{consentId}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'API_KEY'
}

r = requests.get('https://api.igrant.io/v1/organizations/{organizationId}/users/{userId}/consents/{consentId}', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://api.igrant.io/v1/organizations/{organizationId}/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{"API_KEY"},

    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://api.igrant.io/v1/organizations/{organizationId}/users/{userId}/consents/{consentId}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /organizations/{organizationId}/users/{userId}/consents/{consentId}

Gets a given consent by id.

Parameters

Name In Type Required Description
organizationId path string true ID of the organization
userId path string true ID of the user
consentId path string true ID of the consent

Example responses

200 Response

{
  "ID": "5bba6a9998135900010927bb",
  "OrgID": "5bba686e98135900010927a8",
  "UserID": "5bc786ea90e2a00001de6de1",
  "ConsentsAndPurposes": [
    {
      "Purpose": {
        "ID": "5bba69db98135900010927ac",
        "Description": "Contractual Purpose",
        "LawfulUsage": "False",
        "PolicyUrl": "https://www.ica.se/policies/behandling-av-personuppgifter/"
      },
      "Count": {
        "Total": "2",
        "Consented": "2"
      },
      "Consents": [
        {
          "ID": "5bba6a9998135900010927bb",
          "Description": "No. of kids",
          "Value": "",
          "Status": {
            "Consented": "Allow",
            "TimeStamp": "0001-01-01T00:00:00Z",
            "Days": 0,
            "Remaining": 0
          }
        }
      ]
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK Consent information of given Id. Consent
404 Not Found Organization id or User id not found None

Code samples

# You can also use wget
curl -X DELETE https://api.igrant.io/v1/organizations/{organizationId}/users/{userId}/consents/{consentId} \
  -H 'Authorization: Bearer API_KEY'

DELETE https://api.igrant.io/v1/organizations/{organizationId}/users/{userId}/consents/{consentId} HTTP/1.1
Host: api.igrant.io

var headers = {
  'Authorization':'API_KEY'

};

$.ajax({
  url: 'https://api.igrant.io/v1/organizations/{organizationId}/users/{userId}/consents/{consentId}',
  method: 'delete',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Authorization':'API_KEY'

};

fetch('https://api.igrant.io/v1/organizations/{organizationId}/users/{userId}/consents/{consentId}',
{
  method: 'DELETE',

  headers: headers
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});

require 'rest-client'
require 'json'

headers = {
  'Authorization' => 'API_KEY'
}

result = RestClient.delete 'https://api.igrant.io/v1/organizations/{organizationId}/users/{userId}/consents/{consentId}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Authorization': 'API_KEY'
}

r = requests.delete('https://api.igrant.io/v1/organizations/{organizationId}/users/{userId}/consents/{consentId}', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://api.igrant.io/v1/organizations/{organizationId}/users/{userId}/consents/{consentId}");
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{"API_KEY"},

    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("DELETE", "https://api.igrant.io/v1/organizations/{organizationId}/users/{userId}/consents/{consentId}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

DELETE /organizations/{organizationId}/users/{userId}/consents/{consentId}

Delete a given consent by ID

Parameters

Name In Type Required Description
organizationId path string true ID of the organization
userId path string true ID of the user
consentId path string true ID of the consent

Responses

Status Meaning Description Schema
200 OK OK None

Get purpose details

Code samples

# You can also use wget
curl -X GET https://api.igrant.io/v1/organizations/{organizationId}/users/{UserId}/consents/{ConsentId}/purposes/{PurposeId} \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer API_KEY'

GET https://api.igrant.io/v1/organizations/{organizationId}/users/{UserId}/consents/{ConsentId}/purposes/{PurposeId} HTTP/1.1
Host: api.igrant.io
Accept: application/json

var headers = {
  'Accept':'application/json',
  'Authorization':'API_KEY'

};

$.ajax({
  url: 'https://api.igrant.io/v1/organizations/{organizationId}/users/{UserId}/consents/{ConsentId}/purposes/{PurposeId}',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'Authorization':'API_KEY'

};

fetch('https://api.igrant.io/v1/organizations/{organizationId}/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' => 'API_KEY'
}

result = RestClient.get 'https://api.igrant.io/v1/organizations/{organizationId}/users/{UserId}/consents/{ConsentId}/purposes/{PurposeId}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'API_KEY'
}

r = requests.get('https://api.igrant.io/v1/organizations/{organizationId}/users/{UserId}/consents/{ConsentId}/purposes/{PurposeId}', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://api.igrant.io/v1/organizations/{organizationId}/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{"API_KEY"},

    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://api.igrant.io/v1/organizations/{organizationId}/users/{UserId}/consents/{ConsentId}/purposes/{PurposeId}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /organizations/{organizationId}/users/{UserId}/consents/{ConsentId}/purposes/{PurposeId}

Retrieves purpose details

Parameters

Name In Type Required Description
organizationId path string true ID of the organization
UserId path string true ID of the user
ConsentId path string true ID of the consent
PurposeId path string true ID of the purpose

Example responses

200 Response

{
  "ID": "string",
  "ConsentID": "string",
  "OrgID": "string",
  "UserID": "string",
  "Consents": {
    "Purpose": {
      "ID": "string",
      "Description": "string",
      "LawfulUsage": true,
      "PolicyURL": "string"
    },
    "Count": {
      "Total": 2,
      "Consented": 2
    },
    "Consents": [
      {
        "ID": "string",
        "Description": "string",
        "Value": "string",
        "Status": {
          "Consented": "string",
          "TimeStamp": "string",
          "Days": 0,
          "Remaining": 0
        }
      }
    ]
  }
}

Responses

Status Meaning Description Schema
200 OK Successful response PurposeDetail

Get purpose details

Code samples

# You can also use wget
curl -X GET https://api.igrant.io/v1/organizations/{organizationId}/users/{UserId}/consents/{ConsentId}/purposes/{PurposeId}/status \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer API_KEY'

GET https://api.igrant.io/v1/organizations/{organizationId}/users/{UserId}/consents/{ConsentId}/purposes/{PurposeId}/status HTTP/1.1
Host: api.igrant.io
Accept: application/json

var headers = {
  'Accept':'application/json',
  'Authorization':'API_KEY'

};

$.ajax({
  url: 'https://api.igrant.io/v1/organizations/{organizationId}/users/{UserId}/consents/{ConsentId}/purposes/{PurposeId}/status',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'Authorization':'API_KEY'

};

fetch('https://api.igrant.io/v1/organizations/{organizationId}/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' => 'API_KEY'
}

result = RestClient.get 'https://api.igrant.io/v1/organizations/{organizationId}/users/{UserId}/consents/{ConsentId}/purposes/{PurposeId}/status',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'API_KEY'
}

r = requests.get('https://api.igrant.io/v1/organizations/{organizationId}/users/{UserId}/consents/{ConsentId}/purposes/{PurposeId}/status', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://api.igrant.io/v1/organizations/{organizationId}/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{"API_KEY"},

    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://api.igrant.io/v1/organizations/{organizationId}/users/{UserId}/consents/{ConsentId}/purposes/{PurposeId}/status", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /organizations/{organizationId}/users/{UserId}/consents/{ConsentId}/purposes/{PurposeId}/status

Retrieves purpose details

Parameters

Name In Type Required Description
organizationId path string true ID of the organization
UserId path string true ID of the user
ConsentId path string true ID of the consent
PurposeId path string true ID of the purpose

Example responses

200 Response

{
  "Consented": "string"
}

Responses

Status Meaning Description Schema
200 OK Successful response StatusConsented
500 Internal Server Error Request failed None

Set overall status for a purpose

Code samples

# You can also use wget
curl -X POST https://api.igrant.io/v1/organizations/{organizationId}/users/{UserId}/consents/{ConsentId}/purposes/{PurposeId}/status \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer API_KEY'

POST https://api.igrant.io/v1/organizations/{organizationId}/users/{UserId}/consents/{ConsentId}/purposes/{PurposeId}/status HTTP/1.1
Host: api.igrant.io
Content-Type: application/json
Accept: application/json

var headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'API_KEY'

};

$.ajax({
  url: 'https://api.igrant.io/v1/organizations/{organizationId}/users/{UserId}/consents/{ConsentId}/purposes/{PurposeId}/status',
  method: 'post',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');
const inputBody = '{
  "Consented": "string"
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'API_KEY'

};

fetch('https://api.igrant.io/v1/organizations/{organizationId}/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' => 'API_KEY'
}

result = RestClient.post 'https://api.igrant.io/v1/organizations/{organizationId}/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': 'API_KEY'
}

r = requests.post('https://api.igrant.io/v1/organizations/{organizationId}/users/{UserId}/consents/{ConsentId}/purposes/{PurposeId}/status', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://api.igrant.io/v1/organizations/{organizationId}/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{"API_KEY"},

    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "https://api.igrant.io/v1/organizations/{organizationId}/users/{UserId}/consents/{ConsentId}/purposes/{PurposeId}/status", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

POST /organizations/{organizationId}/users/{UserId}/consents/{ConsentId}/purposes/{PurposeId}/status

Sets overall status for a given purpose, alternatives are "Allow" and "DisAllow"

Body parameter

{
  "Consented": "string"
}

Parameters

Name In Type Required Description
organizationId path string true ID of the organization
UserId path string true ID of the user
ConsentId path string true ID of the consent
PurposeId path string true ID of the purpose
body body object true none
Consented body string true Status of the consent for a given purpose

Example responses

200 Response

{
  "ID": "string",
  "ConsentID": "string",
  "OrgID": "string",
  "UserID": "string",
  "Consents": {
    "Purpose": {
      "ID": "string",
      "Description": "string",
      "LawfulUsage": true,
      "PolicyURL": "string"
    },
    "Count": {
      "Total": 2,
      "Consented": 2
    },
    "Consents": [
      {
        "ID": "string",
        "Description": "string",
        "Value": "string",
        "Status": {
          "Consented": "string",
          "TimeStamp": "string",
          "Days": 0,
          "Remaining": 0
        }
      }
    ]
  }
}

Responses

Status Meaning Description Schema
200 OK Successful response PurposeDetail
500 Internal Server Error Failed response None

Code samples

# You can also use wget
curl -X PATCH https://api.igrant.io/v1/organizations/{organizationId}/users/{UserId}/consents/{ConsentId}/purposes/{PurposeId}/attributes/{attrId} \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer API_KEY'

PATCH https://api.igrant.io/v1/organizations/{organizationId}/users/{UserId}/consents/{ConsentId}/purposes/{PurposeId}/attributes/{attrId} HTTP/1.1
Host: api.igrant.io
Content-Type: application/json
Accept: application/json

var headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'API_KEY'

};

$.ajax({
  url: 'https://api.igrant.io/v1/organizations/{organizationId}/users/{UserId}/consents/{ConsentId}/purposes/{PurposeId}/attributes/{attrId}',
  method: 'patch',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');
const inputBody = '{
  "Consented": "string",
  "Days": 0
}';
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'Authorization':'API_KEY'

};

fetch('https://api.igrant.io/v1/organizations/{organizationId}/users/{UserId}/consents/{ConsentId}/purposes/{PurposeId}/attributes/{attrId}',
{
  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' => 'API_KEY'
}

result = RestClient.patch 'https://api.igrant.io/v1/organizations/{organizationId}/users/{UserId}/consents/{ConsentId}/purposes/{PurposeId}/attributes/{attrId}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'API_KEY'
}

r = requests.patch('https://api.igrant.io/v1/organizations/{organizationId}/users/{UserId}/consents/{ConsentId}/purposes/{PurposeId}/attributes/{attrId}', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://api.igrant.io/v1/organizations/{organizationId}/users/{UserId}/consents/{ConsentId}/purposes/{PurposeId}/attributes/{attrId}");
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{"API_KEY"},

    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("PATCH", "https://api.igrant.io/v1/organizations/{organizationId}/users/{UserId}/consents/{ConsentId}/purposes/{PurposeId}/attributes/{attrId}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

PATCH /organizations/{organizationId}/users/{UserId}/consents/{ConsentId}/purposes/{PurposeId}/attributes/{attrId}

Updates "Consented" status in a given purpose (Allow/DisAllow) OR "Days", i.e. "{ "days": 40}

Body parameter

{
  "Consented": "string",
  "Days": 0
}

Parameters

Name In Type Required Description
organizationId path string true ID of the organization
UserId path string true ID of the user
ConsentId path string true ID of the consent
PurposeId path string true ID of the purpose
attrId path string true ID of attribute (consentId)
body body ConsentedDays true none

Example responses

200 Response

{
  "Msg": "Consent updated successfully",
  "Status": 200
}

Responses

Status Meaning Description Schema
200 OK Successful response Inline
500 Internal Server Error Failed response None

Response Schema

Status Code 200

Name Type Required Restrictions Description
» Msg string false none Response message
» Status integer false none Status Code

Delete a purpose

Code samples

# You can also use wget
curl -X DELETE https://api.igrant.io/v1/organizations/{organizationId}/purposes/{purposeID} \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer API_KEY'

DELETE https://api.igrant.io/v1/organizations/{organizationId}/purposes/{purposeID} HTTP/1.1
Host: api.igrant.io
Accept: application/json

var headers = {
  'Accept':'application/json',
  'Authorization':'API_KEY'

};

$.ajax({
  url: 'https://api.igrant.io/v1/organizations/{organizationId}/purposes/{purposeID}',
  method: 'delete',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'Authorization':'API_KEY'

};

fetch('https://api.igrant.io/v1/organizations/{organizationId}/purposes/{purposeID}',
{
  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' => 'API_KEY'
}

result = RestClient.delete 'https://api.igrant.io/v1/organizations/{organizationId}/purposes/{purposeID}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'API_KEY'
}

r = requests.delete('https://api.igrant.io/v1/organizations/{organizationId}/purposes/{purposeID}', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://api.igrant.io/v1/organizations/{organizationId}/purposes/{purposeID}");
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{"API_KEY"},

    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("DELETE", "https://api.igrant.io/v1/organizations/{organizationId}/purposes/{purposeID}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

DELETE /organizations/{organizationId}/purposes/{purposeID}

Deletes a purpose from an organization based on IDs

Parameters

Name In Type Required Description
organizationId path string true ID of the organization from which a purpose shall be deleted
purposeID path string true ID of the purpose that shall be deleted

Example responses

201 Response

{
  "Organization": {
    "ID": "string",
    "Name": "string",
    "CoverImageID": "string",
    "CoverImageurl": "string",
    "LogoImageID": "string",
    "LogoImageURL": "string",
    "Location": "string",
    "Type": {
      "ID": "5bba67ba98135900010927a5",
      "Type": "Retail",
      "ImageID": "5bba67e798135900010927a7",
      "ImageURL": "https://api.igrant.io/v1/organizations/types/5bba67ba98135900010927a5/image"
    },
    "Description": "string",
    "Enabled": true,
    "Policyurl": "string",
    "EulaURL": "string",
    "Template": [
      {
        "ID": "5bba6a9998135900010927ba",
        "Consent": "Spouse",
        "PurposeIDs": [
          "5bba69db98135900010927ac, 8bba69db98135900010927af"
        ]
      }
    ],
    "Purposes": [
      {
        "ID": "string",
        "Description": "string",
        "LawfulUsage": true,
        "PolicyURL": "string"
      }
    ],
    "Admins": [
      {
        "userID": "string",
        "roleID": 0
      }
    ],
    "BillingInfo": {
      "BillingRegistrationID": "string",
      "PlanType": "string"
    }
  }
}

Responses

Status Meaning Description Schema
201 Created success, returns the organization details OrganizationObject

Set attributes in a purpose

Code samples

# You can also use wget
curl -X POST https://api.igrant.io/v1/organizations/{organizationId}/purposes/{PurposeId}/attributes/consent \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer API_KEY'

POST https://api.igrant.io/v1/organizations/{organizationId}/purposes/{PurposeId}/attributes/consent HTTP/1.1
Host: api.igrant.io
Content-Type: application/json

var headers = {
  'Content-Type':'application/json',
  'Authorization':'API_KEY'

};

$.ajax({
  url: 'https://api.igrant.io/v1/organizations/{organizationId}/purposes/{PurposeId}/attributes/consent',
  method: 'post',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');
const inputBody = '{
  "attributeIDs": [
    "string"
  ]
}';
const headers = {
  'Content-Type':'application/json',
  'Authorization':'API_KEY'

};

fetch('https://api.igrant.io/v1/organizations/{organizationId}/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' => 'API_KEY'
}

result = RestClient.post 'https://api.igrant.io/v1/organizations/{organizationId}/purposes/{PurposeId}/attributes/consent',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'API_KEY'
}

r = requests.post('https://api.igrant.io/v1/organizations/{organizationId}/purposes/{PurposeId}/attributes/consent', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://api.igrant.io/v1/organizations/{organizationId}/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{"API_KEY"},

    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("POST", "https://api.igrant.io/v1/organizations/{organizationId}/purposes/{PurposeId}/attributes/consent", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

POST /organizations/{organizationId}/purposes/{PurposeId}/attributes/consent

Notification request for attributes in a purpose

Body parameter

{
  "attributeIDs": [
    "string"
  ]
}

Parameters

Name In Type Required Description
organizationId path string true ID of the organization
PurposeId path string true ID of the user
body body object true none
attributeIDs body [string] false none

Responses

Status Meaning Description Schema
202 Accepted Accepted, successful response None

Get consented users

Code samples

# You can also use wget
curl -X GET https://api.igrant.io/v1/organizations/{organizationID}/purposes/{purposeID}/attributes/{attributeID}/consented/users \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer API_KEY'

GET https://api.igrant.io/v1/organizations/{organizationID}/purposes/{purposeID}/attributes/{attributeID}/consented/users HTTP/1.1
Host: api.igrant.io
Accept: application/json

var headers = {
  'Accept':'application/json',
  'Authorization':'API_KEY'

};

$.ajax({
  url: 'https://api.igrant.io/v1/organizations/{organizationID}/purposes/{purposeID}/attributes/{attributeID}/consented/users',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'Authorization':'API_KEY'

};

fetch('https://api.igrant.io/v1/organizations/{organizationID}/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' => 'API_KEY'
}

result = RestClient.get 'https://api.igrant.io/v1/organizations/{organizationID}/purposes/{purposeID}/attributes/{attributeID}/consented/users',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'API_KEY'
}

r = requests.get('https://api.igrant.io/v1/organizations/{organizationID}/purposes/{purposeID}/attributes/{attributeID}/consented/users', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://api.igrant.io/v1/organizations/{organizationID}/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{"API_KEY"},

    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://api.igrant.io/v1/organizations/{organizationID}/purposes/{purposeID}/attributes/{attributeID}/consented/users", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /organizations/{organizationID}/purposes/{purposeID}/attributes/{attributeID}/consented/users

Retrieves the users consented for a given attribute and a given purpose

Parameters

Name In Type Required Description
organizationID path string true ID of the organization
purposeID path string true ID of the purpose
attributeID path string true ID of the attribute

Example responses

200 Response

[
  {
    "User": {
      "ID": "5b9025defef8d50001ebb6f2",
      "Name": "Test production",
      "IamID": "7c7591e507",
      "Email": "p@p.io",
      "Phone": "+358 549 45043",
      "ImageID": "423049",
      "ImageURL": "imageurl.fi",
      "LastVisit": "2018-09-05 18:55:21",
      "Client": {
        "Token": 34234234,
        "Type": 0
      },
      "Orgs": [
        {
          "OrgID": "5b4ab3f926eddc0001ad3885",
          "Name": "iGrant.io",
          "Location": "Stockholm, Sweden",
          "Type": "RegTech",
          "TypeID\"": "b4ab3bf26eddc0001ad3883"
        }
      ]
    }
  }
]

Responses

Status Meaning Description Schema
200 OK Success, list of users consented to the attribute for the given purpose consentedUserResp
500 Internal Server Error Request failed None

Delete a template

Code samples

# You can also use wget
curl -X DELETE https://api.igrant.io/v1/organizations/{organizationId}/templates/{templateID} \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer API_KEY'

DELETE https://api.igrant.io/v1/organizations/{organizationId}/templates/{templateID} HTTP/1.1
Host: api.igrant.io
Accept: application/json

var headers = {
  'Accept':'application/json',
  'Authorization':'API_KEY'

};

$.ajax({
  url: 'https://api.igrant.io/v1/organizations/{organizationId}/templates/{templateID}',
  method: 'delete',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'Authorization':'API_KEY'

};

fetch('https://api.igrant.io/v1/organizations/{organizationId}/templates/{templateID}',
{
  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' => 'API_KEY'
}

result = RestClient.delete 'https://api.igrant.io/v1/organizations/{organizationId}/templates/{templateID}',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'API_KEY'
}

r = requests.delete('https://api.igrant.io/v1/organizations/{organizationId}/templates/{templateID}', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://api.igrant.io/v1/organizations/{organizationId}/templates/{templateID}");
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{"API_KEY"},

    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("DELETE", "https://api.igrant.io/v1/organizations/{organizationId}/templates/{templateID}", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

DELETE /organizations/{organizationId}/templates/{templateID}

Deletes a template from an organization based on IDs

Parameters

Name In Type Required Description
organizationId path string true ID of the organization from which a template shall be deleted
templateID path string true ID of the template that shall be deleted

Example responses

201 Response

{
  "Organization": {
    "ID": "string",
    "Name": "string",
    "CoverImageID": "string",
    "CoverImageurl": "string",
    "LogoImageID": "string",
    "LogoImageURL": "string",
    "Location": "string",
    "Type": {
      "ID": "5bba67ba98135900010927a5",
      "Type": "Retail",
      "ImageID": "5bba67e798135900010927a7",
      "ImageURL": "https://api.igrant.io/v1/organizations/types/5bba67ba98135900010927a5/image"
    },
    "Description": "string",
    "Enabled": true,
    "Policyurl": "string",
    "EulaURL": "string",
    "Template": [
      {
        "ID": "5bba6a9998135900010927ba",
        "Consent": "Spouse",
        "PurposeIDs": [
          "5bba69db98135900010927ac, 8bba69db98135900010927af"
        ]
      }
    ],
    "Purposes": [
      {
        "ID": "string",
        "Description": "string",
        "LawfulUsage": true,
        "PolicyURL": "string"
      }
    ],
    "Admins": [
      {
        "userID": "string",
        "roleID": 0
      }
    ],
    "BillingInfo": {
      "BillingRegistrationID": "string",
      "PlanType": "string"
    }
  }
}

Responses

Status Meaning Description Schema
201 Created success, returns the organization details OrganizationObject

Get consents for users

Code samples

# You can also use wget
curl -X GET https://api.igrant.io/v1/user/organizations/{organizationId}/consents \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer API_KEY'

GET https://api.igrant.io/v1/user/organizations/{organizationId}/consents HTTP/1.1
Host: api.igrant.io
Accept: application/json

var headers = {
  'Accept':'application/json',
  'Authorization':'API_KEY'

};

$.ajax({
  url: 'https://api.igrant.io/v1/user/organizations/{organizationId}/consents',
  method: 'get',

  headers: headers,
  success: function(data) {
    console.log(JSON.stringify(data));
  }
})

const fetch = require('node-fetch');

const headers = {
  'Accept':'application/json',
  'Authorization':'API_KEY'

};

fetch('https://api.igrant.io/v1/user/organizations/{organizationId}/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' => 'API_KEY'
}

result = RestClient.get 'https://api.igrant.io/v1/user/organizations/{organizationId}/consents',
  params: {
  }, headers: headers

p JSON.parse(result)

import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'API_KEY'
}

r = requests.get('https://api.igrant.io/v1/user/organizations/{organizationId}/consents', params={

}, headers = headers)

print r.json()

URL obj = new URL("https://api.igrant.io/v1/user/organizations/{organizationId}/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{"API_KEY"},

    }

    data := bytes.NewBuffer([]byte{jsonReq})
    req, err := http.NewRequest("GET", "https://api.igrant.io/v1/user/organizations/{organizationId}/consents", data)
    req.Header = headers

    client := &http.Client{}
    resp, err := client.Do(req)
    // ...
}

GET /user/organizations/{organizationId}/consents

Get the consents for users for a given organization

Parameters

Name In Type Required Description
organizationId path string true ID of the organization

Example responses

200 Response

{
  "ID": "5bba6a9998135900010927bb",
  "OrgID": "5bba686e98135900010927a8",
  "UserID": "5bc786ea90e2a00001de6de1",
  "ConsentsAndPurposes": [
    {
      "Purpose": {
        "ID": "5bba69db98135900010927ac",
        "Description": "Contractual Purpose",
        "LawfulUsage": "False",
        "PolicyUrl": "https://www.ica.se/policies/behandling-av-personuppgifter/"
      },
      "Count": {
        "Total": "2",
        "Consented": "2"
      },
      "Consents": [
        {
          "ID": "5bba6a9998135900010927bb",
          "Description": "No. of kids",
          "Value": "",
          "Status": {
            "Consented": "Allow",
            "TimeStamp": "0001-01-01T00:00:00Z",
            "Days": 0,
            "Remaining": 0
          }
        }
      ]
    }
  ]
}

Responses

Status Meaning Description Schema
200 OK Successful response Consent
500 Internal Server Error Failed to fetch organization ID, organization ID not found None

Schemas

Consent

{
  "ID": "5bba6a9998135900010927bb",
  "OrgID": "5bba686e98135900010927a8",
  "UserID": "5bc786ea90e2a00001de6de1",
  "ConsentsAndPurposes": [
    {
      "Purpose": {
        "ID": "5bba69db98135900010927ac",
        "Description": "Contractual Purpose",
        "LawfulUsage": "False",
        "PolicyUrl": "https://www.ica.se/policies/behandling-av-personuppgifter/"
      },
      "Count": {
        "Total": "2",
        "Consented": "2"
      },
      "Consents": [
        {
          "ID": "5bba6a9998135900010927bb",
          "Description": "No. of kids",
          "Value": "",
          "Status": {
            "Consented": "Allow",
            "TimeStamp": "0001-01-01T00:00:00Z",
            "Days": 0,
            "Remaining": 0
          }
        }
      ]
    }
  ]
}

Properties

Name Type Required Restrictions Description
ID string false none ID of the consent
OrgID string false none Organization ID
UserID string false none ID of the user
ConsentsAndPurposes [object] false none none
Purpose object false none none
ID 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 Total amount of purposes
Consented integer false none Total consented
Consents object false none none
ID string false none Consent ID
Description string false none Description of consent
Value string false none Value of consent
Status Status false none none

StatusConsented

{
  "Consented": "string"
}

Properties

Name Type Required Restrictions Description
Consented string false none Status of the consent for a given purpose

ConsentedDays

{
  "Consented": "string",
  "Days": 0
}

Properties

Name Type Required Restrictions Description
Consented string false none Status of the consent for a given purpose
Days integer false none Amount of days consented

PurposeDetail

{
  "ID": "string",
  "ConsentID": "string",
  "OrgID": "string",
  "UserID": "string",
  "Consents": {
    "Purpose": {
      "ID": "string",
      "Description": "string",
      "LawfulUsage": true,
      "PolicyURL": "string"
    },
    "Count": {
      "Total": 2,
      "Consented": 2
    },
    "Consents": [
      {
        "ID": "string",
        "Description": "string",
        "Value": "string",
        "Status": {
          "Consented": "string",
          "TimeStamp": "string",
          "Days": 0,
          "Remaining": 0
        }
      }
    ]
  }
}

Properties

Name Type Required Restrictions Description
ID string false none ID of purpose
ConsentID string false none ID of consent
OrgID string false none Organization ID
UserID string false none ID of user
Consents object false none none
Purpose Purpose false none none
Count Count false none none
Consents [Consents] false none none

Consents

{
  "ID": "string",
  "Description": "string",
  "Value": "string",
  "Status": {
    "Consented": "string",
    "TimeStamp": "string",
    "Days": 0,
    "Remaining": 0
  }
}

Properties

Name Type Required Restrictions Description
ID string false none Consent ID
Description string false none description
Value string false none Consent value
Status Status false none none

Status

{
  "Consented": "string",
  "TimeStamp": "string",
  "Days": 0,
  "Remaining": 0
}

Properties

Name Type Required Restrictions Description
Consented string false none Allow/DisAllow
TimeStamp string false none Timestamp
Days integer false none Amount of days to consent
Remaining integer false none Amount of days remaining

Count

{
  "Total": 2,
  "Consented": 2
}

Properties

Name Type Required Restrictions Description
Total integer false none Total amount of purposes
Consented integer false none Total consented

CreateOrganization

{
  "Name": "string",
  "Location": "string",
  "Description": "string",
  "TypeID": "string"
}

Properties

Name Type Required Restrictions Description
Name string true none Name of the organization
Location string true none Location of the organization
Description string true none Description of the organization
TypeID string true none ID of the type of organization

ConsentTemplate

{
  "ID": "5bba6a9998135900010927ba",
  "Consent": "Spouse",
  "PurposeIDs": [
    "5bba69db98135900010927ac, 8bba69db98135900010927af"
  ]
}

Properties

Name Type Required Restrictions Description
ID string false none ID of the consent
Consent string false none Consent, e.g. Spouse
PurposeIDs [string] false none An array of PurposeIDs

Type

{
  "ID": "5bba67ba98135900010927a5",
  "Type": "Retail",
  "ImageID": "5bba67e798135900010927a7",
  "ImageURL": "https://api.igrant.io/v1/organizations/types/5bba67ba98135900010927a5/image"
}

Properties

Name Type Required Restrictions Description
ID string false none ID of Type
Type string false none Describes the type of organization (field, ID of field etc.)
ImageID string false none ID of image
ImageURL string false none URL of image (where the Image is located)

Purpose

{
  "ID": "string",
  "Description": "string",
  "LawfulUsage": true,
  "PolicyURL": "string"
}

Properties

Name Type Required Restrictions Description
ID string false none ID of purpose
Description string false none Description of purpose
LawfulUsage boolean false none Lawful usage (True or False)
PolicyURL string false none URL of policy

ClientData

{
  "Token": "string",
  "Type": 0
}

Properties

Name Type Required Restrictions Description
Token string false none Client token
Type integer false none Type of client

Orgs

{
  "OrgID": "string",
  "Name": "string",
  "Location": "string",
  "Type": "string",
  "TypeID": "string"
}

Properties

Name Type Required Restrictions Description
OrgID string false none This is the ID of the organization
Name string false none Name of organization
Location string false none Location of the organization
Type string false none Field of organization like retail, medical etc
TypeID string false none Type ID

SubscribeUserCount

{
  "SubscribeUserCount": 7
}

The number of users subscribed

Properties

Name Type Required Restrictions Description
anonymous integer false none The number of users subscribed

User

{
  "User": {
    "ID": "5b9025defef8d50001ebb6f2",
    "Name": "Test production",
    "IamID": "7c7591e507",
    "Email": "p@p.io",
    "Phone": "+358 549 45043",
    "ImageID": "423049",
    "ImageURL": "imageurl.fi",
    "LastVisit": "2018-09-05 18:55:21",
    "Client": {
      "Token": 34234234,
      "Type": 0
    },
    "Orgs": [
      {
        "OrgID": "5b4ab3f926eddc0001ad3885",
        "Name": "iGrant.io",
        "Location": "Stockholm, Sweden",
        "Type": "RegTech",
        "TypeID\"": "b4ab3bf26eddc0001ad3883"
      }
    ]
  }
}

Properties

Name Type Required Restrictions Description
ID string false none The ID of the user
Name string false none The name of the user
IamID string false none Identity management ID
Email string false none User email address
Phone string false none User phone number
ImageID string false none User image ID
ImageURL string false none URL of user image
LastVisit string(date) false none Date and time of LastVisit
Client ClientData false none none
Orgs [Orgs] false none none

Organization

{
  "ID": "string",
  "Name": "string",
  "CoverImageID": "string",
  "CoverImageurl": "string",
  "LogoImageID": "string",
  "LogoImageURL": "string",
  "Location": "string",
  "Type": {
    "ID": "5bba67ba98135900010927a5",
    "Type": "Retail",
    "ImageID": "5bba67e798135900010927a7",
    "ImageURL": "https://api.igrant.io/v1/organizations/types/5bba67ba98135900010927a5/image"
  },
  "Description": "string",
  "Enabled": true,
  "Policyurl": "string",
  "EulaURL": "string",
  "Template": [
    {
      "ID": "5bba6a9998135900010927ba",
      "Consent": "Spouse",
      "PurposeIDs": [
        "5bba69db98135900010927ac, 8bba69db98135900010927af"
      ]
    }
  ],
  "Purposes": [
    {
      "ID": "string",
      "Description": "string",
      "LawfulUsage": true,
      "PolicyURL": "string"
    }
  ],
  "Admins": [
    {
      "userID": "string",
      "roleID": 0
    }
  ],
  "BillingInfo": {
    "BillingRegistrationID": "string",
    "PlanType": "string"
  }
}

Properties

Name Type Required Restrictions Description
ID string false none ID of the organization
Name string false none Name of the organization
CoverImageID string false none This is the ID of the coverImage
CoverImageurl string false none URL of the coverImage
LogoImageID string false none ID of the logo Image
LogoImageURL string false none URL of the logoImage
Location string false none Location of the organization (Country, City)
Type Type false none none
Description string false none The description of the organization
Enabled boolean false none Boolean value for indicating if the organization is enabled in the system
Policyurl string false none URL of company policy
EulaURL string false none EulaURL
Template [ConsentTemplate] false none Contains properties of a consent
Purposes [Purpose] false none contains information about purposes
Admins [userDataAdmin] false none represents the admins of the organization
BillingInfo BillingInfo false none none

BillingInfo

{
  "BillingRegistrationID": "string",
  "PlanType": "string"
}

Properties

Name Type Required Restrictions Description
BillingRegistrationID string false none ID of billing registration
PlanType string false none Type of plan

OrganizationObject

{
  "Organization": {
    "ID": "string",
    "Name": "string",
    "CoverImageID": "string",
    "CoverImageurl": "string",
    "LogoImageID": "string",
    "LogoImageURL": "string",
    "Location": "string",
    "Type": {
      "ID": "5bba67ba98135900010927a5",
      "Type": "Retail",
      "ImageID": "5bba67e798135900010927a7",
      "ImageURL": "https://api.igrant.io/v1/organizations/types/5bba67ba98135900010927a5/image"
    },
    "Description": "string",
    "Enabled": true,
    "Policyurl": "string",
    "EulaURL": "string",
    "Template": [
      {
        "ID": "5bba6a9998135900010927ba",
        "Consent": "Spouse",
        "PurposeIDs": [
          "5bba69db98135900010927ac, 8bba69db98135900010927af"
        ]
      }
    ],
    "Purposes": [
      {
        "ID": "string",
        "Description": "string",
        "LawfulUsage": true,
        "PolicyURL": "string"
      }
    ],
    "Admins": [
      {
        "userID": "string",
        "roleID": 0
      }
    ],
    "BillingInfo": {
      "BillingRegistrationID": "string",
      "PlanType": "string"
    }
  }
}

Properties

Name Type Required Restrictions Description
Organization Organization false none none

Roles

{
  "ID": 1,
  "Role": "Admin"
}

Properties

Name Type Required Restrictions Description
ID integer false none Unique ID of the roles
Role string false none Name of the role

userDataAdmin

{
  "userID": "string",
  "roleID": 0
}

Properties

Name Type Required Restrictions Description
userID string false none ID of user
roleID integer false none ID of role

Organizations

{
  "Organizations": [
    {
      "ID": "OrgID",
      "Name": "TestOrg",
      "CoverImageID": "ID",
      "CoverImageurl": "url",
      "LogoImageID": "ID",
      "LogoImageURL": "url",
      "Location": "Turku",
      "Type": {
        "ID": "ID",
        "Type": "Retail",
        "ImageID": "imageID",
        "ImageURL": "url"
      },
      "Description": "Testorg stores and processes the following data of yours. For each of your personal data attributes, you can view what is used as contractual basis in order for us to carry out a business relation with you. You can view the current status for all your personal data attributes, the purpose in which they are used and provide you the choice to opt-in or opt-out. \\n\\nYes, We are GDPR compliant.",
      "Enabled": true,
      "Policyurl": "URL",
      "EulaURL": "EulaURL",
      "Templates": [
        {
          "ID": "TemplateID",
          "Consent": "Spouse",
          "PurposeIDs": [
            "IDs.."
          ]
        }
      ],
      "Purposes": [
        {
          "ID": "PurposeID",
          "Description": "Contractual purpose",
          "LawfulUsage": false,
          "PolicyURL": "URL"
        }
      ],
      "Admins": [
        {
          "UserID": "UserID",
          "RoleID": 1
        }
      ],
      "BillingInfo": {
        "BillingRegistrationID": "",
        "PlanType": ""
      }
    }
  ]
}

Properties

Name Type Required Restrictions Description
anonymous [Organization] false none none

consentedUserResp

[
  {
    "User": {
      "ID": "5b9025defef8d50001ebb6f2",
      "Name": "Test production",
      "IamID": "7c7591e507",
      "Email": "p@p.io",
      "Phone": "+358 549 45043",
      "ImageID": "423049",
      "ImageURL": "imageurl.fi",
      "LastVisit": "2018-09-05 18:55:21",
      "Client": {
        "Token": 34234234,
        "Type": 0
      },
      "Orgs": [
        {
          "OrgID": "5b4ab3f926eddc0001ad3885",
          "Name": "iGrant.io",
          "Location": "Stockholm, Sweden",
          "Type": "RegTech",
          "TypeID\"": "b4ab3bf26eddc0001ad3883"
        }
      ]
    }
  }
]

Properties

Name Type Required Restrictions Description
anonymous [User] false none none
ID string false none ID of the user
Name string false none Name of the user
Phone string false none User phone number

SubscribeToken

{
  "SubscribeToken": "string",
  "SubscribeMethod": "string"
}

Properties

Name Type Required Restrictions Description
SubscribeToken string false none Client token
SubscribeMethod string false none Type of client