eBevis Staging
API change historyAPI for eBevis - staging/test environment
Authorizes and creates an accreditation
Takes a Authorize object populated with a subject and one or more evidence requests
Try itRequest
Request URL
Request headers
-
(optional)stringMedia type of the body sent to the API.
Request body
Authorization object
{
"requestor": 910514415,
"subject": 992037601,
"evidenceRequests": [
{
"evidenceCodeName": "someevidencecode",
"parameters": [
{
"evidenceParamName": "someboolparam",
"value": true
},
{
"evidenceParamName": "somenumericparam",
"value": 1234.1234
},
{
"evidenceParamName": "somedatetimeparam",
"value": "2018-01-01T00:00:00"
},
{
"evidenceParamName": "somestringparam",
"value": "somestring"
},
{
"evidenceParamName": "someattachmentparam",
"value": "==base64string"
}
],
"legalBasisId": "espd-01"
}
],
"legalBasisList": [
{
"id": "espd-01",
"type": "ESPD",
"content": "<?xml ..."
}
]
}
{
"type": "object",
"properties": {
"requestor": {
"description": "The party requesting the evidence",
"type": "string"
},
"subject": {
"description": "The party the evidence is requested for",
"type": "string"
},
"evidenceRequests": {
"description": "The list of evidence requested",
"type": "array",
"items": {
"type": "object",
"properties": {
"evidenceCodeName": {
"description": "The evidence code requested",
"type": "string"
},
"legalBasisId": {
"description": "If a legal basis is supplied, its identifier goes here",
"type": "string"
},
"legalBasisReference": {
"description": "If a legal basis is supplied, the reference within it may be supplied here if applicable",
"type": "string"
},
"requestConsent": {
"description": "Whether a request for non-open evidence not covered by legal basis should result in a consent request being initiated",
"type": "boolean"
},
"parameters": {
"description": "Supplied parameters",
"type": "array",
"items": {
"description": "A parameter for the evidence code",
"required": [
"evidenceParamName"
],
"type": "object",
"properties": {
"evidenceParamName": {
"description": "The name of the parameter",
"type": "string"
},
"paramType": {
"description": "The format of the evidence parameter",
"enum": [
"boolean",
"string",
"number",
"dateTime",
"attachment",
"uri"
]
},
"required": {
"description": "Whether or not the evidence parameter is required, if used in context of a evidence code description",
"type": "boolean"
},
"value": {
"description": "The value for the evidence parametre, if used in context of a evidence code request"
}
},
"example": "{\n \"evidenceParamName\": \"ParamNumber\",\n \"value\": 1234.1234\n}"
}
}
},
"example": "{\n \"evidenceCodeName\": \"someevidencecodetakingparams\",\n \"parameters\": [\n {\n \"evidenceParamName\": \"abooleanparam\",\n \"value\": true\n }\n ]\n}"
}
},
"legalBasisList": {
"description": "The list of legal basis for one or more of the evidence requested",
"type": "array",
"items": {
"required": [
"id",
"content",
"type"
],
"type": "object",
"properties": {
"id": {
"description": "Arbitrary identifier for the legal basis, used to reference this from evidence requests",
"type": "string"
},
"type": {
"description": "The type of legal basis, ie. ESPD",
"enum": [
"ESPD"
],
"type": "string"
},
"content": {
"description": "The content for the legal basis, ie. the ESPD XML",
"type": "string"
}
},
"example": "{\n \"id\": \"espd-01\",\n \"type\": \"ESPD\",\n \"content\": \"<?xml ...\"\n}"
}
},
"tedReference": {
"description": "TED reference number, if applicable (https://ted.europa.eu)",
"type": "string"
},
"doffinReference": {
"description": "Doffin referece number, if applicable (https://doffin.no)",
"type": "string"
},
"externalReference": {
"description": "Arbitrary reference which will be saved with the accreditation",
"type": "string"
},
"validTo": {
"format": "date-time",
"description": "How long the accreditation should be valid. Also used for duration of consent (date part only).",
"type": "string"
}
},
"example": "{\n \"requestor\": 910514415,\n \"subject\": 992037601,\n \"evidenceRequests\": [\n {\n \"evidenceCodeName\": \"someevidencecode\",\n \"parameters\": [\n {\n \"evidenceParamName\": \"someboolparam\",\n \"value\": true\n },\n {\n \"evidenceParamName\": \"somenumericparam\",\n \"value\": 1234.1234\n },\n {\n \"evidenceParamName\": \"somedatetimeparam\",\n \"value\": \"2018-01-01T00:00:00\"\n },\n {\n \"evidenceParamName\": \"somestringparam\",\n \"value\": \"somestring\"\n },\n {\n \"evidenceParamName\": \"someattachmentparam\",\n \"value\": \"==base64string\"\n }\n ],\n \"legalBasisId\": \"espd-01\"\n }\n ],\n \"legalBasisList\": [\n {\n \"id\": \"espd-01\",\n \"type\": \"ESPD\",\n \"content\": \"<?xml ...\"\n }\n ]\n}"
}
Responses
201 Created
Authorization successful, accreditation created.
Representations
{
"accreditationId": "some text",
"requestor": "some text",
"subject": "some text",
"evidenceCodes": [
{
"evidenceCodeName": "some text",
"description": "some text",
"accessMethod": "some text",
"hasValues": [
{
"evidenceValueName": "some text",
"valueType": {},
"mimeType": "some text",
"source": "some text",
"value": "some text",
"timestamp": "2018-02-10T09:30Z"
},
{
"evidenceValueName": "some text",
"valueType": {},
"mimeType": "some text",
"source": "some text",
"value": "some text",
"timestamp": "2018-02-10T09:30Z"
}
],
"parameters": [
{
"evidenceParamName": "some text",
"paramType": {},
"required": true,
"value": {}
},
{
"evidenceParamName": "some text",
"paramType": {},
"required": true,
"value": {}
}
],
"isAsynchronous": true
},
{
"evidenceCodeName": "some text",
"description": "some text",
"accessMethod": "some text",
"hasValues": [
{
"evidenceValueName": "some text",
"valueType": {},
"mimeType": "some text",
"source": "some text",
"value": "some text",
"timestamp": "2018-02-10T09:30Z"
},
{
"evidenceValueName": "some text",
"valueType": {},
"mimeType": "some text",
"source": "some text",
"value": "some text",
"timestamp": "2018-02-10T09:30Z"
}
],
"parameters": [
{
"evidenceParamName": "some text",
"paramType": {},
"required": true,
"value": {}
},
{
"evidenceParamName": "some text",
"paramType": {},
"required": true,
"value": {}
}
],
"isAsynchronous": true
}
],
"issued": "2018-02-10T09:30Z",
"validTo": "2018-02-10T09:30Z",
"tedReference": "some text",
"doffinReference": "some text",
"externalReference": "some text"
}
{
"title": "Accreditation",
"description": "The accreditation returned from a successful authorization",
"required": [
"id",
"issued",
"subject",
"validTo"
],
"type": "object",
"properties": {
"accreditationId": {
"description": "Identifier for the accreditation",
"type": "string"
},
"requestor": {
"description": "The party requesting the evidence",
"type": "string"
},
"subject": {
"description": "The party the evidence is requested for",
"type": "string"
},
"aggregateStatus": {
"title": "EvidenceStatusCode",
"description": "The aggregated evidence status code and description for all the evidence codes (only local checks)",
"required": [
"description",
"code"
],
"type": "object",
"properties": {
"description": {
"description": "Description of the status code",
"type": "string"
},
"code": {
"description": "The status code integer",
"type": "integer"
},
"retryAt": {
"format": "date-time",
"description": "For asynchronous data sources, might include a hint at which point another attempt should be made to see if the information requested is available",
"type": "string"
}
},
"example": "{\n \"code\": 0,\n \"description\": \"Awaiting consent from subject entity representative\",\n \"retryAt\": \"2019-01-20T13:40:32Z\"\n}"
},
"evidenceCodes": {
"description": "List of evidence codes associated with the accreditation.",
"type": "array",
"items": {
"title": "EvidenceCode",
"description": "Describing an EvidenceCode and what values it carries. When used in context of a accreditation, also includes the timespan of which the evidence is available",
"required": [
"accessMethod",
"evidenceCodeName",
"values",
"isAsynchronous"
],
"type": "object",
"properties": {
"evidenceCodeName": {
"description": "Name of the evidence code",
"type": "string"
},
"description": {
"description": "Arbitrary text describing the purpose and content of the evidence code",
"type": "string"
},
"accessMethod": {
"description": "How the evidence is accessed",
"enum": [
"open",
"consent",
"legalBasis",
"consentOrLegalBasis"
],
"type": "string"
},
"parameters": {
"description": "If the evidence code has any parameters",
"type": "array",
"items": {
"description": "A parameter for the evidence code",
"required": [
"evidenceParamName"
],
"type": "object",
"properties": {
"evidenceParamName": {
"description": "The name of the parameter",
"type": "string"
},
"paramType": {
"description": "The format of the evidence parameter",
"enum": [
"boolean",
"string",
"number",
"dateTime",
"attachment",
"uri"
]
},
"required": {
"description": "Whether or not the evidence parameter is required, if used in context of a evidence code description",
"type": "boolean"
},
"value": {
"description": "The value for the evidence parametre, if used in context of a evidence code request"
}
},
"example": "{\n \"evidenceParamName\": \"ParamNumber\",\n \"value\": 1234.1234\n}"
}
},
"isAsynchronous": {
"description": "Whether or not the evidence code has been flagged as representing data not available by simple lookup.",
"type": "boolean"
},
"maxValidDays": {
"description": "If set, specifies the maximum amount of days an accreditation referring this evidence code can be valid",
"type": "integer"
},
"values": {
"description": "The values associated with this evidence code",
"type": "array",
"items": {
"title": "EvidenceValue",
"description": "Describing the format and containing the value of an evidence",
"required": [
"evidenceValueName",
"valueType",
"source"
],
"type": "object",
"properties": {
"evidenceValueName": {
"description": "A name describing the evidence value",
"type": "string"
},
"valueType": {
"description": "The format over the evidence value",
"enum": [
"boolean",
"number",
"string",
"attachment",
"dateTime",
"uri",
"amount"
]
},
"mimeType": {
"description": "If valuetype is attachment, this contains the MIME type (ie. application/pdf)",
"type": "string"
},
"source": {
"description": "The source from which the evidence is harvested",
"type": "string"
},
"value": {
"description": "The value for the evidence, if used in context of an Evidence",
"type": "string"
},
"timestamp": {
"format": "date-time",
"description": "The time of which the evidence was collected from the source, if used in context of an Evidence",
"type": "string"
}
},
"example": "{\n \"evidenceValueName\": \"IndustryCode1\",\n \"source\": \"BRREG Enhetsregisteret\",\n \"timestamp\": \"2019-01-23T20:19:26.2450203Z\",\n \"value\": \"62.020\",\n \"valueType\": \"string\"\n}"
}
}
},
"example": "{\n \"evidenceCodeName\": \"ParamCodePoc\",\n \"description\": \"Simple code for testing parameter operations\",\n \"accessMethod\": \"open\",\n \"parameters\": [\n {\n \"evidenceParamName\": \"ParamBool\",\n \"paramType\": \"boolean\"\n },\n {\n \"evidenceParamName\": \"ParamNumber\",\n \"paramType\": \"number\",\n \"required\": true\n },\n {\n \"evidenceParamName\": \"ParamDateTime\",\n \"paramType\": \"dateTime\"\n },\n {\n \"evidenceParamName\": \"ParamString\",\n \"paramType\": \"string\"\n },\n {\n \"evidenceParamName\": \"ParamAttachment\",\n \"paramType\": \"attachment\"\n }\n ],\n \"values\": [\n {\n \"evidenceValueName\": \"EchoBool\",\n \"source\": \"Test Dept.\",\n \"valueType\": \"boolean\"\n },\n {\n \"evidenceValueName\": \"EchoNumber\",\n \"source\": \"Test Dept.\",\n \"valueType\": \"number\"\n },\n {\n \"evidenceValueName\": \"EchoDateTime\",\n \"source\": \"Test Dept.\",\n \"valueType\": \"dateTime\"\n },\n {\n \"evidenceValueName\": \"EchoString\",\n \"source\": \"Test Dept.\",\n \"valueType\": \"string\"\n },\n {\n \"evidenceValueName\": \"EchoAttachment\",\n \"source\": \"Test Dept.\",\n \"valueType\": \"attachment\"\n }\n ],\n \"isAsynchronous\": false\n}"
}
},
"issued": {
"format": "date-time",
"description": "When the accreditation was created",
"type": "string"
},
"lastChanged": {
"format": "date-time",
"description": "When the accreditation was last changed",
"type": "string"
},
"validTo": {
"format": "date-time",
"description": "How long the accreditation is valid",
"type": "string"
},
"tedReference": {
"description": "Ted reference",
"type": "string"
},
"doffinReference": {
"description": "Doffin reference",
"type": "string"
},
"externalReference": {
"description": "Arbitrary reference provided in the authorization call",
"type": "string"
}
},
"example": "{\n \"id\": \"c0c0cc70-8401-4317-a311-6b5fde98451f\",\n \"requestor\": \"910514415\",\n \"subject\": \"910402021\",\n \"evidenceCodes\": [\n {\n \"evidenceCodeName\": \"someevidencecodename\",\n \"description\": \"Description of the evidence code name\",\n \"accessMethod\": \"open\",\n \"parameters\": [],\n \"values\": [\n {\n \"evidenceValueName\": \"somenumbervalue\",\n \"source\": \"name of the source the value originates from\",\n \"valueType\": \"number\"\n },\n {\n \"evidenceValueName\": \"somestringyvalue\",\n \"source\": \"name of the source the value originates from\",\n \"valueType\": \"string\"\n }\n ],\n \"isAsynchronous\": false\n }\n ],\n \"issued\": \"2019-01-18T23:57:05.1583841+01:00\",\n \"validTo\": \"2019-04-18T23:57:05.1583841+02:00\"\n}"
}
400 Bad Request
Request is malformed, or has logic errors. See error in body for more information.
Representations
{
"code": 1016,
"description": "The data for the requested evidence is not yet available"
}
{
"title": "Error",
"description": "Describing an error state",
"required": [
"code"
],
"type": "object",
"properties": {
"code": {
"description": "Error code",
"type": "integer"
},
"description": {
"description": "Error description",
"type": "string"
}
},
"example": "{\n \"code\": 1016,\n \"description\": \"The data for the requested evidence is not yet available\"\n}"
}
403 Forbidden
Authentication or authorization error.
Representations
{
"code": 1016,
"description": "The data for the requested evidence is not yet available"
}
{
"title": "Error",
"description": "Describing an error state",
"required": [
"code"
],
"type": "object",
"properties": {
"code": {
"description": "Error code",
"type": "integer"
},
"description": {
"description": "Error description",
"type": "string"
}
},
"example": "{\n \"code\": 1016,\n \"description\": \"The data for the requested evidence is not yet available\"\n}"
}
500 Internal Server Error
An unexpected error occured. The returned error model might contain more information.
Representations
{
"code": 1016,
"description": "The data for the requested evidence is not yet available"
}
{
"title": "Error",
"description": "Describing an error state",
"required": [
"code"
],
"type": "object",
"properties": {
"code": {
"description": "Error code",
"type": "integer"
},
"description": {
"description": "Error description",
"type": "string"
}
},
"example": "{\n \"code\": 1016,\n \"description\": \"The data for the requested evidence is not yet available\"\n}"
}
503 Service Unavailable
A backend service was not available. Please try again later.
Representations
{
"code": 1016,
"description": "The data for the requested evidence is not yet available"
}
{
"title": "Error",
"description": "Describing an error state",
"required": [
"code"
],
"type": "object",
"properties": {
"code": {
"description": "Error code",
"type": "integer"
},
"description": {
"description": "Error description",
"type": "string"
}
},
"example": "{\n \"code\": 1016,\n \"description\": \"The data for the requested evidence is not yet available\"\n}"
}
Code samples
@ECHO OFF
curl -v -X POST "https://api.ebevis.no/nadobe-staging/v1/authorization"
-H "Content-Type: application/json"
-H "Ocp-Apim-Subscription-Key: {subscription key}"
--data-ascii "{body}"
using System;
using System.Net.Http.Headers;
using System.Text;
using System.Net.Http;
using System.Web;
namespace CSHttpClientSample
{
static class Program
{
static void Main()
{
MakeRequest();
Console.WriteLine("Hit ENTER to exit...");
Console.ReadLine();
}
static async void MakeRequest()
{
var client = new HttpClient();
var queryString = HttpUtility.ParseQueryString(string.Empty);
// Request headers
client.DefaultRequestHeaders.Add("Ocp-Apim-Subscription-Key", "{subscription key}");
var uri = "https://api.ebevis.no/nadobe-staging/v1/authorization?" + queryString;
HttpResponseMessage response;
// Request body
byte[] byteData = Encoding.UTF8.GetBytes("{body}");
using (var content = new ByteArrayContent(byteData))
{
content.Headers.ContentType = new MediaTypeHeaderValue("< your content type, i.e. application/json >");
response = await client.PostAsync(uri, content);
}
}
}
}
// // This sample uses the Apache HTTP client from HTTP Components (http://hc.apache.org/httpcomponents-client-ga/)
import java.net.URI;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.utils.URIBuilder;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;
public class JavaSample
{
public static void main(String[] args)
{
HttpClient httpclient = HttpClients.createDefault();
try
{
URIBuilder builder = new URIBuilder("https://api.ebevis.no/nadobe-staging/v1/authorization");
URI uri = builder.build();
HttpPost request = new HttpPost(uri);
request.setHeader("Content-Type", "application/json");
request.setHeader("Ocp-Apim-Subscription-Key", "{subscription key}");
// Request body
StringEntity reqEntity = new StringEntity("{body}");
request.setEntity(reqEntity);
HttpResponse response = httpclient.execute(request);
HttpEntity entity = response.getEntity();
if (entity != null)
{
System.out.println(EntityUtils.toString(entity));
}
}
catch (Exception e)
{
System.out.println(e.getMessage());
}
}
}
<!DOCTYPE html>
<html>
<head>
<title>JSSample</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
</head>
<body>
<script type="text/javascript">
$(function() {
var params = {
// Request parameters
};
$.ajax({
url: "https://api.ebevis.no/nadobe-staging/v1/authorization?" + $.param(params),
beforeSend: function(xhrObj){
// Request headers
xhrObj.setRequestHeader("Content-Type","application/json");
xhrObj.setRequestHeader("Ocp-Apim-Subscription-Key","{subscription key}");
},
type: "POST",
// Request body
data: "{body}",
})
.done(function(data) {
alert("success");
})
.fail(function() {
alert("error");
});
});
</script>
</body>
</html>
#import <Foundation/Foundation.h>
int main(int argc, const char * argv[])
{
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
NSString* path = @"https://api.ebevis.no/nadobe-staging/v1/authorization";
NSArray* array = @[
// Request parameters
@"entities=true",
];
NSString* string = [array componentsJoinedByString:@"&"];
path = [path stringByAppendingFormat:@"?%@", string];
NSLog(@"%@", path);
NSMutableURLRequest* _request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:path]];
[_request setHTTPMethod:@"POST"];
// Request headers
[_request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
[_request setValue:@"{subscription key}" forHTTPHeaderField:@"Ocp-Apim-Subscription-Key"];
// Request body
[_request setHTTPBody:[@"{body}" dataUsingEncoding:NSUTF8StringEncoding]];
NSURLResponse *response = nil;
NSError *error = nil;
NSData* _connectionData = [NSURLConnection sendSynchronousRequest:_request returningResponse:&response error:&error];
if (nil != error)
{
NSLog(@"Error: %@", error);
}
else
{
NSError* error = nil;
NSMutableDictionary* json = nil;
NSString* dataString = [[NSString alloc] initWithData:_connectionData encoding:NSUTF8StringEncoding];
NSLog(@"%@", dataString);
if (nil != _connectionData)
{
json = [NSJSONSerialization JSONObjectWithData:_connectionData options:NSJSONReadingMutableContainers error:&error];
}
if (error || !json)
{
NSLog(@"Could not parse loaded json with error:%@", error);
}
NSLog(@"%@", json);
_connectionData = nil;
}
[pool drain];
return 0;
}
<?php
// This sample uses the Apache HTTP client from HTTP Components (http://hc.apache.org/httpcomponents-client-ga/)
require_once 'HTTP/Request2.php';
$request = new Http_Request2('https://api.ebevis.no/nadobe-staging/v1/authorization');
$url = $request->getUrl();
$headers = array(
// Request headers
'Content-Type' => 'application/json',
'Ocp-Apim-Subscription-Key' => '{subscription key}',
);
$request->setHeader($headers);
$parameters = array(
// Request parameters
);
$url->setQueryVariables($parameters);
$request->setMethod(HTTP_Request2::METHOD_POST);
// Request body
$request->setBody("{body}");
try
{
$response = $request->send();
echo $response->getBody();
}
catch (HttpException $ex)
{
echo $ex;
}
?>
########### Python 2.7 #############
import httplib, urllib, base64
headers = {
# Request headers
'Content-Type': 'application/json',
'Ocp-Apim-Subscription-Key': '{subscription key}',
}
params = urllib.urlencode({
})
try:
conn = httplib.HTTPSConnection('api.ebevis.no')
conn.request("POST", "/nadobe-staging/v1/authorization?%s" % params, "{body}", headers)
response = conn.getresponse()
data = response.read()
print(data)
conn.close()
except Exception as e:
print("[Errno {0}] {1}".format(e.errno, e.strerror))
####################################
########### Python 3.2 #############
import http.client, urllib.request, urllib.parse, urllib.error, base64
headers = {
# Request headers
'Content-Type': 'application/json',
'Ocp-Apim-Subscription-Key': '{subscription key}',
}
params = urllib.parse.urlencode({
})
try:
conn = http.client.HTTPSConnection('api.ebevis.no')
conn.request("POST", "/nadobe-staging/v1/authorization?%s" % params, "{body}", headers)
response = conn.getresponse()
data = response.read()
print(data)
conn.close()
except Exception as e:
print("[Errno {0}] {1}".format(e.errno, e.strerror))
####################################
require 'net/http'
uri = URI('https://api.ebevis.no/nadobe-staging/v1/authorization')
request = Net::HTTP::Post.new(uri.request_uri)
# Request headers
request['Content-Type'] = 'application/json'
# Request headers
request['Ocp-Apim-Subscription-Key'] = '{subscription key}'
# Request body
request.body = "{body}"
response = Net::HTTP.start(uri.host, uri.port, :use_ssl => uri.scheme == 'https') do |http|
http.request(request)
end
puts response.body