Guide-Api

Gemfury Developer API

The Gemfury API enables developers to interact programmatically with their Gemfury accounts. Through the API, you can manage packages, versions, and collaborators. This guide offers a comprehensive overview of the available endpoints and their usage.

Before you get started, be sure you have an active Gemfury account.

Getting started with Developer API

Gemfury API is a REST API over HTTPS primarily using JSON for payload encoding. Every request includes a method, a path, and some headers. Operations are carried out via GET, POST, PATCH, PUT, and DELETE methods. Parameters to the API are specified via the URL query parameters or sometimes the JSON payload, based on the functionality of a specific endpoint.

Base URL

All API requests are made to the following base URL:

 

Handling responses & errors from API

API requests can result in one of various success or error responses. Typically, responses are JSON objects or arrays, unless specified otherwise in this documentation

HTTP Status Description
200 Success with response body
201 Successful object creation
204 Successful operation with no body
400 Bad request, usually input error
401 Request requires authentication
403 Insufficient permissions for request
404 Referenced object is not found
500 Internal service error
503 Internal platform error

Error responses

Error responses have a non-2xx status code and a JSON body containing an error key.

 

Using pagination in the API

When a response from the API yields many results, Gemfury will paginate by returning a subset of the results along with metadata linking to the subsequent or previous subsets. Paginating reduces the payload, and thus the processing load on both the servers and clients.

Pagination metadata is encoded in the response using the link header as described in RFC 8288. The presence of this header indicates that the returned results are a subset of all results and that additional pages are available.

 

API endpoint for Packages

A package represent a collection of artifacts (i.e. versions) that share the same kind and name.

Package object attributes

id string
Unique identifier of the object

name string
Name of package

kind_key string
Package type ID

private boolean
Has the value true if package is private, false if public

version_count integer
The number of versions for this package

release_version nullable object
Limited version object for latest releasable version of this package. null if the package has no release-level versions. The object is limited to id, version, and prerelease keys.

 

API endpoint for Versions

A version represents one or more files and the associated metadata that have a unique version and platform specifiers for a specific package.

Version object attributes

id string
Unique identifier of the object

name string
Name of the artifact

version string
Version of the artifact

prerelease boolean
Indicates whether the version is a prerelease (true), or a release(false).

package_id string
Unique identifier of the parent package.

kind_key string
Package type ID

filename string
Original name of the file as it was uploaded

 

API endpoint for Accounts

An account is a top-level object that encapsulates packages and versions, along with associated collaborators, repositories, and settings.

Account object attributes

id string
Unique identifier of the object

username string
Unique username of the account

name string
Display name

type_key string
Account type: user, org, or heroku_app

Retrieve account

Retrieve a single account by username or unique identifier. You can also use the keyword “me” to retrieve the context account.

GET https://api.fury.io/1/accounts/nickfury
GET https://api.fury.io/1/accounts/me?as=nickfury
GET https://api.fury.io/1/accounts/acct_eb3c12

API endpoint for Members

An account may have several collaborators who can perform a limited set operations on that account based on their associated role.

Member object attributes

role string
Permission level for this member: pull, push, or owner.

… Account attributes
The remaining attributes match Account object attributes. Note that certain attributes may return nil if you lack permissions to see their actual values.

List collaborations

Retrieve all accounts where the context user is a collaborator.