/components/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:
Components
postComponentsExports
Code samples
const inputBody = '{
"type": "object",
"required": [
"components",
"componentType",
"selectAll"
],
"properties": {
"components": {
"type": "array",
"items": {
"type": "string",
"format": "mongo-id",
"nullable": true
},
"description": "An array of component MongoDB IDs."
},
"componentType": {
"type": "string",
"description": "The type of the component.",
"example": "hose, crimpFitting, adaptor, ferrule, wrap, otherItem."
},
"selectAll": {
"type": "boolean",
"description": "Indicates if all components are selected."
},
"search": {
"type": "object",
"properties": {
"partNumber": {
"type": "string",
"nullable": true,
"description": "The part number to search for."
},
"orgPartNumber": {
"type": "string",
"nullable": true,
"description": "The organization part number to search for."
},
"brand": {
"type": "string",
"nullable": true,
"description": "The brand name to search for."
},
"size": {
"type": "string",
"nullable": true,
"description": "The size to search for."
},
"dashSize": {
"type": "string",
"nullable": true,
"description": "The dash size to search for."
},
"hoseSize": {
"type": "string",
"nullable": true,
"description": "The hose size to search for."
},
"nominalHoseSize": {
"type": "string",
"nullable": true,
"description": "The nominal hose size to search for."
},
"series": {
"type": "string",
"nullable": true,
"description": "The series to search for."
},
"wrapType": {
"type": "string",
"nullable": true,
"description": "The wrap type to search for."
},
"description": {
"type": "string",
"nullable": true,
"description": "The description to search for."
},
"itemType": {
"type": "string",
"nullable": true,
"description": "The item type to search for."
},
"colour": {
"type": "string",
"nullable": true,
"description": "The color to search for."
}
}
},
"custom": {
"type": "boolean",
"description": "A custom flag."
}
}
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/octet-stream'
};
fetch('https://goldleaf.app/api/v1/components/export',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
POST /components/export
Export component data
Exports an Excel file with component data
Body parameter
{
"type": "object",
"required": ["components", "componentType", "selectAll"],
"properties": {
"components": {
"type": "array",
"items": {
"type": "string",
"format": "mongo-id",
"nullable": true
},
"description": "An array of component MongoDB IDs."
},
"componentType": {
"type": "string",
"description": "The type of the component.",
"example": "hose, crimpFitting, adaptor, ferrule, wrap, otherItem."
},
"selectAll": {
"type": "boolean",
"description": "Indicates if all components are selected."
},
"search": {
"type": "object",
"properties": {
"partNumber": {
"type": "string",
"nullable": true,
"description": "The part number to search for."
},
"orgPartNumber": {
"type": "string",
"nullable": true,
"description": "The organization part number to search for."
},
"brand": {
"type": "string",
"nullable": true,
"description": "The brand name to search for."
},
"size": {
"type": "string",
"nullable": true,
"description": "The size to search for."
},
"dashSize": {
"type": "string",
"nullable": true,
"description": "The dash size to search for."
},
"hoseSize": {
"type": "string",
"nullable": true,
"description": "The hose size to search for."
},
"nominalHoseSize": {
"type": "string",
"nullable": true,
"description": "The nominal hose size to search for."
},
"series": {
"type": "string",
"nullable": true,
"description": "The series to search for."
},
"wrapType": {
"type": "string",
"nullable": true,
"description": "The wrap type to search for."
},
"description": {
"type": "string",
"nullable": true,
"description": "The description to search for."
},
"itemType": {
"type": "string",
"nullable": true,
"description": "The item type to search for."
},
"colour": {
"type": "string",
"nullable": true,
"description": "The color to search for."
}
}
},
"custom": {
"type": "boolean",
"description": "A custom flag."
}
}
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| body | body | object | true | none |
| » components | body | [string] | true | An array of component MongoDB IDs. |
| » componentType | body | string | true | The type of the component. |
| » selectAll | body | boolean | true | Indicates if all components are selected. |
| » search | body | object | false | none |
| »» partNumber | body | string¦null | false | The part number to search for. |
| »» orgPartNumber | body | string¦null | false | The organization part number to search for. |
| »» brand | body | string¦null | false | The brand name to search for. |
| »» size | body | string¦null | false | The size to search for. |
| »» dashSize | body | string¦null | false | The dash size to search for. |
| »» hoseSize | body | string¦null | false | The hose size to search for. |
| »» nominalHoseSize | body | string¦null | false | The nominal hose size to search for. |
| »» series | body | string¦null | false | The series to search for. |
| »» wrapType | body | string¦null | false | The wrap type to search for. |
| »» description | body | string¦null | false | The description to search for. |
| »» itemType | body | string¦null | false | The item type to search for. |
| »» colour | body | string¦null | false | The color to search for. |
| » custom | body | boolean | false | A custom flag. |
Example responses
200 Response
500 Response
{
"type": "string"
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | an Excel file | string |
| 400 | Bad Request | the componentType field was not supplied | None |
| 500 | Internal Server Error | Server error | string |
