Glass Code Parser API
Welcome to the Glass Code Parser API documentation. This API allows you to parse glass nomenclature codes programmatically, returning detailed descriptions or error messages as appropriate.
Endpoint
PUT
/code/{glassCode}?Version={version}Request
The API accepts a glass code as a URL parameter and processes it using the provided ParserService.
- HTTP Method: PUT
- Endpoint:
/code/{glassCode} - Path Parameter:
glassCode(string) - The glass nomenclature code to parse.version(string) - The schema version to use parsing the code. (V1,prev). this is optional and if no version is supplied V1 is used
Response
The API returns a structured response based on the parsing result:
- 200 OK: Returns a detailed description of the glass code in JSON format if parsing is successful.
- 400 Bad Request: Returns an error message if the provided glass code is invalid.
Example Request
PUT http://www.glassnomenclature.com/code/a6HS*[12.7Ar]10,10-0.76b**Reflective Silver
Example Responses
Success (200 OK):
{
"components": [
{
"thickness": "6",
"type": "HS",
"material": "",
"coating": "Reflective Silver",
"frontSurface": "a",
"backSurface": "*",
"componentType": 0
},
{
"thickness": "12.7",
"gas": "Ar",
"componentType": 2
},
{
"glassLayers": [
{
"thickness": "10",
"type": "",
"material": "",
"coating": null,
"frontSurface": "",
"backSurface": "",
"componentType": 0
},
{
"thickness": "10",
"type": "",
"material": "",
"coating": null,
"frontSurface": "",
"backSurface": "",
"componentType": 0
}
],
"interlayers": [
{
"thickness": "0.76",
"material": "b",
"componentType": 1
}
],
"componentType": 3
}
],
"coatingDescriptions": [
"Reflective Silver"
],
"name": "6mm HS,12.7mm Ar,10mm,0.76mm b,10mm",
"description": "6mm Clear Heat-Strengthened with Acid-Etch on 1 Reflective Silver on 2 | 12.7mm Argon | 10mm Clear Annealed | 0.76 PVB | 10mm Clear Annealed",
"componentType": 4
}
Error (400 Bad Request):
{
"errors": [
"Error: {token} may not be the right format try {suggestion}"
]
}
How to Use
- Include the glass nomenclature code as part of the endpoint URL.
- Send a PUT request to the API endpoint.
- Receive the parsed result or an error message based on the validity of the code.
Code Example
Here’s an example of how to call the API using curl:
curl -X PUT "http://www.glassnomenclature.com/code/6HS[12.7Ar]6FT**Low-E"
Notes
- Ensure the glass nomenclature code is URL-encoded if it contains special characters.
- The API will validate the input and return meaningful error messages to guide corrections.