NAV Navbar
shell
  • Introduction
  • Authentication
  • Issues
  • Errors
  • Introduction

    Welcome to the Private Identity Control API! You can use our API to access all the issues that been created towards your organisation.

    We have language bindings in Shell and you can view code examples in the dark area to the right.

    Authentication

    To authorize, use this code:

    # With shell, you can just pass the correct header with each request
    curl "api_endpoint_here"
      -H "Token: imInC0ntrol"
    
    const kittn = require('kittn');
    
    let api = kittn.authorize('imInC0ntrol');
    

    Make sure to replace imInC0ntrol with your API key.

    Private Identity Control uses API keys and Basic Authentication to allow access to the API. You can register a new Private Identity Control API key at our company portal.

    Private Identity Control expects for the API key to be included in all API requests to the server in a header that looks like the following:

    Token: imInC0ntrol

    Authorization: Basic username:password

    Issues

    Get All Issues

    curl "https://www.privateidentitycontrol.com/api/public/issues"
      -H "Token: imInC0ntrol"
    
    var http = new XMLHttpRequest();
    var url = "https://www.privateidentitycontrol.com/api/public/issues";
    http.open("GET", url, true);
    
    //Send the proper header information along with the request
    http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
    http.setRequestHeader("Token", "imInC0ntrol");
    
    http.onreadystatechange = function() { //Call a function when the state changes.
        if(http.readyState == 4 && http.status == 200) {
            alert(http.responseText);
        }
    }
    http.send();
    

    The above command returns JSON structured like this:

    [
        {
            "customer": {
                "Id": "aadc7bf2-43bd-4c17-8362-33a48ae22486",
                "Name": "John Doe",
                "UserName": "john.doe@company.com"
            },
            "status": "Closed",
            "created": "2018-02-21T14:06:59.73",
            "responded": "2018-02-21T18:06:59.73",
            "messages": [
                {
                    "User": {
                        "Id": "aadc7bf2-43bd-4c17-8362-33a48ae22486",
                        "Name": "John Doe",
                        "UserName": "john.doe@company.com"
                    },
                    "Body": "Hey, i want to have all the information you guys have on me. Thanks in advance.",
                    "Created": "2018-02-21T14:06:59.73",
                    "Id": 3
                },
                {
                    "Company": {
                       "Name": "Bygg & Riv AB",
                       "OrganisationNumber": "32134 13211",
                       "Id": 1
                    },
                    "Body": "Hey, we have following. John Doe, Street 19c, 45674, Sweden. And your birthdate xxxx-xx-xx.",
                    "Created": "2018-02-21T14:06:59.73",
                    "Id": 4
                }
            ],
            "id": 3
        },
        ...
    ]
    

    This endpoint retrieves all issues.

    HTTP Request

    GET https://www.privateidentitycontrol.com/api/public/issues

    Query Parameters

    Parameter Default Description
    status open If set to "closed", the result will also include closed issues.
    datetime null If set the result will only return issues newer then the timestamp.
    include null If set you will retrieve the data you want to include, read more below.

    Include

    If you want to include more data, you can use the following parameters. Don't forget that the retuned object can easily get to big to handle.

    Parameter Description
    messages If set every issue will include all messages on the object.

    Get a Specific Issue

    curl "https://www.privateidentitycontrol.com/api/public/issues/2"
      -H "Token: imInC0ntrol"
    
    const kittn = require('kittn');
    
    let api = kittn.authorize('imInC0ntrol');
    let max = api.kittens.get(2);
    

    The above command returns JSON structured like this:

    {
        "customer": {
            "Id": "aadc7bf2-43bd-4c17-8362-33a48ae22486",
            "Name": "John Doe",
            "UserName": "john.doe@company.com"
        },
        "status": "Closed",
        "created": "2018-02-21T14:06:59.73",
        "responded": "2018-02-21T18:06:59.73",
        "messages": [
            {
                "User": {
                    "Id": "aadc7bf2-43bd-4c17-8362-33a48ae22486",
                    "Name": "John Doe",
                    "UserName": "john.doe@company.com"
                },
                "Body": "Hey, i want to have all the information you guys have on me. Thanks in advance.",
                "Created": "2018-02-21T14:06:59.73",
                "Id": 3
            },
            {
                "Company": {
                   "Name": "Bygg & Riv AB",
                   "OrganisationNumber": "32134 13211",
                   "Id": 1
                },
                "Body": "Hey, we have following. John Doe, Street 19c, 45674, Sweden. And your birthdate xxxx-xx-xx.",
                "Created": "2018-02-21T14:06:59.73",
                "Id": 4
            }
        ],
        "id": 2
    }
    

    This endpoint retrieves a specific issue.

    HTTP Request

    GET https://www.privateidentitycontrol.com/api/public/issues/<ID>

    URL Parameters

    Parameter Description
    ID The ID of the issue to retrieve

    Create a Answer To Issue

    curl "https://www.privateidentitycontrol.com/api/public/issues/2"
      -H "Token: imInC0ntrol"
      -D "body=Hey, we have following. John Doe, Street 19c, 45674, Sweden. And your birthdate xxxx-xx-xx&status=closed"
    
    var http = new XMLHttpRequest();
    var params = "body=Hey, we have following. John Doe, Street 19c, 45674, Sweden. And your birthdate xxxx-xx-xx&status=closed";
    var url = "https://www.privateidentitycontrol.com/api/public/issues/messages/2";
    http.open("PUT", url, true);
    
    //Send the proper header information along with the request
    http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
    http.setRequestHeader("Token", "imInC0ntrol");
    
    http.onreadystatechange = function() { //Call a function when the state changes.
        if(http.readyState == 4 && http.status == 200) {
            alert(http.responseText);
        }
    }
    http.send(params);
    

    The above command returns JSON structured like this:

    {
        "customer": {
            "Id": "aadc7bf2-43bd-4c17-8362-33a48ae22486",
            "Name": "John Doe",
            "UserName": "john.doe@company.com"
        },
        "status": "Closed",
        "created": "2018-02-21T14:06:59.73",
        "responded": "2018-02-21T18:06:59.73",
        "messages": [
            {
                "User": {
                    "Id": "aadc7bf2-43bd-4c17-8362-33a48ae22486",
                    "Name": "John Doe",
                    "UserName": "john.doe@company.com"
                },
                "Body": "Hey, i want to have all the information you guys have on me. Thanks in advance.",
                "Created": "2018-02-21T14:06:59.73",
                "Id": 3
            },
            {
                "Company": {
                   "Name": "Bygg & Riv AB",
                   "OrganisationNumber": "32134 13211",
                   "Id": 1
                },
                "Body": "Hey, we have following. John Doe, Street 19c, 45674, Sweden. And your birthdate xxxx-xx-xx.",
                "Created": "2018-02-21T14:06:59.73",
                "Id": 4
            }
        ],
        "id": 2
    }
    

    This endpoint creates a answer to specific issue.

    HTTP Request

    PUT https://www.privateidentitycontrol.com/api/public/issues/<ID>

    URL Parameters

    Parameter Description
    ID The ID of the issue to retrieve

    Body Parameters

    Parameter Type Description
    body string The message that you want to send.
    status string(open/closed) The status you want to set the issue to

    Get Messages From Issue

    curl "https://www.privateidentitycontrol.com/api/public/issues/messages/2"
      -H "Token: imInC0ntrol"
    
    var http = new XMLHttpRequest();
    var url = "https://www.privateidentitycontrol.com/api/public/issues/messages/2";
    http.open("GET", url, true);
    
    //Send the proper header information along with the request
    http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
    http.setRequestHeader("Token", "imInC0ntrol");
    
    http.onreadystatechange = function() { //Call a function when the state changes.
        if(http.readyState == 4 && http.status == 200) {
            alert(http.responseText);
        }
    }
    http.send();
    

    The above command returns JSON structured like this:

    [
        {
            "User": {
                "Id": "aadc7bf2-43bd-4c17-8362-33a48ae22486",
                "Name": "John Doe",
                "UserName": "john.doe@company.com"
            },
            "Body": "Hey, i want to have all the information you guys have on me. Thanks in advance.",
            "Created": "2018-02-21T14:06:59.73",
            "Id": 3
        },
        {
            "Company": {
               "Name": "Bygg & Riv AB",
               "OrganisationNumber": "32134 13211",
               "Id": 1
            },
            "Body": "Hey, we have following. John Doe, Street 19c, 45674, Sweden. And your birthdate xxxx-xx-xx.",
            "Created": "2018-02-21T14:06:59.73",
            "Id": 4
        }
    ]
    

    This endpoint returns all messages from issue.

    HTTP Request

    GET https://www.privateidentitycontrol.com/api/public/issues/messages/2<ID>

    URL Parameters

    Parameter Description
    ID The ID of the issue to retrieve messages from

    Errors

    The Private Identity Control API uses the following error codes:

    Error Code Meaning
    400 Bad Request -- Your request is invalid.
    401 Unauthorized -- Your API key is wrong.
    403 Forbidden -- The kitten requested is hidden for administrators only.
    404 Not Found -- The specified kitten could not be found.
    405 Method Not Allowed -- You tried to access a kitten with an invalid method.
    406 Not Acceptable -- You requested a format that isn't json.
    410 Gone -- The kitten requested has been removed from our servers.
    418 I'm a teapot.
    429 Too Many Requests -- You're requesting too many kittens! Slow down!
    500 Internal Server Error -- We had a problem with our server. Try again later.
    503 Service Unavailable -- We're temporarily offline for maintenance. Please try again later.