- HTTP request
 - Path parameters
 - Query parameters
 - Request body
 - Response body
 - Authorization scopes
 - IAM Permissions
 - Try it!
 
Returns the contents of a file (inside a Workspace).
HTTP request
GET https://dataform.googleapis.com/v1/{workspace=projects/*/locations/*/repositories/*/workspaces/*}:readFile
The URL uses gRPC Transcoding syntax.
Path parameters
| Parameters | |
|---|---|
workspace | 
                
                   
 Required. The workspace's name. Authorization requires the following IAM permission on the specified resource  
  | 
              
Query parameters
| Parameters | |
|---|---|
path | 
                
                   
 Required. The file's full path including filename, relative to the workspace root.  | 
              
revision | 
                
                   
 Optional. The Git revision of the file to return. If left empty, the current contents of   | 
              
Request body
The request body must be empty.
Response body
workspaces.readFile response message.
If successful, the response body contains data with the following structure:
| JSON representation | 
|---|
{ "fileContents": string }  | 
                  
| Fields | |
|---|---|
fileContents | 
                    
                       
 The file's contents. A base64-encoded string.  | 
                  
Authorization scopes
Requires one of the following OAuth scopes:
https://www.googleapis.com/auth/cloud-platformhttps://www.googleapis.com/auth/bigquery
For more information, see the Authentication Overview.
IAM Permissions
Requires the following IAM permission on the workspace resource:
dataform.workspaces.readFile
For more information, see the IAM documentation.