helpjuice.api.schema

Schema

https://help.helpjuice.com/en_US/api-v3/api-v3#schema

All API requests and response bodies adhere to a common JSON format representing individual items and collections of items.

Module Contents

Classes

SchemaBase

Resource

Single Resource.

Collection

Resource Collection.

PageIterator

Page Iterator.

class helpjuice.api.schema.SchemaBase
class helpjuice.api.schema.Resource

Bases: dict, SchemaBase

Single Resource.

https://help.helpjuice.com/en_US/api-v3/api-v3#single-resources

Individual resources are represented by top level member named after the resource in the singular form. Below is a representation of a single contact. This could be used in the body of a PUT request and it’s what would be returned in the body of a GET request.

get(resource, subresource=None, *args, **kwargs)

Retrieve a resource.

https://help.helpjuice.com/en_US/api-v3/api-v3#http-methods

Parameters

resource (str) – Resource endpoint.

Returns

Requested resource.

Return type

helpjuice.Resource

post(resource, *args, **kwargs)

Create a new resource.

https://help.helpjuice.com/en_US/api-v3/api-v3#http-methods

Parameters

resource (str) – Resource endpoint.

Returns

Created resource.

Return type

helpjuice.Resource

put(resource, *args, **kwargs)

Update a resource.

https://help.helpjuice.com/en_US/api-v3/api-v3#http-methods

Parameters

resource (str) – Resource endpoint.

Returns

Updated resource.

Return type

helpjuice.api.Resource

delete(resource, *args, **kwargs)

Remove a resource.

https://help.helpjuice.com/en_US/api-v3/api-v3#http-methods

Parameters

resource (str) – Resource endpoint.

class helpjuice.api.schema.Collection

Bases: list, SchemaBase

Resource Collection.

https://help.helpjuice.com/en_US/api-v3/api-v3#collections

Collections of resources are represented by a top level member named after the resource in the plural form.

get(resource, paginate=False, *args, **kwargs)

Retrieve a collection of resources.

https://help.helpjuice.com/en_US/api-v3/api-v3#http-methods

Parameters
  • resource (str) – Resource endpoint.

  • paginate (bool, optional) – Whether to paginate results. Defaults to False.

Returns

Requested resources.

Return type

helpjuice.Collection

class helpjuice.api.schema.PageIterator(collection, resource, limit=25, *args, **kwargs)

Page Iterator.

https://help.helpjuice.com/en_US/api-v3/api-v3#pagination

collection

Resource collection to append results to.

Type

helpjuice.Collection

resource

Resource endpoint.

Type

str

limit

The number of results to display in each page.

Type

int, optional

property resources