Kemasan/Box Handphone (Phone Packaging)
Kemasan/Box Handphone (Phone Packaging).
This endpoint is currently in beta. It is not yet available in our production URL. Please contact us if you want to use this endpoint. Contact us via hi[at]glair.ai or via our representative for your company.
Phone Packaging Object
- Name
status
- Type
- string
- Description
Enum code indicating the status of the reading result.
SUCCESS
NO_FILE
FILE_INVALID_FORMAT
FAILED
- Name
reason
- Type
- string
- Description
A human-readable message providing more details about the reading result.
- Name
read
- Type
- object
- Description
Contains the reading for each Phone Packaging fields. Each fields has
value
(the reading).- Name
imei
- Type
- array
- Description
The IMEI (International Mobile Equipment Identity) field refers to a unique identification number assigned to a mobile device. It serves as a distinctive identifier for the device and is used for various purposes, including tracking, authentication, and network management.
- Name
serial_number
- Type
- string
- Description
The serial number field refers to a unique identifier assigned to a specific unit of the mobile device. This number is used to differentiate individual devices of the same model and brand, and it can be useful for tracking, warranty purposes, and inventory management.
- Name
brand
- Type
- string
- Description
The brand field refers to the manufacturer or company that produces the mobile device. It indicates the origin and source of the device, allowing customers to identify the company responsible for its design and production.
- Name
handphone_type
- Type
- string
- Description
The handphone type field refers to the specific model or variant of the mobile device. It provides information about the particular version or configuration of the device, helping users and support personnel to distinguish between different versions of the same brand.
- Name
memory
- Type
- string
- Description
The memory field refers to the amount of RAM (Random Access Memory) available in the mobile device. RAM is a type of volatile memory that the device's operating system and apps use for temporary storage of data. It impacts the device's multitasking and overall performance.
- Name
camera_pixel
- Type
- string
- Description
The camera pixel field refers to the resolution of the primary camera on the mobile device, usually measured in megapixels (MP). It indicates the level of detail the camera can capture, which is important for determining the quality of photographs and videos taken with the device.
- Name
screen_size
- Type
- string
- Description
The screen size field refers to the diagonal measurement of the mobile device's display screen. It is typically measured in inches or centimeters and provides an indication of the physical dimensions of the screen, influencing user experience, content visibility, and device portability.
- Name
processor
- Type
- string
- Description
The processor field refers to the central processing unit (CPU) of the mobile device. It specifies the chipset or processor model used in the device, which significantly affects its computing power, speed, and overall performance.
- Name
battery_size
- Type
- string
- Description
The battery size field refers to the capacity of the mobile device's battery, usually measured in milliampere-hours (mAh). It indicates the amount of energy the battery can store, which directly impacts the device's battery life and usage duration on a single charge.
- Name
storage_size
- Type
- string
- Description
The storage size field refers to the amount of internal storage capacity available in the mobile device. It indicates the space available for storing apps, files, photos, videos, and other data. Storage size affects how much content the device can hold.
- Name
handphone_color
- Type
- string
- Description
The handphone color field refers to the specific color or finish of the mobile device's exterior casing. It provides information about the aesthetic design and visual appearance of the device, allowing users to choose a style that suits their preferences.
Read Phone Packaging
Detects a valid Phone Packaging image and returns the information as text.
Required parameter
- Name
image
- Type
- file (.png, .jpg, .jpeg, .pdf)
- Description
The image file for the Phone Packaging.
Sample Request
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// Minimum Node 18. Save the code as 'index.mjs' and run it by executing 'node index.mjs'
import { readFileSync } from "fs";
const url = 'https://api.vision.glair.ai/ocr/v1/phone-packaging';
const basicAuth = 'Basic ' + Buffer.from('USERNAME' + ':' + 'PASSWORD').toString('base64');
const apiKey = 'API_KEY';
const formData = new FormData();
formData.append('image', new Blob([readFileSync('/path/to/image/Phone-Packaging.jpeg')]));
const config = {
method: 'POST',
headers: {
Authorization: basicAuth,
'x-api-key': apiKey,
},
body: formData,
};
const response = await fetch(url, config);
console.log(await response.json());
Sample Response
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
{
"status": "SUCCESS",
"reason": "File Successfully Read",
"read": {
"imei": [
{
"value": "866348052544729"
},
{
"value": "866348052544737"
}
],
"serial_number": {
"value": "31278/11TJ00227"
},
"brand": {
"value": "Redmi"
},
"handphone_type": {
"value": "Redmi 9"
},
"memory": {
"value": "4GB"
},
"camera_pixel": {
"value": "48MP"
},
"screen_size": {
"value": "6.53"
},
"processor": {
"value": "Snapdragon™ 662"
},
"battery_size": {
"value": "6000mAh (typ)"
},
"storage_size": {
"value": "64GB"
},
"handphone_color": {
"value": "Sunrise Orange"
}
}
}
Request ID
An associated request identifier is generated for every request made to this endpoint.
This value can be found in the response headers under Request-Id
Responses
Various responses for this endpoint, in addition to general responses specified in Errors.
200 - OK
Request with readable Phone Packaging image
Response
1
2
3
4
5
{
"status": "SUCCESS",
"reason": "File Successfully Read",
//...,
}
// TODO: no "Request with non Phone Packaging File"?
400 - Bad Request
Request without form-data image
Response
1
2
3
4
5
{
"status": "NO_FILE",
"reason": "No file in request body",
//...,
}
415 - Unsupported Media Type
Request with non-image file format
Response
1
2
3
4
5
{
"status": "FILE_INVALID_FORMAT",
"reason": "Failed to process invalid file format. Please upload the correct file format",
//...,
}