Get a list of Smart Objects
GET https://app.dynamicmockups.com/api/v1/mockups/[mockup-id]/smart-objects/
Security
This api use API KEY as an authentication method.
- Name: X-CSCAPI-KEY
- In: header
Request Parameters
Name | Located in | Description | Required | Type |
---|---|---|---|---|
[mockup-id] | URL | Id of the mockup | Required | string |
Response
Code | Description |
---|---|
200 | Return a array of smart objects |
401 | Unauthorized. |
404 | Not Found. |
Example Usage
- Javascript
- PHP
- Python
- Axios
- Dart
- jQuery
- Go
get-smart-objects.js
var headers = new Headers();
headers.append("X-CSCAPI-KEY", "API_KEY");
var requestOptions = {
method: "GET",
headers: headers,
};
fetch("https://app.dynamicmockups.com/api/v1/mockups/123/", requestOptions)
.then((response) => response.json())
.then((result) => console.log(result))
.catch((error) => console.log("error", error));
get-smart-objects.php
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://app.dynamicmockups.com/api/v1/mockups/123/',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => array(
'X-CSCAPI-KEY: API_KEY'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
get-smart-objects.py
import requests
url = "https://app.dynamicmockups.com/api/v1/mockups/123/"
headers = {
'X-CSCAPI-KEY': 'API_KEY'
}
response = requests.request("GET", url, headers=headers)
print(response.json)
get-smart-objects.js
var axios = require("axios");
var config = {
method: "get",
url: "https://app.dynamicmockups.com/api/v1/mockups/123/",
headers: {
"X-CSCAPI-KEY": "API_KEY",
},
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
get-smart-objects.dart
var headers = {
'X-CSCAPI-KEY': 'API_KEY'
};
var request = http.Request('GET', Uri.parse('https://app.dynamicmockups.com/api/v1/mockups/123/'));
request.headers.addAll(headers);
http.StreamedResponse response = await request.send();
if (response.statusCode == 200) {
print(await response.stream.bytesToString());
} else {
print(response.reasonPhrase);
}
get-smart-objects.js
var settings = {
url: "https://app.dynamicmockups.com/api/v1/mockups/123/",
method: "GET",
headers: {
"X-CSCAPI-KEY": "API_KEY",
},
};
$.ajax(settings).done(function (response) {
console.log(response);
});
get-smart-objects.go
url:="https://app.dynamicmockups.com/api/v1/mockups/123/"
client := &http.Client{}
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-CSCAPI-KEY", "API_KEY")
res, _ := client.Do(req)
defer res.Body.Close()
bytes ,err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err.Error())
}
fmt.Println(string(bytes))
Example Success Response
{
"data": [
{
"id": 376,
"uuid": "9e76157c-76f2-4cc3-8392-2dc10c37ea29",
"mockup_id": 225,
"smart_object_name": "Background",
"smart_object_uuid": "5244f4fb-d71c-11e5-b1ae-a548a96e5f9f",
"top": 0,
"left": 0,
"width": 1080,
"height": 810,
"global_asset_top": 405,
"global_asset_left": 540,
"global_asset_width": 1,
"global_asset_height": 1,
"created_at": "2023-12-06T17:10:05.000000Z",
"updated_at": "2023-12-06T17:10:05.000000Z",
"deleted_at": null,
"thumbnail": "https://app-dynamicmockups-production.s3.eu-central-1.amazonaws.com/6267/Background_5244f4fb-d71c-11e5-b1ae-a548a96e5f9f.png"
}
],
"success": true,
"message": ""
}
Example Error Response
{
"message": "This action is unauthorized."
}
Example Not Found Response
{
"message": "No query results for model [App\\Models\\Mockup] 123"
}