# Overview Client API

### Interface Style Choice

All examples below and in 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 can have this callback function omitted and will then return a Promise instead.

## Core Services

```javascript
interface AbstractCore{
    // async
    info(callback:(error:CoreExceptions.RestException, data:any) => void):void;
    infoBrowser(callback:(error:CoreExceptions.RestException, data:any) => void):void;
    readers(callback:(error:CoreExceptions.RestException,data:any)=>void):void;
    pollReaders(secondsToPollReader:number,
                callback:(error:CoreExceptions.RestException,data:any)=>void,
                connectReader:()=>void,
                readerTimeout:()=>void
    ):void;
    pollCardInserted(secondsToPollCard:number,
                     callback:(error:CoreExceptions.RestException,data:any)=>void,
                     connectReader:()=>void,
                     insertCard:()=>void,
                     cardTimeout:()=>void

    ):void;
    readersCardAvailable(callback:(error:CoreExceptions.RestException,data:any)=>void):void;
    readersCardsUnavailable(callback:(error:CoreExceptions.RestException,data:any)=>void):void;
    reader(reader_id:string,callback:(error:CoreExceptions.RestException,data:any)=>void):void;
    plugins(callback:(error:CoreExceptions.RestException,data:any)=>void):void;
    getPubKey(callback:(error:CoreExceptions.RestException,data:any)=>void):void;
    setPubKey(pubkey:any,callback:(error:CoreExceptions.RestException,data:any)=>void):void;
    activate(callback:(error:CoreExceptions.RestException, data:any) => void):void;

    // sync
    getUrl():String;
    infoBrowserSync():any;

    // t1c-lib-info
    version():String;
}
```

## Distribution Service Client

```javascript
interface AbstractDSClient{
    getUrl():String;
    getInfo(callback:(error:CoreExceptions.RestException, data:any) => void):void;
    getJWT(callback:(error:CoreExceptions.RestException, data:any) => void):void;
    getDevice(uuid,callback:(error:CoreExceptions.RestException, data:any) => void):void;
    refreshJWT(callback:(error:CoreExceptions.RestException, data:any) => void):void;
    getPubKey(callback:(error:CoreExceptions.RestException, data:any) => void):void;
    downloadLink(infoBrowser, callback:(error:CoreExceptions.RestException, data:any) => void):void;
    register(info, device_id, callback:(error:CoreExceptions.RestException, data:any) => void):void;
    sync(info, device_id, callback:(error:CoreExceptions.RestException, data:any) => void):void;
}
```

## Generic Interface

```javascript
interface GenericService{
    containerFor(readerId: string, callback?: (error: RestException, data: DataResponse) => void): Promise<DataResponse>
    download(callback?: (error: RestException, data: DownloadLinkResponse) => void): Promise<DownloadLinkResponse>
    dumpData(readerId: string, data: OptionalPin, callback?: (error: RestException, data: DataResponse) => void): Promise<DataResponse>
    readersCanAuthenticate(callback?: (error: RestException, data: CardReadersResponse) => void): Promise<CardReadersResponse>
    authenticate(readerId: string, data: AuthenticateOrSignData, callback?: (error: RestException, data: DataResponse) => void): Promise<DataResponse>
    readersCanSign(callback?: (error: RestException, data: CardReadersResponse) => void): Promise<CardReadersResponse>
    sign(readerId: string, data: AuthenticateOrSignData, callback?: (error: RestException, data: DataResponse) => void): Promise<DataResponse>
    readersCanVerifyPin(callback?: (error: RestException, data: CardReadersResponse) => void): Promise<CardReadersResponse>
    verifyPin(readerId: string, data: OptionalPin, callback?: (error: RestException, data: DataResponse) => void): Promise<DataResponse>
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://t1t.gitbook.io/t1c-js-belfius-guide/v2.2.3/core/overview-client-api.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
