Enumerate API Keys

Title

List API keys generated for 3rd party applications

URL Path

vault_rest/tokens/{start}/{count}

Method

GET

CORS support

Yes

Http return

200, 400, 401, 403, 500

Table of Contents

Last Updated

08 Oct 2019

Summary

Returns a list of API keys generated by this user to allow 3rd party applications to connect to MetaDefender Vault .

Use Cases

Used by the web user interface to display generated API keys.

HTTP header parameters

Name

Value

Required

Description

Example

Authorization

The API key of the caller

REQUIRED

This header should have the following format:
Bearer [API key obtained from the authenticate API]
Example: Bearer Cp01BwnXAIOLZXxn7yogjKqIZnZpQD

GET /vault_rest/tokens/0/100 HTTP/1.1
Host: localhost:8010
Authorization: Bearer f3I8Vss3cWAuh3EscB06QRDcQfMzHY
sort_column: Created
sort_direction: desc
find: jza4XRo
findB64: anphNFhSbw==

sort_column

Name of column to use when sorting data

OPTIONAL

Possible values: Token, Created, Expires, Description, Role

sort_direction

Sorting direction

OPTIONAL

Possible values, asc, desc

find

Free text search string

OPTIONAL

Searches Token & Description

findB64

Free text search string (Base64 encoded)

OPTIONAL

Free text search string (Base64 encoded to support all charsets). Will override any value specified in 'find' header.

Method: GET

start

Zero based position in list from where to start returning data

REQUIRED

count

Maximum number of list entries to return

REQUIRED

Request Error

400

Bad Request

Invalid HTTP request

401

Invalid parameter

One or more parameters are invalid

403

Forbidden

API key is incorrect

500

Internal Server Error

Server is temporarily unavailable

Response

Example of a successful request:

{
"filter_count" : 2,
"items" : [{
"token_id" : 1,
"token" : "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"description" : "Metadefender access token",
"status" : "valid",
"created" : "2015-07-02T12:00:00.0000000Z",
"expires" : "2016-01-01T12:00:00.0000000Z",
"role" : "guest"
}, {
"token_id" : 2,
"token" : "BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB",
"description" : "3rd party access token",
"status" : "expired",
"created" : "2015-01-02T12:00:00.0000000Z",
"expires" : "2015-06-01T12:00:00.0000000Z",
"role": "user"
}
],
"total_count" : 2
}

Descriptions of response:

filter_count

Filtered entries count

Total number of entries in the database when a filter has been applied.
If no filter is specified this value is always equal to total_count.

total_count

Total entries count

Total number of entries in the database.

items

Array of entries

 

items.token_id

An ID associated with the API key

 

items.token

API key

 

items.description

API key description

 

items.status

API key status

Possible values:
valid
expired

items.created

API key creation date

Date+time (in UTC) when the token was created.

items.expires

API key expiration date

Date+time (in UTC) when the token expires.

items.role

API key role type

Possible values:
Guest
User
Administrator