Top
Documentation / General Documentation / API

API

Please click here if you are looking for the technical (Swagger) API documentation.

What is the structure of API request bodies returned from the WrapDapp API?

While the content of the body will vary for each request, the standard envelop we send responses in contains three components:

  • anybody: The primary response sent for this API request. When an error occurs, this will include details about the error.
  • booleansuccess: Whether the result was successful or not.
  • stringcode: The internal WrapDapp code for the success or error message assocaited with the body.
Full Sample Response
{
    "code": "S0001",
    "body": {
        "id": "bd303ba8-8b6c-4f5d-a21d-93fcfad412f6",
        "created_at": "2022-03-31T17:25:45.811Z",
        "updated_at": "2022-03-31T17:25:45.811Z",
        "username": "jon@doe.com",
        "provider_id": "jon_doe_cdbaby",
        "require_update": true
    },
    "success": true
}

How do I gain access to the API?

API registration is presently open to publishers and providers.

If you are a music publisher (for example "Sony Music") or your organization helps independent musicians get their music listed on DSPs such as Spotify (a "provider", for example "CD Baby"), please contact us to inquire about getting set up with an API key.

How does pagination work with the API?

When looking through the API technical docs, you'll notice that some endpoints are classified under the "Search" header. Any endpoint under this classification has access to pagination input.

Pagination inputs should be included in the query string, and follow these guidelines:

  • intlimit: How many results per page. Maximum is 100.
  • intoffset: How many records to skip before returning results.
  • stringsortKey: What key within the model to sort against. These are different for each search endpoint. Please see the API technical docs for more specifics.
  • stringsortDir: This can be either ASC or DESC.
Example:
GET/song?limit=10&offset=0&sortKey=created_at&sortDir=DESC

How do I filter search results?

When looking through the API technical docs, you'll notice that some endpoints are classified under the "Search" header. Most endpoints within this classification have access to search filters.

Search filters depend on the search endpoint in question; you can reference the API technical docs to see available keys per endpoint.

In all cases, search filters should be sent via the query string, and in all cases, can include an optional comparison indicator before the search value.

  • ==: Exactly equals. Case sensitive.
  • ~~: Fuzzy, case insensitive comparison.
  • ~=: Does not equal. Case sensitive.
  • >>: Greater than.
  • <<: Less than.
  • >=: Greater than or equal to.
  • <=: Less than or equal to.
Example (HTML special characters have not been encoded, but you should do this when sending your request):
GET/song?user_id=UUID&created_at=>=2022-05-13&name=~~dreams

The above will return songs that meet the following criteria:

  • Song must be ownerd by user with user ID "UUID"
  • Song must have been created on or after "2022-05-13"
  • Song name should include the case-insensitive word "dreams".