/adaptors/create 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:
Adaptors
getAdaptorCreate
Code samples
const inputBody = '{
"type": "object",
"required": [
"partNumber",
"brand",
"shape"
],
"properties": {
"itemId": {
"type": "string",
"format": "mongo-id",
"nullable": true,
"description": "The optional MongoDB ID of the item."
},
"partNumber": {
"type": "string",
"description": "The part number of the item."
},
"brand": {
"type": "string",
"description": "The brand of the item."
},
"shape": {
"type": "string",
"description": "The shape of the item."
},
"crossReference": {
"type": "number",
"nullable": true,
"description": "The GoldLeaf cross reference number of the adaptor (to cross-reference between brands)."
},
"familyCrossReference": {
"type": "string",
"nullable": true,
"description": "The GoldLeaf family cross reference of the item (to cross-reference between sizes of this same family)."
},
"material": {
"type": "string",
"nullable": true,
"description": "The material of the item (steel is blank/empty by default, or 'stainless steel' or other materials as required)."
},
"spec": {
"type": "string",
"nullable": true,
"description": "The specification of the item."
},
"imageName": {
"type": "string",
"nullable": true,
"description": "The image name of the item."
},
"description": {
"type": "string",
"nullable": true,
"description": "The description of the item."
},
"specMS": {
"type": "string",
"nullable": true,
"description": "The MS specification of the item."
},
"specSAE": {
"type": "string",
"nullable": true,
"description": "The SAE specification of the item."
},
"ends": {
"type": "array",
"nullable": true,
"items": {
"type": "object",
"properties": {
"style": {
"type": "string"
},
"gender": {
"type": "string"
},
"dashSize": {
"type": "string"
},
"swivel": {
"type": "string",
"description": "Either null or 'swivel'."
},
"bulkhead": {
"type": "string",
"description": "Either null or 'bulkhead'."
}
}
}
},
"extraFeatures": {
"type": "array",
"nullable": true,
"items": {
"type": "string"
}
},
"maxPressurePsi": {
"type": "number",
"format": "float",
"nullable": true,
"description": "The maximum pressure in PSI."
}
}
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('https://goldleaf.app/api/v1/adaptors/create',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
POST /adaptors/create
Create an adaptor
Creates a new adaptor for the organization with the given properties.
Body parameter
{
"type": "object",
"required": ["partNumber", "brand", "shape"],
"properties": {
"itemId": {
"type": "string",
"format": "mongo-id",
"nullable": true,
"description": "The optional MongoDB ID of the item."
},
"partNumber": {
"type": "string",
"description": "The part number of the item."
},
"brand": {
"type": "string",
"description": "The brand of the item."
},
"shape": {
"type": "string",
"description": "The shape of the item."
},
"crossReference": {
"type": "number",
"nullable": true,
"description": "The GoldLeaf cross reference number of the adaptor (to cross-reference between brands)."
},
"familyCrossReference": {
"type": "string",
"nullable": true,
"description": "The GoldLeaf family cross reference of the item (to cross-reference between sizes of this same family)."
},
"material": {
"type": "string",
"nullable": true,
"description": "The material of the item (steel is blank/empty by default, or 'stainless steel' or other materials as required)."
},
"spec": {
"type": "string",
"nullable": true,
"description": "The specification of the item."
},
"imageName": {
"type": "string",
"nullable": true,
"description": "The image name of the item."
},
"description": {
"type": "string",
"nullable": true,
"description": "The description of the item."
},
"specMS": {
"type": "string",
"nullable": true,
"description": "The MS specification of the item."
},
"specSAE": {
"type": "string",
"nullable": true,
"description": "The SAE specification of the item."
},
"ends": {
"type": "array",
"nullable": true,
"items": {
"type": "object",
"properties": {
"style": {
"type": "string"
},
"gender": {
"type": "string"
},
"dashSize": {
"type": "string"
},
"swivel": {
"type": "string",
"description": "Either null or 'swivel'."
},
"bulkhead": {
"type": "string",
"description": "Either null or 'bulkhead'."
}
}
}
},
"extraFeatures": {
"type": "array",
"nullable": true,
"items": {
"type": "string"
}
},
"maxPressurePsi": {
"type": "number",
"format": "float",
"nullable": true,
"description": "The maximum pressure in PSI."
}
}
}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| body | body | object | true | none |
| » itemId | body | string(mongo-id)¦null | false | The optional MongoDB ID of the item. |
| » partNumber | body | string | true | The part number of the item. |
| » brand | body | string | true | The brand of the item. |
| » shape | body | string | true | The shape of the item. |
| » crossReference | body | number¦null | false | The GoldLeaf cross reference number of the adaptor (to cross-reference between brands). |
| » familyCrossReference | body | string¦null | false | The GoldLeaf family cross reference of the item (to cross-reference between sizes of this same family). |
| » material | body | string¦null | false | The material of the item (steel is blank/empty by default, or 'stainless steel' or other materials as required). |
| » spec | body | string¦null | false | The specification of the item. |
| » imageName | body | string¦null | false | The image name of the item. |
| » description | body | string¦null | false | The description of the item. |
| » specMS | body | string¦null | false | The MS specification of the item. |
| » specSAE | body | string¦null | false | The SAE specification of the item. |
| » ends | body | [object]¦null | false | none |
| »» style | body | string | false | none |
| »» gender | body | string | false | none |
| »» dashSize | body | string | false | none |
| »» swivel | body | string | false | Either null or 'swivel'. |
| »» bulkhead | body | string | false | Either null or 'bulkhead'. |
| » extraFeatures | body | [string]¦null | false | none |
| » maxPressurePsi | body | number(float)¦null | false | The maximum pressure in PSI. |
Example responses
500 Response
{
"type": "string"
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 201 | Created | The newly created adaptor | None |
| 500 | Internal Server Error | Server error | string |
