Get and search files
Get and search files in your IM Cloud Storage
POST https://api.imagemash.io/v1/storage/getFiles
Headers
Name
Type
Description
apikey*
Your API Key
Request Body
Name
Type
Description
searchQuery
A case insensitive search string. If not present or value is * , then it will get all files.
Default: *
limit
Integer
Maximum number of entities to return in response.
Min: 1
Max: 1000
Default: 1000
skip
Integer
Number of entities to skip from the beginning of the query.
Min: 0
Default: 0
sort
String
Order of the entities. It can be asc (A-Z) or desc (Z-A)
Default: asc
sortBy
String
Field name to be sorted by. Possible fields are: name, width, height, format, size, updatedAt, createdAt
Default: createdAt
folder
String
Specific folder to look for files. Eg. /brand_1/logos or for searching in home directory just /
Default: *
[
{
"name": "jeep.png",
"type": "image",
"filePath": "/cars/jeep.png",
"folderPath": "/cars",
"width": 1248,
"height": 832,
"tags": [
"car",
"gray",
"forest",
"wheel",
"nature"
],
"format": "png",
"mime": "image/png",
"size": 2498863,
"sizeHuman": "2,38 MB",
"thumbnail": "http://demo.imagemash.io/cars/jeep.png?tr=imagemash,w_250,q_80,f_webp",
"url": "http://demo.imagemash.io/cars/jeep.png",
"createdAt": "2023-01-13T11:00:36.215Z",
"updatedAt": "2023-01-13T11:00:36.215Z"
}
]{
msg: "error details"
details: "..."
} // Explanation of error{
// Please contact support if you are getting this error constantly.
}Example Codes
curl --location --request POST 'https://api.imagemash.io/v1/storage/getFiles' \
--header 'apikey: your_api_key' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'searchQuery=jeep.png'using System;
using RestSharp;
using System.Threading;
using System.Threading.Tasks;
namespace HelloWorldApplication {
class HelloWorld {
static async Task Main(string[] args) {
var options = new RestClientOptions("https://api.imagemash.io")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("/v1/storage/getFiles", Method.Post);
request.AddHeader("apikey", "your_api_key");
request.AddHeader("Content-Type", "application/x-www-form-urlencoded");
request.AddParameter("searchQuery", "jeep.png");
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
}
}
}
import java.io.*;
import okhttp3.*;
public class main {
public static void main(String []args) throws IOException{
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
RequestBody body = RequestBody.create(mediaType, "searchQuery=jeep.png");
Request request = new Request.Builder()
.url("https://api.imagemash.io/v1/storage/getFiles")
.method("POST", body)
.addHeader("apikey", "your_api_key")
.addHeader("Content-Type", "application/x-www-form-urlencoded")
.build();
Response response = client.newCall(request).execute();
System.out.println(response.body().string());
}
}
var axios = require('axios');
var qs = require('qs');
var data = qs.stringify({
'searchQuery': 'jeep.png'
});
var config = {
method: 'post',
maxBodyLength: Infinity,
url: 'https://api.imagemash.io/v1/storage/getFiles',
headers: {
'apikey': 'your_api_key',
'Content-Type': 'application/x-www-form-urlencoded'
},
maxRedirects: 0,
data : data
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
import requests
url = "https://api.imagemash.io/v1/storage/getFiles"
payload='searchQuery=jeep.png'
headers = {
'apikey': 'your_api_key',
'Content-Type': 'application/x-www-form-urlencoded'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
require "uri"
require "net/http"
url = URI("https://api.imagemash.io/v1/storage/getFiles")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request["apikey"] = "your_api_key"
request["Content-Type"] = "application/x-www-form-urlencoded"
request.body = "searchQuery=jeep.png"
response = https.request(request)
puts response.read_body
Last updated