Skip to main content

Hypermedia-Driven API

The GreetIncs API implements HATEOAS (Hypermedia as the Engine of Application State). Every response includes a links array that tells you what actions are available and where related resources live.

Response Structure

All responses follow this structure:
{
  "response_type": "AnalysisCreateResponse",
  "data": { ... },
  "links": [
    {
      "href": "/v1/analyses/analysis_01h45ytscbebyvny4gc8cr8ma2",
      "rel": "self",
      "method": "GET",
      "title": "Get Analysis"
    },
    {
      "href": "/v1/analyses/analysis_01h45ytscbebyvny4gc8cr8ma2/status",
      "rel": "status",
      "method": "GET",
      "title": "Check Status"
    },
    {
      "href": "/v1/analyses/analysis_01h45ytscbebyvny4gc8cr8ma2/results",
      "rel": "results",
      "method": "GET",
      "title": "Get Results"
    }
  ]
}
PropertyDescription
hrefThe URL path to the related resource
relThe relationship type (e.g., self, next, prev, status, results)
methodThe HTTP method to use
titleHuman-readable description of the action

Common Relationships

RelationshipMeaning
selfThe current resource
nextNext page in paginated results
prevPrevious page in paginated results
statusCheck the status of an async operation
resultsRetrieve completed results
relatedAssociated resources

Benefits

No URL Hardcoding

Follow links instead of constructing URLs manually.

Discoverable Actions

The API tells you what you can do next.

Future-Proof

URL changes won’t break your integration.

Self-Documenting

Links include titles explaining each action.

Pagination Example

List endpoints return pagination links:
{
  "response_type": "AnalysisPaginatedListResponse",
  "data": {
    "data": [...],
    "total": 150,
    "page": 2,
    "page_size": 50
  },
  "links": {
    "self": { "href": "/v1/analyses/?page=2", "rel": "self", "method": "GET" },
    "prev": { "href": "/v1/analyses/?page=1", "rel": "prev", "method": "GET" },
    "next": { "href": "/v1/analyses/?page=3", "rel": "next", "method": "GET" },
    "total": 150
  }
}
Follow the next link to get the next page—no need to calculate offsets yourself.