/image/{belongsToId} 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:
Image
getImageBelongsToId
Code samples
const headers = {
Accept: "image/*",
};
fetch("https://goldleaf.app/api/v1/image/{belongsToId}", {
method: "GET",
headers: headers,
})
.then(function (res) {
return res.json();
})
.then(function (body) {
console.log(body);
});
GET /image/{belongsToId}
Gets an image
Retrieves an image representing the organization or a customer or brand associated with the organization.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| belongsToId | path | string(mongo-id) | true | The MongoDB ID of the object (e.g. customer, or organization). |
Example responses
200 Response
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | The image file was successfully retrieved. | string |
postImageBelongToId
Code samples
const headers = {
Accept: "application/json",
};
fetch("https://goldleaf.app/api/v1/image/{belongsToId}", {
method: "POST",
headers: headers,
})
.then(function (res) {
return res.json();
})
.then(function (body) {
console.log(body);
});
POST /image/{belongsToId}
Updates the image
Uploads a new image for the organization or a customer, updating the record accordingly.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| belongsToId | query | any | false | The ID indicating the organization or entity the image belongs to. If "thisOrgId" is provided, it will be treated as null. |
Example responses
200 Response
{
"type": "string"
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | the status of "complete" | string |
| 500 | Internal Server Error | Server error. | string |
