# Daily Reports — Data API Docs **App ID:** `434` **Version UUID:** `d4d4c738-bf74-4b44-a297-9a6653458f3a` **Workflow UUID:** `c420dc04-2ba3-488e-902d-66bc9a2032cd` ## Base URLs | Key | URL | | ---- | ---------------------------- | | core | `https://sandbox.getzino.in` | | view | `https://sandbox.getzino.in` | | user | `https://sandbox.getzino.in` | All requests require header `Authorization: Bearer ` (user session JWT from login). --- ## 1. Activity Submission Calls that create an instance or submit an activity's form. Init = `/start`; subsequent = `/activity`. Upload/OCR fire during fill for file-bearing fields. ### 1.1 Init Activity (init) Create a new workflow instance and run the init activity. - **Method:** `POST` - **Path:** `/app/434/start` (base: core) - **Content-Type:** `application/json` **Request body** ```json { "activity_id": "ac04a444-9b96-463d-bc91-447fa80b028f", "data": { "date": "2024-01-15", "day_plan_notes": "string_value", "field_1": "09:30", "route_code": "option_value", "sales_officer_name": "string_value", "store_image": "", "sub_route": "option_value" }, "version": 1, "workflow_uuid": "c420dc04-2ba3-488e-902d-66bc9a2032cd" } ``` **Request fields** | Key | Type | Required | Note | | ------------------ | -------- | -------- | ----------------------------- | | workflow_uuid | string | ✅ | Clone-portable workflow UID. | | activity_id | string | ✅ | The init activity UID. | | version | int | ❌ | Deployed workflow version. | | data | object | ❌ | Field values keyed by field id. | | sales_officer_name | app_user | ❌ | "Sales Officer Name" (app_user) | | date | date | ❌ | "Date" (date) | | field_1 | time | ❌ | "Time" (time) | | route_code | select | ❌ | "Route Code" (select) | | sub_route | select | ❌ | "Sub Route" (select) | | store_image | image | ❌ | "Upload Store Image" (image) | | day_plan_notes | longtext | ❌ | "Day Plan (notes)" (longtext) | ### 1.2 Punch Out Advance an existing instance through this activity (normal submission). - **Method:** `POST` - **Path:** `/app/434/activity` (base: core) - **Content-Type:** `application/json` **Request body** ```json { "activity_id": "37c218fc-fd91-41d1-9964-fcaeade54e74", "data": { "eod_notes_remarks": "string_value", "total_non_productive_calls": 123, "total_productive_calls": 123 }, "instance_id": "", "workflow_uuid": "c420dc04-2ba3-488e-902d-66bc9a2032cd" } ``` **Request fields** | Key | Type | Required | Note | | -------------------------- | -------- | -------- | ------------------------------------ | | workflow_uuid | string | ✅ | Clone-portable workflow UID. | | activity_id | string | ✅ | This activity's UID. | | instance_id | int64 | ✅ | Target instance (runtime value). | | data | object | ❌ | Field values keyed by field id. | | total_productive_calls | number | ❌ | "Total Productive Calls" (number) | | total_non_productive_calls | number | ❌ | "Total Non Productive Calls" (number) | | eod_notes_remarks | longtext | ❌ | "EOD Notes (Remarks)" (longtext) | ### 1.3 Upload file Upload a file/image during form fill; returns `blob_path` that replaces the File in the submit payload. - **Method:** `POST` - **Path:** `/app/434/upload` (base: core) - **Content-Type:** `multipart/form-data` (browser sets the boundary automatically) **Form fields** | Key | Type | Required | Note | | ------------- | ------ | -------- | ------------------------------------------- | | file | binary | ✅ | The file contents. | | workflow_uuid | string | ✅ | Fixed: `c420dc04-2ba3-488e-902d-66bc9a2032cd`. | | activity_id | string | ✅ | | | field_id | string | ✅ | | | column_id | string | ❌ | Only for grid-cell file columns. | | version_uuid | string | ❌ | | | instance_id | int64 | ❌ | Runtime value when editing an instance. | **Response body** ```json { "blob_path": "12/a1b2c3.png", "mime_type": "image/png", "original_name": "photo.png", "size_bytes": 20480, "url": "" } ``` | Key | Type | Note | | ------------- | ------ | --------------------------------------------- | | blob_path | string | Storage path that replaces the File in `data[field_id]`. | | original_name | string | | | mime_type | string | | | size_bytes | int64 | | | url | string | | ### Common submission response Applies to Init Activity and Punch Out. ```json { "data": {}, "instance_id": 1024, "message": "Activity completed successfully", "status_code": 200, "success": true } ``` | Key | Type | Note | | ----------- | ------ | --------------------------------------------------------------- | | success | bool | Whether the activity ran. | | status_code | int | HTTP status; mirrors a Response node if the trigger graph has one. | | message | string | Human-readable result; from a Response node when present. | | data | object | Response-node payload; empty object by default. | | instance_id | int64 | The workflow instance affected/created. | --- ## 2. View APIs Read endpoints that power record/detail/activity/chart views, segregated by source type with each view's UI name. ### 2.1 Record Views Paginated records + tiles + charts. - **Method:** `POST` - **Path:** `/app/434/view/recordview` (base: view) - **Content-Type:** `application/json` | UI Name | rv_template_uid | | ---------- | -------------------------------------- | | Daily Logs | `269da629-1701-477a-a37b-a78bb056d4b3` | **Request body** ```json { "params": {}, "preset_alias": "", "rv_template_uid": "269da629-1701-477a-a37b-a78bb056d4b3", "search_query": { "filters": [], "limit": 25, "page": 1, "search": "", "sort_by": "", "sort_dir": "desc" } } ``` **Request fields** | Key | Type | Required | Note | | --------------------- | ------ | -------- | ----------------------------------------------------------- | | rv_template_uid | string | ✅ | This view's template UID. | | preset_alias | string | ❌ | Optional; selects a named prefilter preset on this view. | | params | object | ❌ | Values for declared input params (`${input.}` refs). | | search_query.page | int | ❌ | 1-based page. | | search_query.limit | int | ❌ | Default 25, max 200. | | search_query.sort_by | string | ❌ | `field_key` \| `created_at` \| `updated_at` \| `instance_id`. | | search_query.sort_dir | string | ❌ | `asc` \| `desc`. | | search_query.search | string | ❌ | ILIKE term across searchable fields. | | search_query.filters | array | ❌ | `[{field_key, value, value2?, data_type}]`. | **Response body** ```json { "chart_data": [], "data": [], "pagination": { "limit": 25, "page": 1, "total_records": 0 }, "tile_values": {} } ``` | Key | Type | Note | | ----------- | ------ | ------------------------------- | | data | array | Companion-table rows. | | tile_values | object | | | chart_data | array | | | pagination | object | `{page, limit, total_records}`. | ### 2.2 Detail Views Single-instance detail record. - **Method:** `GET` - **Base:** view | UI Name | Path | | ---------- | ---------------------------------------------------------------------------- | | Daily Logs | `/app/434/view/detailview/26b3c6de-a1d7-4f71-be88-7e4929932b0b?instance_id=` | **Request fields** | Key | Type | Required | Note | | ----------- | ----- | -------- | ----------------------------------------------------------------- | | instance_id | int64 | ✅ | Query param (runtime value); some DVs use declared extra_params. | **Response body** ```json { "config": {}, "data": {} } ``` | Key | Type | Note | | ------ | ------ | ----------------- | | config | object | | | data | object | `field_key→value`. | --- ## 3. In-form Activity Helper APIs Calls a form makes while being filled, segregated per activity: lookup, workflow-lookup, app-user, dataset options, field actions, and peer-instance prefetch. ### Activity: Init Activity (`ac04a444-9b96-463d-bc91-447fa80b028f`) #### App User — Sales Officer Name App-user dropdown: open / search. - **Method:** `POST` - **Path:** `/app/434/app-user/records` (base: core) - **Content-Type:** `application/json` **Request body** ```json { "activity_id": "ac04a444-9b96-463d-bc91-447fa80b028f", "field_id": "sales_officer_name", "form_data": {}, "limit": 50, "offset": 0, "search": "", "workflow_uuid": "c420dc04-2ba3-488e-902d-66bc9a2032cd" } ``` **Request fields** | Key | Type | Required | Note | | ------------- | ------ | -------- | ----------------------------------------------- | | workflow_uuid | string | ✅ | Fixed: `c420dc04-2ba3-488e-902d-66bc9a2032cd`. | | activity_id | string | ✅ | | | field_id | string | ✅ | | | search | string | ❌ | Search term. | | limit | int | ❌ | Default 50, max 200. | | offset | int | ❌ | | | filters | array | ❌ | `[{column, operator, value}]`. | | form_data | object | ❌ | Current form values for filter_options. | | version_uuid | string | ❌ | Pins filter_options to the deployed version. | **Response body** ```json { "limit": 50, "offset": 0, "records": [], "total": 0 } ``` | Key | Type | Note | | ------- | ----- | ------------------------------------------------- | | records | array | For dataset-options this is `options:[{value,label}]`. | | total | int | | | limit | int | | | offset | int | | #### Dataset options — Route Code Dataset-backed options: mount + dependency change. - **Method:** `POST` - **Path:** `/app/434/dataset-options` (base: core) - **Content-Type:** `application/json` **Request body** ```json { "activity_id": "ac04a444-9b96-463d-bc91-447fa80b028f", "field_id": "route_code", "form_data": {}, "limit": 50, "offset": 0, "search": "", "workflow_uuid": "c420dc04-2ba3-488e-902d-66bc9a2032cd" } ``` **Request fields** | Key | Type | Required | Note | | ------------- | ------ | -------- | ----------------------------------------------- | | workflow_uuid | string | ✅ | Fixed: `c420dc04-2ba3-488e-902d-66bc9a2032cd`. | | activity_id | string | ✅ | | | field_id | string | ✅ | | | search | string | ❌ | Search term. | | limit | int | ❌ | Default 50, max 200. | | offset | int | ❌ | | | filters | array | ❌ | `[{column, operator, value}]`. | | form_data | object | ❌ | Current form values for filter_options. | | version_uuid | string | ❌ | Pins filter_options to the deployed version. | **Response body** ```json { "limit": 50, "offset": 0, "records": [], "total": 0 } ``` | Key | Type | Note | | ------- | ----- | ------------------------------------------------- | | records | array | For dataset-options this is `options:[{value,label}]`. | | total | int | | | limit | int | | | offset | int | |