1. API
  2. Apps

Replace files

Description

Replace all draft files in an app.

See the Get Apps API to learn more about apps.

Request

HTTP Method: PUT

Endpoint: /api/v1/apps/{id}/files

Parameter Description
id The ID of the app whose draft files should be replaced.
files The complete set of draft files. Existing files omitted from this array are deleted.
files[].path The file path. One file must have the path App.tsx.
files[].contents Optional The file contents. Defaults to an empty string.

Sample request

curl --proto '=https' --tlsv1.2 -X PUT \
  https://<tenant-domain>/api/v1/apps/42/files \
  -H 'content-type: application/json' \
  -H 'Authorization: Bearer <<CREDENTIAL.tines_api_key>>' \
  -d '{
        "files": [
          {
            "path": "App.tsx",
            "contents": "export default function App() { return <h1>Hello</h1>; }"
          }
        ]
      }'

Response

A successful request returns a 200 status and the app's complete set of draft files.

Field description

Parameter Description
files The app's complete set of draft files.
files[].path The file path.
files[].contents The file contents.

Sample response

{
  "files": [
    {
      "path": "App.tsx",
      "contents": "export default function App() { return <h1>Hello</h1>; }"
    }
  ]
}
Was this helpful?
Replace files | API | Tines