Overview Client API

Interface Style Choice

All examples below and in most of the rest of this guide will make use of the callback-based interface. For your convenience, we also provide a Promise-based interface.
Any call that has a callback parameter also returns a Promise. If you only want to make use of promises, the callback function parameter can be omitted.

Core Services

1
interface AbstractCore{
2
// async
3
info(callback:(error:CoreExceptions.RestException, data:any) => void):void;
4
infoBrowser(callback:(error:CoreExceptions.RestException, data:any) => void):void;
5
readers(callback:(error:CoreExceptions.RestException,data:any)=>void):void;
6
pollReaders(secondsToPollReader:number,
7
callback:(error:CoreExceptions.RestException,data:any)=>void,
8
connectReader:()=>void,
9
readerTimeout:()=>void
10
):void;
11
pollCardInserted(secondsToPollCard:number,
12
callback:(error:CoreExceptions.RestException,data:any)=>void,
13
connectReader:()=>void,
14
insertCard:()=>void,
15
cardTimeout:()=>void
16
17
):void;
18
readersCardAvailable(callback:(error:CoreExceptions.RestException,data:any)=>void):void;
19
readersCardsUnavailable(callback:(error:CoreExceptions.RestException,data:any)=>void):void;
20
reader(reader_id:string,callback:(error:CoreExceptions.RestException,data:any)=>void):void;
21
plugins(callback:(error:CoreExceptions.RestException,data:any)=>void):void;
22
getPubKey(callback:(error:CoreExceptions.RestException,data:any)=>void):void;
23
setPubKey(pubkey:any,callback:(error:CoreExceptions.RestException,data:any)=>void):void;
24
activate(callback:(error:CoreExceptions.RestException, data:any) => void):void;
25
26
// sync
27
getUrl():String;
28
infoBrowserSync():any;
29
30
// t1c-lib-info
31
version():String;
32
}
Copied!

Distribution Service Client

1
interface AbstractDSClient{
2
getUrl():String;
3
getInfo(callback:(error:CoreExceptions.RestException, data:any) => void):void;
4
getJWT(callback:(error:CoreExceptions.RestException, data:any) => void):void;
5
getDevice(uuid,callback:(error:CoreExceptions.RestException, data:any) => void):void;
6
refreshJWT(callback:(error:CoreExceptions.RestException, data:any) => void):void;
7
getPubKey(callback:(error:CoreExceptions.RestException, data:any) => void):void;
8
downloadLink(infoBrowser, callback:(error:CoreExceptions.RestException, data:any) => void):void;
9
register(info, device_id, callback:(error:CoreExceptions.RestException, data:any) => void):void;
10
sync(info, device_id, callback:(error:CoreExceptions.RestException, data:any) => void):void;
11
}
Copied!

Generic Interface

1
interface GenericService{
2
containerFor(readerId: string, callback?: (error: RestException, data: DataResponse) => void): Promise<DataResponse>
3
download(version?: string, callback?: (error: RestException, data: DownloadLinkResponse) => void): Promise<DownloadLinkResponse>
4
dumpData(readerId: string, data: OptionalPin, callback?: (error: RestException, data: DataResponse) => void): Promise<DataResponse>
5
readersCanAuthenticate(callback?: (error: RestException, data: CardReadersResponse) => void): Promise<CardReadersResponse>
6
authenticate(readerId: string, data: AuthenticateOrSignData, callback?: (error: RestException, data: DataResponse) => void): Promise<DataResponse>
7
readersCanSign(callback?: (error: RestException, data: CardReadersResponse) => void): Promise<CardReadersResponse>
8
sign(readerId: string, data: AuthenticateOrSignData, callback?: (error: RestException, data: DataResponse) => void): Promise<DataResponse>
9
readersCanVerifyPin(callback?: (error: RestException, data: CardReadersResponse) => void): Promise<CardReadersResponse>
10
verifyPin(readerId: string, data: OptionalPin, callback?: (error: RestException, data: DataResponse) => void): Promise<DataResponse>
11
}
Copied!