```md Python + Script theme={null}
Build a production-minded script that extracts embedded technical metadata (EXIF and related fields) from previewable files in Box by following this tutorial:
https://developer.box.com/tutorials/extract-exif-metadata
Use Python 3.11+ with pip and a virtual environment. Install exactly one Box package: "boxsdk~=10.0" (do NOT also install box-sdk-gen — both ship the box_sdk_gen module and conflict). Import Box APIs with `from box_sdk_gen import ...`. Also install python-dotenv and pytest for tests.
Prerequisites already done in Box (see the tutorial). Do NOT try to create these; read their values from environment variables:
- Enterprise metadata template key:
(fields datetime, cameraMake, imageWidth, imageHeight, iso, colorProfile, rights, creator)
- Folder ID with previewable images: , shared with the app service account as Editor
- Enterprise ID:
- CCG app scopes enabled: Read and write all files and folders stored in Box
Mirror the Python in the tutorial for list_representations, fetch_representation (including x_rep_hints, client.make_request for info and content URLs, polling, and download), EMBEDDED_METADATA_FIELD_MAP, and create_file_metadata_by_id. Use client.files.get_file_by_id and client.file_metadata.create_file_metadata_by_id. Do not add other languages or extra Box APIs.
The app must:
1. Authenticate to Box with the Box core SDK ≥v10 using Client Credentials Grant (enterprise / service account).
Use BOX_ENTERPRISE_ID — do NOT authenticate as a managed user. Use SDK methods for Box calls. For representation info and content URLs, use the SDK request helper (Python: client.make_request) — do not use raw REST clients such as curl.
2. Implement list_representations as in the tutorial: client.files.get_file_by_id with fields=["representations"]
and print each representation type (and dimensions when present).
3. Implement fetch_representation as in the tutorial:
- client.files.get_file_by_id with fields=["representations"] and x_rep_hints=rep_hint.
- If state is none, call client.make_request on the representation info URL from the SDK response to trigger generation, then treat the state as pending.
- Poll get_file_by_id until success or viewable, or time out (max_wait_seconds=30, poll_interval=3).
- Replace {+asset_path} in url_template and download with client.make_request (binary, follow redirects).
4. Call fetch_representation with rep_hint="[embedded_metadata]".
5. Parse the JSON body. Map fields with EMBEDDED_METADATA_FIELD_MAP exactly as in the tutorial:
datetime ([0].EXIF.DateTimeOriginal, date),
cameraMake ([0].EXIF.Make, text),
imageWidth ([0].File.ImageWidth, number),
imageHeight ([0].File.ImageHeight, number),
iso ([0].EXIF.ISO, number),
colorProfile ([0].ICC_Profile.ProfileDescription, text),
rights ([0].XMP.Rights, text),
creator ([0].XMP.Creator, text).
Missing fields are OK — skip them. If no mapped fields are present, skip the metadata write (do not POST an empty body).
6. Implement _resolve_path (read a JSON path) and _coerce (convert to date, text, or number)
exactly as in the tutorial metadata sample.
7. Write selected values as Box enterprise metadata with create_file_metadata_by_id.
If the instance already exists (409), JSON-Patch update with op add as in the tutorial.
Handle write errors per file without aborting the rest of the folder.
8. Process files in BOX_FOLDER_ID using the extension filter from the tutorial.
Read configuration from environment variables:
BOX_CLIENT_ID, BOX_CLIENT_SECRET, BOX_ENTERPRISE_ID,
BOX_METADATA_TEMPLATE_KEY, and BOX_FOLDER_ID.
Create a complete runnable project with:
- list_representations, fetch_representation, EMBEDDED_METADATA_FIELD_MAP, and the metadata write path matching the tutorial modules
- a flat Python layout matching the tutorial (no unnecessary packages)
- dependency and run commands
- .env.example and .gitignore files
- focused unit tests and a README with setup and test steps
Never hard-code credentials. Add concise comments only where the Box-specific behavior is not obvious. Before writing code, summarize the architecture and list the files you will create.
```
```md Python + FastAPI theme={null}
Build a production-minded script that extracts embedded technical metadata (EXIF and related fields) from previewable files in Box by following this tutorial:
https://developer.box.com/tutorials/extract-exif-metadata
Use Python with FastAPI. Target Python 3.11+, use pip and a virtual environment. Install exactly one Box package: "boxsdk~=10.0" (do NOT also install box-sdk-gen — both ship the box_sdk_gen module and conflict). Import Box APIs with `from box_sdk_gen import ...`. Also install fastapi, uvicorn, python-dotenv, and pytest for tests.
Prerequisites already done in Box (see the tutorial). Do NOT try to create these; read their values from environment variables:
- Enterprise metadata template key:
(fields datetime, cameraMake, imageWidth, imageHeight, iso, colorProfile, rights, creator)
- Folder ID with previewable images: , shared with the app service account as Editor
- Enterprise ID:
- CCG app scopes enabled: Read and write all files and folders stored in Box
The tutorial's Python samples are a script, not a web server. Copy list_representations, fetch_representation, EMBEDDED_METADATA_FIELD_MAP, and the metadata write from those samples unchanged. Use client.make_request for representation info and content URLs. The Box Python SDK is synchronous — use plain def handlers (or run sync Box calls in a threadpool); do not await sync SDK methods. Still include a way to process BOX_FOLDER_ID without requiring a public URL.
The app must:
1. Authenticate to Box with the Box core SDK ≥v10 using Client Credentials Grant (enterprise / service account).
Use BOX_ENTERPRISE_ID — do NOT authenticate as a managed user. Use SDK methods for Box calls. For representation info and content URLs, use the SDK request helper (Python: client.make_request) — do not use raw REST clients such as curl.
2. Implement list_representations as in the tutorial: client.files.get_file_by_id with fields=["representations"]
and print each representation type (and dimensions when present).
3. Implement fetch_representation as in the tutorial:
- client.files.get_file_by_id with fields=["representations"] and x_rep_hints=rep_hint.
- If state is none, call client.make_request on the representation info URL from the SDK response to trigger generation, then treat the state as pending.
- Poll get_file_by_id until success or viewable, or time out (max_wait_seconds=30, poll_interval=3).
- Replace {+asset_path} in url_template and download with client.make_request (binary, follow redirects).
4. Call fetch_representation with rep_hint="[embedded_metadata]".
5. Parse the JSON body. Map fields with EMBEDDED_METADATA_FIELD_MAP exactly as in the tutorial:
datetime ([0].EXIF.DateTimeOriginal, date),
cameraMake ([0].EXIF.Make, text),
imageWidth ([0].File.ImageWidth, number),
imageHeight ([0].File.ImageHeight, number),
iso ([0].EXIF.ISO, number),
colorProfile ([0].ICC_Profile.ProfileDescription, text),
rights ([0].XMP.Rights, text),
creator ([0].XMP.Creator, text).
Missing fields are OK — skip them. If no mapped fields are present, skip the metadata write (do not POST an empty body).
6. Implement _resolve_path (read a JSON path) and _coerce (convert to date, text, or number)
exactly as in the tutorial metadata sample.
7. Write selected values as Box enterprise metadata with create_file_metadata_by_id.
If the instance already exists (409), JSON-Patch update with op add as in the tutorial.
Handle write errors per file without aborting the rest of the folder.
8. Process files in BOX_FOLDER_ID using the extension filter from the tutorial.
Read configuration from environment variables:
BOX_CLIENT_ID, BOX_CLIENT_SECRET, BOX_ENTERPRISE_ID,
BOX_METADATA_TEMPLATE_KEY, and BOX_FOLDER_ID.
Create a complete runnable project with:
- list_representations, fetch_representation, field map, and metadata write (same Box logic as the tutorial), plus a FastAPI app module with a CLI or POST path that processes BOX_FOLDER_ID
- an idiomatic FastAPI layout; keep Box representation and metadata modules separate from the HTTP layer
- dependency and run commands
- .env.example and .gitignore files
- focused unit tests and a README with setup and test steps
Never hard-code credentials. Add concise comments only where the Box-specific behavior is not obvious. Before writing code, summarize the architecture and list the files you will create.
```
```md TypeScript + Node theme={null}
Build a production-minded script that extracts embedded technical metadata (EXIF and related fields) from previewable files in Box by following this tutorial:
https://developer.box.com/tutorials/extract-exif-metadata
Use TypeScript on Node.js 20+. Use npm, box-node-sdk@10 (BoxClient, BoxCcgAuth, CcgConfig, BoxApiError from box-node-sdk), dotenv, tsx (or tsc), and a test runner such as node:test or vitest.
Prerequisites already done in Box (see the tutorial). Do NOT try to create these; read their values from environment variables:
- Enterprise metadata template key:
(fields datetime, cameraMake, imageWidth, imageHeight, iso, colorProfile, rights, creator)
- Folder ID with previewable images: , shared with the app service account as Editor
- Enterprise ID:
- CCG app scopes enabled: Read and write all files and folders stored in Box
The tutorial's samples are Python. Use those as the behavioral spec for listing representations, requesting [embedded_metadata], triggering generation on none, polling pending, downloading JSON, mapping the eight template fields, coercing types, and writing enterprise metadata. Adapt to box-node-sdk@10 camelCase (getFileById, makeRequest, getFolderItems, createFileMetadataById). Pass x-rep-hints as headers.xRepHints on getFileById. Use client.makeRequest for representation info and content URLs; binary content is a stream — collect it to a Buffer. Use a commonjs-friendly tsconfig (module commonjs, moduleResolution node, esModuleInterop, strict) and run with npx tsx.
The app must:
1. Authenticate to Box with the Box core SDK ≥v10 using Client Credentials Grant (enterprise / service account).
Use BOX_ENTERPRISE_ID — do NOT authenticate as a managed user. Use SDK methods for Box calls. For representation info and content URLs, use the SDK request helper (Python: client.make_request) — do not use raw REST clients such as curl.
2. Implement list_representations as in the tutorial: client.files.get_file_by_id with fields=["representations"]
and print each representation type (and dimensions when present).
3. Implement fetch_representation as in the tutorial:
- client.files.get_file_by_id with fields=["representations"] and x_rep_hints=rep_hint.
- If state is none, call client.make_request on the representation info URL from the SDK response to trigger generation, then treat the state as pending.
- Poll get_file_by_id until success or viewable, or time out (max_wait_seconds=30, poll_interval=3).
- Replace {+asset_path} in url_template and download with client.make_request (binary, follow redirects).
4. Call fetch_representation with rep_hint="[embedded_metadata]".
5. Parse the JSON body. Map fields with EMBEDDED_METADATA_FIELD_MAP exactly as in the tutorial:
datetime ([0].EXIF.DateTimeOriginal, date),
cameraMake ([0].EXIF.Make, text),
imageWidth ([0].File.ImageWidth, number),
imageHeight ([0].File.ImageHeight, number),
iso ([0].EXIF.ISO, number),
colorProfile ([0].ICC_Profile.ProfileDescription, text),
rights ([0].XMP.Rights, text),
creator ([0].XMP.Creator, text).
Missing fields are OK — skip them. If no mapped fields are present, skip the metadata write (do not POST an empty body).
6. Implement _resolve_path (read a JSON path) and _coerce (convert to date, text, or number)
exactly as in the tutorial metadata sample.
7. Write selected values as Box enterprise metadata with create_file_metadata_by_id.
If the instance already exists (409), JSON-Patch update with op add as in the tutorial.
Handle write errors per file without aborting the rest of the folder.
8. Process files in BOX_FOLDER_ID using the extension filter from the tutorial.
Read configuration from environment variables:
BOX_CLIENT_ID, BOX_CLIENT_SECRET, BOX_ENTERPRISE_ID,
BOX_METADATA_TEMPLATE_KEY, and BOX_FOLDER_ID.
Create a complete runnable project with:
- modules for listing representations, fetching embedded_metadata, mapping fields, writing metadata, and a script entrypoint that processes BOX_FOLDER_ID
- a flat TypeScript + Node layout; keep Box logic in dedicated modules
- dependency and run commands
- .env.example and .gitignore files
- focused unit tests and a README with setup and test steps
Never hard-code credentials. Add concise comments only where the Box-specific behavior is not obvious. Before writing code, summarize the architecture and list the files you will create.
```
```md TypeScript + Fastify theme={null}
Build a production-minded script that extracts embedded technical metadata (EXIF and related fields) from previewable files in Box by following this tutorial:
https://developer.box.com/tutorials/extract-exif-metadata
Use TypeScript with Fastify on Node.js 20+. Use npm, box-node-sdk@10 (BoxClient, BoxCcgAuth, CcgConfig, BoxApiError from box-node-sdk), fastify, dotenv, tsx (or tsc), and a test runner such as node:test or vitest.
Prerequisites already done in Box (see the tutorial). Do NOT try to create these; read their values from environment variables:
- Enterprise metadata template key:
(fields datetime, cameraMake, imageWidth, imageHeight, iso, colorProfile, rights, creator)
- Folder ID with previewable images: , shared with the app service account as Editor
- Enterprise ID:
- CCG app scopes enabled: Read and write all files and folders stored in Box
The tutorial's samples are Python. Use those as the behavioral spec for representations, [embedded_metadata], field mapping, and metadata write. Adapt to box-node-sdk@10 camelCase (getFileById, makeRequest). Pass x-rep-hints as headers.xRepHints. Binary makeRequest content is a stream — collect it to a Buffer. Fastify is optional HTTP wrapping — still include a way to process BOX_FOLDER_ID without requiring a public URL.
The app must:
1. Authenticate to Box with the Box core SDK ≥v10 using Client Credentials Grant (enterprise / service account).
Use BOX_ENTERPRISE_ID — do NOT authenticate as a managed user. Use SDK methods for Box calls. For representation info and content URLs, use the SDK request helper (Python: client.make_request) — do not use raw REST clients such as curl.
2. Implement list_representations as in the tutorial: client.files.get_file_by_id with fields=["representations"]
and print each representation type (and dimensions when present).
3. Implement fetch_representation as in the tutorial:
- client.files.get_file_by_id with fields=["representations"] and x_rep_hints=rep_hint.
- If state is none, call client.make_request on the representation info URL from the SDK response to trigger generation, then treat the state as pending.
- Poll get_file_by_id until success or viewable, or time out (max_wait_seconds=30, poll_interval=3).
- Replace {+asset_path} in url_template and download with client.make_request (binary, follow redirects).
4. Call fetch_representation with rep_hint="[embedded_metadata]".
5. Parse the JSON body. Map fields with EMBEDDED_METADATA_FIELD_MAP exactly as in the tutorial:
datetime ([0].EXIF.DateTimeOriginal, date),
cameraMake ([0].EXIF.Make, text),
imageWidth ([0].File.ImageWidth, number),
imageHeight ([0].File.ImageHeight, number),
iso ([0].EXIF.ISO, number),
colorProfile ([0].ICC_Profile.ProfileDescription, text),
rights ([0].XMP.Rights, text),
creator ([0].XMP.Creator, text).
Missing fields are OK — skip them. If no mapped fields are present, skip the metadata write (do not POST an empty body).
6. Implement _resolve_path (read a JSON path) and _coerce (convert to date, text, or number)
exactly as in the tutorial metadata sample.
7. Write selected values as Box enterprise metadata with create_file_metadata_by_id.
If the instance already exists (409), JSON-Patch update with op add as in the tutorial.
Handle write errors per file without aborting the rest of the folder.
8. Process files in BOX_FOLDER_ID using the extension filter from the tutorial.
Read configuration from environment variables:
BOX_CLIENT_ID, BOX_CLIENT_SECRET, BOX_ENTERPRISE_ID,
BOX_METADATA_TEMPLATE_KEY, and BOX_FOLDER_ID.
Create a complete runnable project with:
- modules for listing representations, fetching embedded_metadata, mapping fields, and writing metadata (same Box logic as the tutorial), plus a Fastify app with a CLI or POST path that processes BOX_FOLDER_ID
- an idiomatic Fastify + TypeScript layout; keep Box representation and metadata modules separate from the HTTP layer
- dependency and run commands
- .env.example and .gitignore files
- focused unit tests and a README with setup and test steps
Never hard-code credentials. Add concise comments only where the Box-specific behavior is not obvious. Before writing code, summarize the architecture and list the files you will create.
```
```md Node + Script theme={null}
Build a production-minded script that extracts embedded technical metadata (EXIF and related fields) from previewable files in Box by following this tutorial:
https://developer.box.com/tutorials/extract-exif-metadata
Use Node.js 20+ with JavaScript (not TypeScript). Use npm and exactly one Box package: box-node-sdk@10 (do NOT also install box-typescript-sdk-gen). Import BoxClient, BoxCcgAuth, CcgConfig, and BoxApiError from box-node-sdk. Also install dotenv and a test runner such as node:test.
Prerequisites already done in Box (see the tutorial). Do NOT try to create these; read their values from environment variables:
- Enterprise metadata template key:
(fields datetime, cameraMake, imageWidth, imageHeight, iso, colorProfile, rights, creator)
- Folder ID with previewable images: , shared with the app service account as Editor
- Enterprise ID:
- CCG app scopes enabled: Read and write all files and folders stored in Box
The tutorial's samples are Python. Use those as the behavioral spec for listing representations, requesting [embedded_metadata], triggering generation on none, polling pending, downloading JSON, mapping the eight template fields, coercing types, and writing enterprise metadata. Adapt to box-node-sdk@10 camelCase (getFileById, makeRequest). Pass x-rep-hints as headers.xRepHints. Binary makeRequest content is a stream — collect it to a Buffer.
The app must:
1. Authenticate to Box with the Box core SDK ≥v10 using Client Credentials Grant (enterprise / service account).
Use BOX_ENTERPRISE_ID — do NOT authenticate as a managed user. Use SDK methods for Box calls. For representation info and content URLs, use the SDK request helper (Python: client.make_request) — do not use raw REST clients such as curl.
2. Implement list_representations as in the tutorial: client.files.get_file_by_id with fields=["representations"]
and print each representation type (and dimensions when present).
3. Implement fetch_representation as in the tutorial:
- client.files.get_file_by_id with fields=["representations"] and x_rep_hints=rep_hint.
- If state is none, call client.make_request on the representation info URL from the SDK response to trigger generation, then treat the state as pending.
- Poll get_file_by_id until success or viewable, or time out (max_wait_seconds=30, poll_interval=3).
- Replace {+asset_path} in url_template and download with client.make_request (binary, follow redirects).
4. Call fetch_representation with rep_hint="[embedded_metadata]".
5. Parse the JSON body. Map fields with EMBEDDED_METADATA_FIELD_MAP exactly as in the tutorial:
datetime ([0].EXIF.DateTimeOriginal, date),
cameraMake ([0].EXIF.Make, text),
imageWidth ([0].File.ImageWidth, number),
imageHeight ([0].File.ImageHeight, number),
iso ([0].EXIF.ISO, number),
colorProfile ([0].ICC_Profile.ProfileDescription, text),
rights ([0].XMP.Rights, text),
creator ([0].XMP.Creator, text).
Missing fields are OK — skip them. If no mapped fields are present, skip the metadata write (do not POST an empty body).
6. Implement _resolve_path (read a JSON path) and _coerce (convert to date, text, or number)
exactly as in the tutorial metadata sample.
7. Write selected values as Box enterprise metadata with create_file_metadata_by_id.
If the instance already exists (409), JSON-Patch update with op add as in the tutorial.
Handle write errors per file without aborting the rest of the folder.
8. Process files in BOX_FOLDER_ID using the extension filter from the tutorial.
Read configuration from environment variables:
BOX_CLIENT_ID, BOX_CLIENT_SECRET, BOX_ENTERPRISE_ID,
BOX_METADATA_TEMPLATE_KEY, and BOX_FOLDER_ID.
Create a complete runnable project with:
- modules for listing representations, fetching embedded_metadata, mapping fields, writing metadata, and a script entrypoint that processes BOX_FOLDER_ID
- a flat JavaScript layout; keep Box logic in dedicated modules
- dependency and run commands
- .env.example and .gitignore files
- focused unit tests and a README with setup and test steps
Never hard-code credentials. Add concise comments only where the Box-specific behavior is not obvious. Before writing code, summarize the architecture and list the files you will create.
```
```md Node + NestJS theme={null}
Build a production-minded script that extracts embedded technical metadata (EXIF and related fields) from previewable files in Box by following this tutorial:
https://developer.box.com/tutorials/extract-exif-metadata
Use Node.js 20+ with NestJS. NestJS projects use TypeScript by default. Use npm and exactly one Box package: box-node-sdk@10 (do NOT also install box-typescript-sdk-gen). Import BoxClient, BoxCcgAuth, CcgConfig, and BoxApiError from box-node-sdk. Also install @nestjs/core, @nestjs/common, @nestjs/platform-express, dotenv, and a test runner such as Jest.
Prerequisites already done in Box (see the tutorial). Do NOT try to create these; read their values from environment variables:
- Enterprise metadata template key:
(fields datetime, cameraMake, imageWidth, imageHeight, iso, colorProfile, rights, creator)
- Folder ID with previewable images: , shared with the app service account as Editor
- Enterprise ID:
- CCG app scopes enabled: Read and write all files and folders stored in Box
The tutorial's samples are Python. Use those as the behavioral spec for representations, [embedded_metadata], field mapping, and metadata write. Adapt to box-node-sdk@10 camelCase (getFileById, makeRequest). Pass x-rep-hints as headers.xRepHints. Binary makeRequest content is a stream — collect it to a Buffer. NestJS is optional HTTP wrapping — still include a way to process BOX_FOLDER_ID without requiring a public URL.
The app must:
1. Authenticate to Box with the Box core SDK ≥v10 using Client Credentials Grant (enterprise / service account).
Use BOX_ENTERPRISE_ID — do NOT authenticate as a managed user. Use SDK methods for Box calls. For representation info and content URLs, use the SDK request helper (Python: client.make_request) — do not use raw REST clients such as curl.
2. Implement list_representations as in the tutorial: client.files.get_file_by_id with fields=["representations"]
and print each representation type (and dimensions when present).
3. Implement fetch_representation as in the tutorial:
- client.files.get_file_by_id with fields=["representations"] and x_rep_hints=rep_hint.
- If state is none, call client.make_request on the representation info URL from the SDK response to trigger generation, then treat the state as pending.
- Poll get_file_by_id until success or viewable, or time out (max_wait_seconds=30, poll_interval=3).
- Replace {+asset_path} in url_template and download with client.make_request (binary, follow redirects).
4. Call fetch_representation with rep_hint="[embedded_metadata]".
5. Parse the JSON body. Map fields with EMBEDDED_METADATA_FIELD_MAP exactly as in the tutorial:
datetime ([0].EXIF.DateTimeOriginal, date),
cameraMake ([0].EXIF.Make, text),
imageWidth ([0].File.ImageWidth, number),
imageHeight ([0].File.ImageHeight, number),
iso ([0].EXIF.ISO, number),
colorProfile ([0].ICC_Profile.ProfileDescription, text),
rights ([0].XMP.Rights, text),
creator ([0].XMP.Creator, text).
Missing fields are OK — skip them. If no mapped fields are present, skip the metadata write (do not POST an empty body).
6. Implement _resolve_path (read a JSON path) and _coerce (convert to date, text, or number)
exactly as in the tutorial metadata sample.
7. Write selected values as Box enterprise metadata with create_file_metadata_by_id.
If the instance already exists (409), JSON-Patch update with op add as in the tutorial.
Handle write errors per file without aborting the rest of the folder.
8. Process files in BOX_FOLDER_ID using the extension filter from the tutorial.
Read configuration from environment variables:
BOX_CLIENT_ID, BOX_CLIENT_SECRET, BOX_ENTERPRISE_ID,
BOX_METADATA_TEMPLATE_KEY, and BOX_FOLDER_ID.
Create a complete runnable project with:
- a Box client provider, representation provider, metadata provider, and a CLI or controller path that processes BOX_FOLDER_ID
- an idiomatic NestJS layout (module, providers); keep Box client, representations, and metadata in dedicated providers separate from any HTTP controller
- dependency and run commands
- .env.example and .gitignore files
- focused unit tests and a README with setup and test steps
Never hard-code credentials. Add concise comments only where the Box-specific behavior is not obvious. Before writing code, summarize the architecture and list the files you will create.
```
```md Java + CLI theme={null}
Build a production-minded script that extracts embedded technical metadata (EXIF and related fields) from previewable files in Box by following this tutorial:
https://developer.box.com/tutorials/extract-exif-metadata
Use Java 17+ with a Maven or Gradle CLI application. Use exactly one Box artifact: com.box:box-java-sdk version 10 or later (do NOT also add box-java-sdk-gen). Use BoxClient, BoxCCGAuth, CCGConfig, BoxAPIError, and file/metadata types from that SDK (packages under com.box.sdkgen). Also add a test starter such as JUnit 5.
Prerequisites already done in Box (see the tutorial). Do NOT try to create these; read their values from environment variables:
- Enterprise metadata template key:
(fields datetime, cameraMake, imageWidth, imageHeight, iso, colorProfile, rights, creator)
- Folder ID with previewable images: , shared with the app service account as Editor
- Enterprise ID:
- CCG app scopes enabled: Read and write all files and folders stored in Box
The tutorial's samples are Python. Use those as the behavioral spec for listing representations, requesting [embedded_metadata] via x_rep_hints, triggering generation on none, polling pending, downloading JSON, mapping the eight template fields, coercing types, and writing enterprise metadata. Adapt to box-java-sdk v10. Use BoxClient.makeRequest with FetchOptions for the representation info and content URLs.
The app must:
1. Authenticate to Box with the Box core SDK ≥v10 using Client Credentials Grant (enterprise / service account).
Use BOX_ENTERPRISE_ID — do NOT authenticate as a managed user. Use SDK methods for Box calls. For representation info and content URLs, use the SDK request helper (Python: client.make_request) — do not use raw REST clients such as curl.
2. Implement list_representations as in the tutorial: client.files.get_file_by_id with fields=["representations"]
and print each representation type (and dimensions when present).
3. Implement fetch_representation as in the tutorial:
- client.files.get_file_by_id with fields=["representations"] and x_rep_hints=rep_hint.
- If state is none, call client.make_request on the representation info URL from the SDK response to trigger generation, then treat the state as pending.
- Poll get_file_by_id until success or viewable, or time out (max_wait_seconds=30, poll_interval=3).
- Replace {+asset_path} in url_template and download with client.make_request (binary, follow redirects).
4. Call fetch_representation with rep_hint="[embedded_metadata]".
5. Parse the JSON body. Map fields with EMBEDDED_METADATA_FIELD_MAP exactly as in the tutorial:
datetime ([0].EXIF.DateTimeOriginal, date),
cameraMake ([0].EXIF.Make, text),
imageWidth ([0].File.ImageWidth, number),
imageHeight ([0].File.ImageHeight, number),
iso ([0].EXIF.ISO, number),
colorProfile ([0].ICC_Profile.ProfileDescription, text),
rights ([0].XMP.Rights, text),
creator ([0].XMP.Creator, text).
Missing fields are OK — skip them. If no mapped fields are present, skip the metadata write (do not POST an empty body).
6. Implement _resolve_path (read a JSON path) and _coerce (convert to date, text, or number)
exactly as in the tutorial metadata sample.
7. Write selected values as Box enterprise metadata with create_file_metadata_by_id.
If the instance already exists (409), JSON-Patch update with op add as in the tutorial.
Handle write errors per file without aborting the rest of the folder.
8. Process files in BOX_FOLDER_ID using the extension filter from the tutorial.
Read configuration from environment variables:
BOX_CLIENT_ID, BOX_CLIENT_SECRET, BOX_ENTERPRISE_ID,
BOX_METADATA_TEMPLATE_KEY, and BOX_FOLDER_ID.
Create a complete runnable project with:
- a Box client factory, representation helper, field-map/metadata writer, and a main class that processes BOX_FOLDER_ID
- an idiomatic Java CLI layout; keep Box client, representations, and metadata in dedicated classes separate from main
- dependency and run commands
- .env.example and .gitignore files
- focused unit tests and a README with setup and test steps
Never hard-code credentials. Add concise comments only where the Box-specific behavior is not obvious. Before writing code, summarize the architecture and list the files you will create.
```
```md Java + Spring Boot theme={null}
Build a production-minded script that extracts embedded technical metadata (EXIF and related fields) from previewable files in Box by following this tutorial:
https://developer.box.com/tutorials/extract-exif-metadata
Use Java 17+ with Spring Boot 3. Use Maven or Gradle and exactly one Box artifact: com.box:box-java-sdk version 10 or later (do NOT also add box-java-sdk-gen). Use BoxClient, BoxCCGAuth, CCGConfig, BoxAPIError, and file/metadata types from that SDK (packages under com.box.sdkgen). Also use spring-boot-starter-web and a test starter such as spring-boot-starter-test.
Prerequisites already done in Box (see the tutorial). Do NOT try to create these; read their values from environment variables:
- Enterprise metadata template key:
(fields datetime, cameraMake, imageWidth, imageHeight, iso, colorProfile, rights, creator)
- Folder ID with previewable images: , shared with the app service account as Editor
- Enterprise ID:
- CCG app scopes enabled: Read and write all files and folders stored in Box
The tutorial's samples are Python. Use those as the behavioral spec for representations, [embedded_metadata], field mapping, and metadata write. Adapt to box-java-sdk v10. Use BoxClient.makeRequest with FetchOptions for representation info and content URLs. Spring Web is optional HTTP wrapping — still include a way to process BOX_FOLDER_ID without requiring a public URL.
The app must:
1. Authenticate to Box with the Box core SDK ≥v10 using Client Credentials Grant (enterprise / service account).
Use BOX_ENTERPRISE_ID — do NOT authenticate as a managed user. Use SDK methods for Box calls. For representation info and content URLs, use the SDK request helper (Python: client.make_request) — do not use raw REST clients such as curl.
2. Implement list_representations as in the tutorial: client.files.get_file_by_id with fields=["representations"]
and print each representation type (and dimensions when present).
3. Implement fetch_representation as in the tutorial:
- client.files.get_file_by_id with fields=["representations"] and x_rep_hints=rep_hint.
- If state is none, call client.make_request on the representation info URL from the SDK response to trigger generation, then treat the state as pending.
- Poll get_file_by_id until success or viewable, or time out (max_wait_seconds=30, poll_interval=3).
- Replace {+asset_path} in url_template and download with client.make_request (binary, follow redirects).
4. Call fetch_representation with rep_hint="[embedded_metadata]".
5. Parse the JSON body. Map fields with EMBEDDED_METADATA_FIELD_MAP exactly as in the tutorial:
datetime ([0].EXIF.DateTimeOriginal, date),
cameraMake ([0].EXIF.Make, text),
imageWidth ([0].File.ImageWidth, number),
imageHeight ([0].File.ImageHeight, number),
iso ([0].EXIF.ISO, number),
colorProfile ([0].ICC_Profile.ProfileDescription, text),
rights ([0].XMP.Rights, text),
creator ([0].XMP.Creator, text).
Missing fields are OK — skip them. If no mapped fields are present, skip the metadata write (do not POST an empty body).
6. Implement _resolve_path (read a JSON path) and _coerce (convert to date, text, or number)
exactly as in the tutorial metadata sample.
7. Write selected values as Box enterprise metadata with create_file_metadata_by_id.
If the instance already exists (409), JSON-Patch update with op add as in the tutorial.
Handle write errors per file without aborting the rest of the folder.
8. Process files in BOX_FOLDER_ID using the extension filter from the tutorial.
Read configuration from environment variables:
BOX_CLIENT_ID, BOX_CLIENT_SECRET, BOX_ENTERPRISE_ID,
BOX_METADATA_TEMPLATE_KEY, and BOX_FOLDER_ID.
Create a complete runnable project with:
- a Box client configuration/bean, representation service, metadata service, and a CLI or controller path that processes BOX_FOLDER_ID
- an idiomatic Spring Boot layout; keep Box client, representations, and metadata in dedicated classes separate from the HTTP controller
- dependency and run commands
- .env.example and .gitignore files
- focused unit tests and a README with setup and test steps
Never hard-code credentials. Add concise comments only where the Box-specific behavior is not obvious. Before writing code, summarize the architecture and list the files you will create.
```
```md .NET + Console theme={null}
Build a production-minded script that extracts embedded technical metadata (EXIF and related fields) from previewable files in Box by following this tutorial:
https://developer.box.com/tutorials/extract-exif-metadata
Use .NET 8+ with a console application. Use NuGet and exactly one Box package: Box.V2.Core version 10 or later (do NOT also install Box.Sdk.Gen — v10 of Box.V2.Core already ships the generated client). Use BoxClient, BoxCcgAuth, CcgConfig, and BoxApiException (or the SDK's API error type) from that package. Also add a test SDK such as xUnit.
Prerequisites already done in Box (see the tutorial). Do NOT try to create these; read their values from environment variables:
- Enterprise metadata template key:
(fields datetime, cameraMake, imageWidth, imageHeight, iso, colorProfile, rights, creator)
- Folder ID with previewable images: , shared with the app service account as Editor
- Enterprise ID:
- CCG app scopes enabled: Read and write all files and folders stored in Box
The tutorial's samples are Python. Use those as the behavioral spec for listing representations, requesting [embedded_metadata], triggering generation on none, polling pending, downloading JSON, mapping the eight template fields, coercing types, and writing enterprise metadata. Adapt to Box.V2.Core v10. Use client.MakeRequestAsync with FetchOptions for representation info and content URLs.
The app must:
1. Authenticate to Box with the Box core SDK ≥v10 using Client Credentials Grant (enterprise / service account).
Use BOX_ENTERPRISE_ID — do NOT authenticate as a managed user. Use SDK methods for Box calls. For representation info and content URLs, use the SDK request helper (Python: client.make_request) — do not use raw REST clients such as curl.
2. Implement list_representations as in the tutorial: client.files.get_file_by_id with fields=["representations"]
and print each representation type (and dimensions when present).
3. Implement fetch_representation as in the tutorial:
- client.files.get_file_by_id with fields=["representations"] and x_rep_hints=rep_hint.
- If state is none, call client.make_request on the representation info URL from the SDK response to trigger generation, then treat the state as pending.
- Poll get_file_by_id until success or viewable, or time out (max_wait_seconds=30, poll_interval=3).
- Replace {+asset_path} in url_template and download with client.make_request (binary, follow redirects).
4. Call fetch_representation with rep_hint="[embedded_metadata]".
5. Parse the JSON body. Map fields with EMBEDDED_METADATA_FIELD_MAP exactly as in the tutorial:
datetime ([0].EXIF.DateTimeOriginal, date),
cameraMake ([0].EXIF.Make, text),
imageWidth ([0].File.ImageWidth, number),
imageHeight ([0].File.ImageHeight, number),
iso ([0].EXIF.ISO, number),
colorProfile ([0].ICC_Profile.ProfileDescription, text),
rights ([0].XMP.Rights, text),
creator ([0].XMP.Creator, text).
Missing fields are OK — skip them. If no mapped fields are present, skip the metadata write (do not POST an empty body).
6. Implement _resolve_path (read a JSON path) and _coerce (convert to date, text, or number)
exactly as in the tutorial metadata sample.
7. Write selected values as Box enterprise metadata with create_file_metadata_by_id.
If the instance already exists (409), JSON-Patch update with op add as in the tutorial.
Handle write errors per file without aborting the rest of the folder.
8. Process files in BOX_FOLDER_ID using the extension filter from the tutorial.
Read configuration from environment variables:
BOX_CLIENT_ID, BOX_CLIENT_SECRET, BOX_ENTERPRISE_ID,
BOX_METADATA_TEMPLATE_KEY, and BOX_FOLDER_ID.
Create a complete runnable project with:
- a Box client factory, representation helper, field-map/metadata writer, and Program.cs that processes BOX_FOLDER_ID
- an idiomatic .NET console layout; keep Box client, representations, and metadata in dedicated classes separate from Program
- dependency and run commands
- .env.example and .gitignore files
- focused unit tests and a README with setup and test steps
Never hard-code credentials. Add concise comments only where the Box-specific behavior is not obvious. Before writing code, summarize the architecture and list the files you will create.
```
```md .NET + ASP.NET Core theme={null}
Build a production-minded script that extracts embedded technical metadata (EXIF and related fields) from previewable files in Box by following this tutorial:
https://developer.box.com/tutorials/extract-exif-metadata
Use .NET 8+ with ASP.NET Core. Use NuGet and exactly one Box package: Box.V2.Core version 10 or later (do NOT also install Box.Sdk.Gen — v10 of Box.V2.Core already ships the generated client). Use BoxClient, BoxCcgAuth, CcgConfig, and BoxApiException (or the SDK's API error type) from that package. Also add Microsoft.AspNetCore.App and a test SDK such as xUnit.
Prerequisites already done in Box (see the tutorial). Do NOT try to create these; read their values from environment variables:
- Enterprise metadata template key:
(fields datetime, cameraMake, imageWidth, imageHeight, iso, colorProfile, rights, creator)
- Folder ID with previewable images: , shared with the app service account as Editor
- Enterprise ID:
- CCG app scopes enabled: Read and write all files and folders stored in Box
The tutorial's samples are Python. Use those as the behavioral spec for representations, [embedded_metadata], field mapping, and metadata write. Adapt to Box.V2.Core v10. Use client.MakeRequestAsync with FetchOptions for representation info and content URLs. ASP.NET Core is optional HTTP wrapping — still include a way to process BOX_FOLDER_ID without requiring a public URL.
The app must:
1. Authenticate to Box with the Box core SDK ≥v10 using Client Credentials Grant (enterprise / service account).
Use BOX_ENTERPRISE_ID — do NOT authenticate as a managed user. Use SDK methods for Box calls. For representation info and content URLs, use the SDK request helper (Python: client.make_request) — do not use raw REST clients such as curl.
2. Implement list_representations as in the tutorial: client.files.get_file_by_id with fields=["representations"]
and print each representation type (and dimensions when present).
3. Implement fetch_representation as in the tutorial:
- client.files.get_file_by_id with fields=["representations"] and x_rep_hints=rep_hint.
- If state is none, call client.make_request on the representation info URL from the SDK response to trigger generation, then treat the state as pending.
- Poll get_file_by_id until success or viewable, or time out (max_wait_seconds=30, poll_interval=3).
- Replace {+asset_path} in url_template and download with client.make_request (binary, follow redirects).
4. Call fetch_representation with rep_hint="[embedded_metadata]".
5. Parse the JSON body. Map fields with EMBEDDED_METADATA_FIELD_MAP exactly as in the tutorial:
datetime ([0].EXIF.DateTimeOriginal, date),
cameraMake ([0].EXIF.Make, text),
imageWidth ([0].File.ImageWidth, number),
imageHeight ([0].File.ImageHeight, number),
iso ([0].EXIF.ISO, number),
colorProfile ([0].ICC_Profile.ProfileDescription, text),
rights ([0].XMP.Rights, text),
creator ([0].XMP.Creator, text).
Missing fields are OK — skip them. If no mapped fields are present, skip the metadata write (do not POST an empty body).
6. Implement _resolve_path (read a JSON path) and _coerce (convert to date, text, or number)
exactly as in the tutorial metadata sample.
7. Write selected values as Box enterprise metadata with create_file_metadata_by_id.
If the instance already exists (409), JSON-Patch update with op add as in the tutorial.
Handle write errors per file without aborting the rest of the folder.
8. Process files in BOX_FOLDER_ID using the extension filter from the tutorial.
Read configuration from environment variables:
BOX_CLIENT_ID, BOX_CLIENT_SECRET, BOX_ENTERPRISE_ID,
BOX_METADATA_TEMPLATE_KEY, and BOX_FOLDER_ID.
Create a complete runnable project with:
- a Box client factory/service, representation service, metadata service, and a CLI or controller path that processes BOX_FOLDER_ID
- an idiomatic ASP.NET Core layout; keep Box client, representations, and metadata in dedicated services separate from the API controller
- dependency and run commands
- .env.example and .gitignore files
- focused unit tests and a README with setup and test steps
Never hard-code credentials. Add concise comments only where the Box-specific behavior is not obvious. Before writing code, summarize the architecture and list the files you will create.
```
Review generated code before using it in production. Never paste Box credentials into your
coding agent.