Check the image is exist or not
Checks whether a generated result image already exists. Used as a guard before calling Convert Image from base64 to Image.
| Method | GET |
| Path | /api/v1/baseToUrl |
| Full URL | https://backend.4dnum.com/api/v1/baseToUrl |
Path collision in the source document
The source document lists this endpoint and
Convert Image from base64 to Image under the same path and
method (GET /api/v1/baseToUrl). They differ only by the presence of the
image parameter. Confirm the intended routing with your PIC before
implementing — this endpoint may have a distinct path that was mis-copied in the
document.
Request
| Attribute | Type | Mandatory | Example | Description |
|---|---|---|---|---|
mode | String | Yes | dark | dark = dark mode, light = light mode. |
date | String | Yes | 20240228 | Draw date, YYYYMMDD. No dashes — unlike every other endpoint. |
type | String | Yes | Special_CashSweep | Company full name, not the abbreviation. |
language | String | Yes | en | en = English, cn = Chinese, my = Malay. |
Two format differences
dateusesYYYYMMDDhere, while every other endpoint usesYYYY-MM-DD.typetakes the company full name with underscores (Special_CashSweep), not the abbreviation (CS) used elsewhere. See Company Codes.
Response
| Attribute | Type | Example | Description |
|---|---|---|---|
exist | Boolean | false | If false, call Convert Image from base64 to Image to generate it. |
success | Boolean | true | Whether the check itself succeeded. |
Example
curl "https://backend.4dnum.com/api/v1/baseToUrl?mode=dark&date=20240228&type=Special_CashSweep&language=en"
{
"exist": false,
"success": true
}
Typical flow
const params = {
mode: 'dark',
date: '20240228',
type: 'Special_CashSweep',
language: 'en',
};
const check = await get(`/baseToUrl?${new URLSearchParams(params)}`);
if (!check.exist) {
// Render the result client-side, then upload it
const {s3_url} = await get(
`/baseToUrl?${new URLSearchParams({...params, image: base64Png})}`
);
share(s3_url);
}