Resources

Retrieving a single resource

A single resource (public|private) can be retrieved from the available resource by using the resource’s specific link URI.

High-level response elements

name

String

Specifies the name of the resource. The name is given during creation.

scope

String

Specifies the permission scope of the file being uploaded.

mimeType

String

The mime type of the file that is being uploaded.

url

String

The downloaded link to the resource location. Browsing this link results in a download of the resource.

Note: Only available for public scoped resources.

link

Array

Provides a list of URLs that can be used to manipulate or access the message template.

  • uri: The link to access the message template
  • rel: The descriptor for what the link will do
  • method: The HTTP method to use with this particular link


  • JSON
  • XML

Retrieving a single resource

use the resource’s link uri for private scope file

 

{{codeStart}}

HTTP 1.1 GET https://api.<region>.whispir.com/resources/D3E2XCDF3WS4859?apikey=<your_api_key>

Authorization: Basic asdf98nf89asdvasd2r398h8sdf

x-api-key: your_api_key

Accept: application/vnd.whispir.resource-v1+json

{

"name": "australia.json",

"scope": "private",

"mimeType": "application/json",

"link": [

{

"uri": "https://api.<region>.whispir.com/resources/D3E2XCDF3WS4859?apikey=<your_api_key>",

"rel": "self",

"method": "GET"

},

{

"uri": "https://api.<region>.whispir.com/resources/D3E2XCDF3WS4859?apikey=<your_api_key>",

"rel": "updateResource",

"method": "PUT",

"type": "application/vnd.whispir.resource-v1+json,application/vnd.whispir.resource-v1+xml"

},

{

"uri": "https://api.<region>.whispir.com/resources/D3E2XCDF3WS4859?apikey=<your_api_key>",

"rel": "deleteResource",

"method": "DELETE"

}

]

}

> > use the resource's link uri for public scope file

 

HTTP 1.1 GET https://api.<region>.whispir.com/resources/F1212CF334EDR68?apikey=<your_api_key>

Authorization: Basic asdf98nf89asdvasd2r398h8sdf

x-api-key: your_api_key

Accept: application/vnd.whispir.resource-v1+json

{

"name": "users.json",

"scope": "public",

"mimeType": "application/json",

"url": "https://cdn-ap.whispir.com/public/resources/2163b29d4edf1bd77d71a36210d472360cd.json",

"link": [

{

"uri": "https://api.<region>.whispir.com/resources/F1212CF334EDR68?apikey=<your_api_key>",

"rel": "self",

"method": "GET"

},

{

"uri": "https://api.<region>.whispir.com/resources/F1212CF334EDR68?apikey=<your_api_key>",

"rel": "updateResource",

"method": "PUT",

"type": "application/vnd.whispir.resource-v1+json,application/vnd.whispir.resource-v1+xml"

},

{

"uri": "https://api.<region>.whispir.com/resources/F1212CF334EDR68?apikey=<your_api_key>",

"rel": "deleteResource",

"method": "DELETE"

}

]

}

{{codeEnd}}

Filtering search results

Filtering by scope

You can filter resources by their scope by sending the required scope type in the URL as a query parameter. The scope can be one of the allowed scope types:

  • Public: &scope=public
  • Private: &scope=private

Filtering by name

You can filter resources by their name by sending the name in the URL as a query parameter.

Note: The name, including the file extension, makes it a unique search term. For example, &name=australia.csv.

  • JSON
  • XML

Filtering resources by scope

Only get the public resources

HTTP 1.1 GET https://api.<region>.whispir.com/resources/?apikey=<your_api_key>&scope=public
Authorization: Basic asdf98nf89asdvasd2r398h8sdf
x-api-key: your_api_key

  

Only get the private resources

HTTP 1.1 GET https://api.<region>.whispir.com/resources/?apikey=<your_api_key>&scope=private
Authorization: Basic asdf98nf89asdvasd2r398h8sdf
x-api-key: your_api_key

  

Filtering resources by scope

With extension of file type

HTTP 1.1 GET https://api.<region>.whispir.com/resources/?apikey=<your_api_key>&name=australia.csv
Authorization: Basic asdf98nf89asdvasd2r398h8sdf
x-api-key: your_api_key

Response will be array of records that match exactly the whole name given in the query

 

Only part of name

HTTP 1.1 GET https://api.<region>.whispir.com/resources/?apikey=<your_api_key>&name=au
Authorization: Basic asdf98nf89asdvasd2r398h8sdf
x-api-key: your_api_key

Response will match all records that have au in their file name. So, multiple records are returned.