# setCellResolution **Endpoint:** `POST https://firesim.cs.gsu.edu/api/setCellResolution` Set the size of each cell and the dimensions of the cell space. Defaults: resolution=30, dimension=200. Uploading a custom fuel map will override the dimension automatically. ## Parameters | Name | Type | Required | Default | Description | |------|------|----------|---------|-------------| | `userToken` | string | yes | — | Your simulation token. | | `cellResolution` | integer | yes | — | Cubic area of each cell. | | `cellDimension` | integer | yes | — | Height and width of the cell space (square grid). | ## Responses ### HTTP 200 Cell resolution set successfully. **Example:** ```json "Updated Cell resolution" ``` ### HTTP 400 Bad request. Observed when: Invalid: cellResolution float. **Example:** ```json "" ``` ### HTTP 500 Internal server error (Spring JSON). Returned when `userToken` is missing or invalid — the server cannot locate the simulation instance for that token. **Example:** ```json { "timestamp": "2026-05-20T16:41:20.323+00:00", "status": 500, "error": "Internal Server Error", "path": "/api/setCellResolution" } ``` ## Examples ### Python ```python import requests base_url: str = "https://firesim.cs.gsu.edu/api/setCellResolution/" params: dict[str, int | str] = { "userToken": "abc123xyz", "cellResolution": 30, "cellDimension": 200, } response = requests.post(base_url, params=params) print(response.text) ``` ### JavaScript ```javascript /** @type {string} */ const BASE_URL = "https://firesim.cs.gsu.edu/api/setCellResolution/"; const params = { userToken: "abc123xyz", cellResolution: 30, cellDimension: 200, }; const url = new URL(BASE_URL); Object.entries(params).forEach(([k, v]) => url.searchParams.set(k, v)); fetch(url.toString(), { method: "POST" }) .then(res => res.text()) .then(console.log); ``` ### cURL ```bash BASE_URL="https://firesim.cs.gsu.edu/api/setCellResolution/" curl -s -X POST \ -G --data-urlencode "userToken=abc123xyz" \ -G --data-urlencode "cellResolution=30" \ -G --data-urlencode "cellDimension=200" \ "$BASE_URL" ``` ### Java ```java import java.net.URI; import java.net.http.*; String BASE_URL = "https://firesim.cs.gsu.edu/api/setCellResolution/"; String queryString = "userToken=abc123xyz" + "&" + "cellResolution=30" + "&" + "cellDimension=200"; HttpRequest request = HttpRequest.newBuilder() .uri(URI.create(BASE_URL + "?" + queryString)) .POST(HttpRequest.BodyPublishers.noBody()) .build(); HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString()); System.out.println(response.body()); ``` ### Go ```go import ( "fmt" "io" "net/http" "net/url" ) baseURL := "https://firesim.cs.gsu.edu/api/setCellResolution/" params := url.Values{} params.Set("userToken", "abc123xyz") params.Set("cellResolution", "30") params.Set("cellDimension", "200") resp, _ := http.PostForm(baseURL, params) defer resp.Body.Close() body, _ := io.ReadAll(resp.Body) fmt.Println(string(body)) ``` ### Rust ```rust use reqwest::blocking::Client; let base_url = "https://firesim.cs.gsu.edu/api/setCellResolution/"; let params = vec![ ("userToken", "abc123xyz"), ("cellResolution", "30"), ("cellDimension", "200"), ]; let client = Client::new(); let response = client.post(base_url).query(¶ms).send().unwrap(); println!("{}", response.text().unwrap()); ```