Objects

Object entity
NAMETYPEDESCRIPTION

id

int

Unique ID for the object.

author_id

int

ID of the user who created the object.

user_id

int

ID of the user who owns the object.

namespace_id

int

ID of the namespace the invite was sent for.

name

string

The name of the object.

type

string

The MIME type of the object.

md5

string

The MD5 sum hash of the object.

sha256

string

The SHA256 sum hash of the object.

created_at

timestamp

The RFC3339 formatted string at which the object was created.

url

string

The API URL to the object entity itself.

builds_url

string

The API URL for the builds the object was placed on.

author

object

nullable

The user who authored the object.

user

object

nullable

The user who owns the object.

namespace

object

nullable

The namespace who owns the object.

ENTITIES
ENDPOINTS

List objects

List the objects for the currently authenticated user. The following parameters can be given as query parameters to the URL. This requires the object:read permission.

Parameters
NAMETYPEDESCRIPTION

search

string

Get the objects with names like the given value.

Returns

This will return a list of objects. The list will be paginated to 25 objects per page, and will be ordered lexically. If the objects were paginated, then the pagination information will be in the response header Link.

Link: <https://api.djinn-ci.com/objects?page=1>; rel="prev",
      <https://api.djinn-ci.com/objects?page=3>; rel="next"

GET /objects
$ curl -X GET \
	-H "Authorization: Bearer 1a2b3c4d5f" \
	https://api.djinn-ci.com/objects

Create object

This will create an object for the currently authenticated user. This requires the object:write permission.

The contents of the file should be sent in the body of the request. The header Content-Type should be the MIME type of the file being uploaded.

Parameters
NAMETYPEREQUIREDDESCRIPTION

name

string

Yes

The name of the object to create.

namespace

string

No

The namespace to upload the object to.

Returns

Returns the created object. It returns an error if any of the parameters are invalid, or if an internal error occurs.

POST /objects
$ curl -X POST \
	-H "Authorization: Bearer 1a2b3c4d5f" \
	-H "Content-Type: image/jpeg" \
	-d "@image.jpeg" \
	https://api.djinn-ci.com/objects?name=data


$ curl -X POST \
	-H "Authorization: Bearer 1a2b3c4d5f" \
	-H "Content-Type: image/jpeg" \
	-d "@image.jpeg" \
	https://api.djinn-ci.com/objects?name=data&namespace=djinn

Get object

This will get the object by the given :id. This requires the object:read permission.

If the Accept header is set to the MIME type of the object, then the response body will be the contents of the object file.

Returns

This will return the object.

GET /objects/:id
$ curl -X GET \
	-H "Authorization: Bearer 1a2b3c4d5f" \
	https://api.djinn-ci.com/objects/3

$ curl -X GET \
	-H "Accept: image/jpeg" \
	-H "Authorization: Bearer 1a2b3c4d5f" \
	https://api.djinn-ci.com/objects/3

Delete object

This will delete the object by the given :id. This requires the object:delete permission.

Returns

This returns no content in the response body.

DELETE /objects/:id
$ curl -X DELETE \
	-H "Authorization: Bearer 1a2b3c4d5f" \
	https://api.djinn-ci.com/objects/3