Packages

Get a list of packages

GET /packages

Response

[{
"id":1,
"name":"vendor/first",
"description":"Package description 1",
"status":1,
"created_at":"2018-01-01 00:00:00",
"updated_at":"2018-01-01 00:00:00"
},
{
"id":2,
"name":"vendor/second",
"description":"Package description 2",
"status":0,
"created_at":"2018-01-01 00:00:00",
"updated_at":"2018-01-01 00:00:00"
}], response code 200 (400, 401 in case of errors)

Get a specific package

GET /packages/{id}

Parameters

Name Located in Description Type
id path The id of a package int

Response

{
"id":1,
"name":"vendor/name",
"description":"Package description",
"status":1,
"created_at":"2018-01-01 00:00:00",
"updated_at":"2018-01-01 00:00:00"
}, response code 200 (400, 401 in case of errors)

Create a package

POST /packages

Parameters

Name Located in Description Type
request request {"name","description","status"} Request

Response

{
"id":1,
"name":"vendor/name",
"description":"Package description",
"status":1,
"created_at":"2018-01-01 00:00:00",
"updated_at":"2018-01-01 00:00:00"
}, response code 201 (400, 401 in case of errors)

Update a package

PUT /packages/{id}

Parameters

Name Located in Description Type
request request {"name","description","status"} Request
id path The id of a package

Response

{
"id":1,
"name":"vendor/name",
"description":"Package description",
"status":1,
"created_at":"2018-01-01 00:00:00",
"updated_at":"2018-01-01 00:00:00"
}, response code 201 (400, 401 in case of errors)

Update a package

PATCH /packages/{id}

Parameters

Name Located in Description Type
request request {"name","description","status"} Request
id path The id of a package

Response

{
"id":1,
"name":"vendor/name",
"description":"Package description",
"status":1,
"created_at":"2018-01-01 00:00:00",
"updated_at":"2018-01-01 00:00:00"
}, response code 201 (400, 401 in case of errors)

Delete a package

DELETE /packages/{id}

Parameters

Name Located in Description Type
id path The id of a package

Response

No content, response code 204 (400, 401 in case of errors)

Versions

Get a list of versions for a specified package

GET /versions/package/{id}

Parameters

Name Located in Description Type
id path The id of a package int

Response

[{
"id":1,
"package_id":3,
"name":"8.7.2",
"filename":"438411134.zip",
"status":1,
"created_at":"2018-01-01 00:00:00",
"updated_at":"2018-01-01 00:00:00"
},
{
"id":2,
"package_id":4,
"name":"4.0.9",
"filename":"481047020.zip",
"status":0,
"created_at":"2018-01-01 00:00:00",
"updated_at":"2018-01-01 00:00:00"
}], response code 200 (400, 401 in case of errors)

Create a version

POST /versions/package/{id}

Parameters

Name Located in Description Type
request request {"name","filename","status"} Request
id path The id of a package int

Response

{
"id":1,
"name":"8.7.2",
"filename":"438411134.zip",
"status":1,
"package_id":2,
"updated_at":"2018-01-01 00:00:00",
"created_at":"2018-01-01 00:00:00"
}, response code 201 (400, 401 in case of errors)

Get a specific version

GET /versions/{id}

Parameters

Name Located in Description Type
id path The id of a version int

Response

{
"id":1,
"package_id":2,
"name":"8.7.2",
"filename":"438411134.zip",
"status":1,
"created_at":"2018-01-01 00:00:00",
"updated_at":"2018-01-01 00:00:00"
}, response code 200 (400, 401 in case of errors)

Update a version

PUT /versions/{id}

Parameters

Name Located in Description Type
request request {"name","filename","status"} Request
id path The id of a version int

Response

{
"id":1,
"name":"8.7.2",
"filename":"438411134.zip",
"status":1,
"package_id":2,
"updated_at":"2018-01-01 00:00:00",
"created_at":"2018-01-01 00:00:00"
}, response code 200 (400, 401 in case of errors)

Update a version

PATCH /versions/{id}

Parameters

Name Located in Description Type
request request {"name","filename","status"} Request
id path The id of a version int

Response

{
"id":1,
"name":"8.7.2",
"filename":"438411134.zip",
"status":1,
"package_id":2,
"updated_at":"2018-01-01 00:00:00",
"created_at":"2018-01-01 00:00:00"
}, response code 200 (400, 401 in case of errors)

Delete a version

DELETE /versions/{id}

Parameters

Name Located in Description Type
id path The id of a version int

Response

No content, response code 204 (400, 401 in case of errors)

Consumers

Get a list of consumers

GET /consumers

Response

[{
"id":1,
"email":"one@example.com",
"public_key":"zPMmf9HhaOPwuGsFMMSC2adhEa3uifRatarQv49UgDai3LzJr1RYyPWfjuKl",
"private_key":"XzVTo8rLAvOffhh1Y3LQ8JFTIA1ds2TkEQzbsZZQ2A7bCNpgm8i7y4I59ofO",
"created_at":"2018-01-01 00:00:00",
"updated_at":"2018-01-01 00:00:00"
},
{
"id":2,
"email":"two@example.com",
"public_key":"32zR5vDE3NNvAgvIwvjwNEdm3Mb9ZnKXDaoAxHJNWPTGsXWmsGJXCaVGUecW",
"private_key":"PBbgqInrtHtMSxEQLsxobgs4ya0d0TUTBBx7dKU4LWLy9hCGTqGYUcP3O1Rd",
"created_at":"2018-01-01 00:00:00",
"updated_at":"2018-01-01 00:00:00"
}], response code 200 (400, 401 in case of errors)

Get a list of consumers filtered by an email

GET /consumers/email/{email}

Parameters

Name Located in Description Type
email path The email of a consumer string

Response

[{
"id":1,
"email":"one@example.com",
"public_key":"zPMmf9HhaOPwuGsFMMSC2adhEa3uifRatarQv49UgDai3LzJr1RYyPWfjuKl",
"private_key":"XzVTo8rLAvOffhh1Y3LQ8JFTIA1ds2TkEQzbsZZQ2A7bCNpgm8i7y4I59ofO",
"created_at":"2018-01-01 00:00:00",
"updated_at":"2018-01-01 00:00:00"
},
{
"id":2,
"email":"one@example.com",
"public_key":"32zR5vDE3NNvAgvIwvjwNEdm3Mb9ZnKXDaoAxHJNWPTGsXWmsGJXCaVGUecW",
"private_key":"PBbgqInrtHtMSxEQLsxobgs4ya0d0TUTBBx7dKU4LWLy9hCGTqGYUcP3O1Rd",
"created_at":"2018-01-01 00:00:00",
"updated_at":"2018-01-01 00:00:00"
}], response code 200 (400, 401 in case of errors)

Get a specific consumer

GET /consumers/{id}

Parameters

Name Located in Description Type
id path The id of a consumer

Response

{
"id":1,
"email":"one@example.com",
"public_key":"zPMmf9HhaOPwuGsFMMSC2adhEa3uifRatarQv49UgDai3LzJr1RYyPWfjuKl",
"private_key":"XzVTo8rLAvOffhh1Y3LQ8JFTIA1ds2TkEQzbsZZQ2A7bCNpgm8i7y4I59ofO",
"created_at":"2018-01-01 00:00:00",
"updated_at":"2018-01-01 00:00:00"
}, response code 200 (400, 401 in case of errors)

Create a consumer

POST /consumers

Parameters

Name Located in Description Type
request request {"email","public_key","private_key"} Request

Response

{
"id":1
"email":"one@example.com",
"public_key":"zPMmf9HhaOPwuGsFMMSC2adhEa3uifRatarQv49UgDai3LzJr1RYyPWfju12",
"private_key":"XzVTo8rLAvOffhh1Y3LQ8JFTIA1ds2TkEQzbsZZQ2A7bCNpgm8i7y4I59ofO",
"updated_at":"2018-01-01 00:00:00",
"created_at":"2018-01-01 00:00:00",
}, response code 201 (400, 401 in case of errors)

Update a consumer

PUT /consumers/{id}

Parameters

Name Located in Description Type
request request {"email","public_key","private_key"} Request
id path The id of a consumer int

Response

{
"id":1
"email":"one@example.com",
"public_key":"zPMmf9HhaOPwuGsFMMSC2adhEa3uifRatarQv49UgDai3LzJr1RYyPWfju12",
"private_key":"XzVTo8rLAvOffhh1Y3LQ8JFTIA1ds2TkEQzbsZZQ2A7bCNpgm8i7y4I59ofO",
"updated_at":"2018-01-01 00:00:00",
"created_at":"2018-01-01 00:00:00",
}, response code 200 (400, 401 in case of errors)

Update a consumer

PATCH /consumers/{id}

Parameters

Name Located in Description Type
request request {"email","public_key","private_key"} Request
id path The id of a consumer int

Response

{
"id":1
"email":"one@example.com",
"public_key":"zPMmf9HhaOPwuGsFMMSC2adhEa3uifRatarQv49UgDai3LzJr1RYyPWfju12",
"private_key":"XzVTo8rLAvOffhh1Y3LQ8JFTIA1ds2TkEQzbsZZQ2A7bCNpgm8i7y4I59ofO",
"updated_at":"2018-01-01 00:00:00",
"created_at":"2018-01-01 00:00:00",
}, response code 200 (400, 401 in case of errors)

Delete a consumer

DELETE /consumers/{id}

Parameters

Name Located in Description Type
id path The id of a consumer int

Response

No content, response code 204 (400, 401 in case of errors)

Get a list of packages for a specified consumer

GET /consumers/{id}/packages

Parameters

Name Located in Description Type
id path The id of a consumer int

Response

[{
"id":1,
"name":"vendor/first",
"description":"Package description 1",
"status":1,
"created_at":"2018-01-01 00:00:00",
"updated_at":"2018-01-01 00:00:00"
},
{
"id":2,
"name":"vendor/second",
"description":"Package description 2",
"status":0,
"created_at":"2018-01-01 00:00:00",
"updated_at":"2018-01-01 00:00:00"
}], response code 200 (400, 401 in case of errors)

Get a list of a permissions for a specified consumer and package

GET /consumers/{consumerId}/packages/{packageId}

Parameters

Name Located in Description Type
consumerId path The id of a consumer int
packageId path The id of a package int

Response

[{
"id":5,
"consumer_id":1,
"package_id":2,
"version":"5.",
"created_at":"2018-01-01 00:00:00",
"updated_at":"2018-01-01 00:00:00"
},
{
"id":6,
"consumer_id":1,
"package_id":2,
"version":"4.
",
"created_at":"2018-01-01 00:00:00",
"updated_at":"2018-01-01 00:00:00"
}], response code 200 (400, 401 in case of errors)

Permissions

Get a list of a permissions for a specified consumer and package

GET /permissions/consumer/{consumerId}/package/{packageId}

Parameters

Name Located in Description Type
consumerId path The id of a consumer int
packageId path The id of a package int

Response

[{
"id":5,
"consumer_id":1,
"package_id":2,
"version":"5.",
"created_at":"2018-01-01 00:00:00",
"updated_at":"2018-01-01 00:00:00"
},
{
"id":6,
"consumer_id":1,
"package_id":2,
"version":"4.
",
"created_at":"2018-01-01 00:00:00",
"updated_at":"2018-01-01 00:00:00"
}], response code 200 (400, 401 in case of errors)

Get a specific permission

GET /permissions/{id}

Parameters

Name Located in Description Type
id path The id of a permission int

Response

{
"id":6,
"consumer_id":1,
"package_id":2,
"version":"4.*",
"created_at":"2018-01-01 00:00:00",
"updated_at":"2018-01-01 00:00:00"
}, response code 200 (400, 401 in case of errors)

Create a permission for a specific customer and package

POST /permissions

Parameters

Name Located in Description Type
request request {"consumer_id","package_id","version"} Request

Response

{
"id":7,
"consumer_id":1,
"package_id":2,
"version":"9.*",
"updated_at":"2018-01-01 00:00:00",
"created_at":"2018-01-01 00:00:00"
}, response code 201 (400, 401 in case of errors)

Update a specific permission

PUT /permissions/{id}

Parameters

Name Located in Description Type
request request {"consumer_id","package_id","version"} Request
id path The id of a permission int

Response

{
"id":7,
"consumer_id":`,
"package_id":1,
"version":"8.*",
"created_at":"2018-01-01 00:00:00",
"updated_at":"2018-01-01 00:00:00"
}, response code 200 (400, 401 in case of errors)

Update a specific permission

PATCH /permissions/{id}

Parameters

Name Located in Description Type
request request {"consumer_id","package_id","version"} Request
id path The id of a permission int

Response

{
"id":7,
"consumer_id":`,
"package_id":1,
"version":"8.*",
"created_at":"2018-01-01 00:00:00",
"updated_at":"2018-01-01 00:00:00"
}, response code 200 (400, 401 in case of errors)

Delete a specific permission

DELETE /permissions/{id}

Parameters

Name Located in Description Type
id path The id of a permission int

Response

No content, response code 204 (400, 401 in case of errors)