/brands/export v1.0.0
Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.
Base URLs:
Brands
postBrandsExports
Code samples
const inputBody = '{
"type": "object",
"required": [
"brands",
"selectAll"
],
"properties": {
"brands": {
"type": "array",
"items": {
"type": "string",
"format": "mongo-id"
},
"description": "An array of brand IDs."
},
"selectAll": {
"type": "boolean",
"description": "Indicates if all items should be selected."
},
"search": {
"type": "object",
"properties": {
"name": {
"type": "string",
"nullable": true,
"description": "The name to search for."
}
}
},
"custom": {
"type": "boolean",
"nullable": true,
"description": "Whether we are requesting brands created by this organization (true) or standard ones (false)."
}
}
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/octet-stream'
};
fetch('https://goldleaf.app/api/v1/brands/export',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
POST /brands/export
Export brands
Exports brands to an Excel file.
Body parameter
{
"type": "object",
"required": ["brands", "selectAll"],
"properties": {
"brands": {
"type": "array",
"items": {
"type": "string",
"format": "mongo-id"
},
"description": "An array of brand IDs."
},
"selectAll": {
"type": "boolean",
"description": "Indicates if all items should be selected."
},
"search": {
"type": "object",
"properties": {
"name": {
"type": "string",
"nullable": true,
"description": "The name to search for."
}
}
},
"custom": {
"type": "boolean",
"nullable": true,
"description": "Whether we are requesting brands created by this organization (true) or standard ones (false)."
}
}
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| body | body | object | true | none |
| » brands | body | [string] | true | An array of brand IDs. |
| » selectAll | body | boolean | true | Indicates if all items should be selected. |
| » search | body | object | false | none |
| »» name | body | string¦null | false | The name to search for. |
| » custom | body | boolean¦null | false | Whether we are requesting brands created by this organization (true) or standard ones (false). |
Example responses
200 Response
500 Response
{
"type": "string"
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | an Excel file | string |
| 500 | Internal Server Error | Server error | string |
