An API endpoint that downloads file content using various programming languages including JavaScript Python Java and Go by sending a GET request with proper authentication headers to retrieve the raw file data.
Delete file
DELETE /organizations/{org_id}/file/{asset_id}
This endpoint deletes an uploaded file (asset), removing it from the task or kick-off form field it was attached to.
Replace {org_id}
with your Organization ID and {asset_id}
with the Asset ID of the file to delete.
Authorization: Bearer {your_access_token}
Accept: application/json
X-Tallyfy-Client: APIClient
No request body is needed for this DELETE request.
const accessToken = 'YOUR_PERSONAL_ACCESS_TOKEN';const orgId = 'YOUR_ORGANIZATION_ID';const assetId = 'ASSET_ID_TO_DELETE';const apiUrl = `https://go.tallyfy.com/api/organizations/${orgId}/file/${assetId}`;
const headers = new Headers();headers.append('Authorization', `Bearer ${accessToken}`);headers.append('Accept', 'application/json');headers.append('X-Tallyfy-Client', 'APIClient');
fetch(apiUrl, { method: 'DELETE', headers: headers}).then(response => { // Expect 200 OK on success if (response.ok) { console.log(`Successfully deleted file/asset ${assetId}. Status: ${response.status}`); // Check if body exists (might return success message) return response.text().then(text => text ? JSON.parse(text) : null); } else { // Error handling... return response.json().then(errData => { console.error(`Error deleting file/asset ${assetId}:`, errData); throw new Error(`HTTP error! status: ${response.status}`); }).catch(() => { console.error(`Error deleting file/asset ${assetId}: Status ${response.status}`); throw new Error(`HTTP error! status: ${response.status}`); }); }}).then(data => { if (data) { console.log('Delete response details (if returned):'); console.log(JSON.stringify(data, null, 2)); }}).catch(error => { console.error(`Error during deletion for ${assetId}:`, error.message);});
import requestsimport jsonimport os
access_token = os.environ.get('TALLYFY_ACCESS_TOKEN', 'YOUR_PERSONAL_ACCESS_TOKEN')org_id = os.environ.get('TALLYFY_ORG_ID', 'YOUR_ORGANIZATION_ID')asset_id = 'ASSET_ID_TO_DELETE'api_url = f'https://go.tallyfy.com/api/organizations/{org_id}/file/{asset_id}'
headers = { 'Authorization': f'Bearer {access_token}', 'Accept': 'application/json', 'X-Tallyfy-Client': 'APIClient'}
try: response = requests.delete(api_url, headers=headers) response.raise_for_status() # Expect 200 OK
print(f'Successfully deleted file/asset {asset_id}. Status: {response.status_code}') if response.content: try: delete_response = response.json() print('Delete response details (if returned):') print(json.dumps(delete_response, indent=4)) except json.JSONDecodeError: print(f"(Response body: {response.text})") else: print("(Response body is empty)")
except requests.exceptions.RequestException as e: print(f"Request failed for asset {asset_id}: {e}") if e.response is not None: print(f"Response Status: {e.response.status_code}") print(f"Response Body: {e.response.text}")
import java.net.URI;import java.net.http.HttpClient;import java.net.http.HttpRequest;import java.net.http.HttpResponse;import java.io.IOException;
public class DeleteFile { public static void main(String[] args) { String accessToken = System.getenv().getOrDefault("TALLYFY_ACCESS_TOKEN", "YOUR_PERSONAL_ACCESS_TOKEN"); String orgId = System.getenv().getOrDefault("TALLYFY_ORG_ID", "YOUR_ORGANIZATION_ID"); String assetId = "ASSET_ID_TO_DELETE"; String apiUrl = String.format("https://go.tallyfy.com/api/organizations/%s/file/%s", orgId, assetId);
HttpClient client = HttpClient.newHttpClient(); HttpRequest request = HttpRequest.newBuilder() .uri(URI.create(apiUrl)) .header("Authorization", "Bearer " + accessToken) .header("Accept", "application/json") .header("X-Tallyfy-Client", "APIClient") .DELETE() .build();
try { HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
if (response.statusCode() == 200) { System.out.println("Successfully deleted file/asset " + assetId + ". Status: " + response.statusCode()); if (response.body() != null && !response.body().isEmpty()) { System.out.println("Response Body:"); System.out.println(response.body()); // TODO: Parse JSON if applicable } else { System.out.println("(Response body is empty)"); } } else { System.err.println("Failed to delete asset " + assetId + ". Status: " + response.statusCode()); System.err.println("Response: " + response.body()); // Print error body } } catch (IOException | InterruptedException e) { System.err.println("Request failed: " + e.getMessage()); Thread.currentThread().interrupt(); } }}
package main
import ( "fmt" "io/ioutil" "net/http" "os" "time")
func main() { accessToken := os.Getenv("TALLYFY_ACCESS_TOKEN") if accessToken == "" { accessToken = "YOUR_PERSONAL_ACCESS_TOKEN" } orgId := os.Getenv("TALLYFY_ORG_ID") if orgId == "" { orgId = "YOUR_ORGANIZATION_ID" } assetId := "ASSET_ID_TO_DELETE" apiUrl := fmt.Sprintf("https://go.tallyfy.com/api/organizations/%s/file/%s", orgId, assetId)
client := &http.Client{Timeout: 10 * time.Second} req, err := http.NewRequest(http.MethodDelete, apiUrl, nil) if err != nil { fmt.Printf("Error creating request: %v\n", err) return }
req.Header.Set("Authorization", "Bearer "+accessToken) req.Header.Set("Accept", "application/json") req.Header.Set("X-Tallyfy-Client", "APIClient")
resp, err := client.Do(req) if err != nil { fmt.Printf("Error making request: %v\n", err) return } defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body) if err != nil { fmt.Printf("Error reading response body: %v\n", err) return }
if resp.StatusCode == http.StatusOK { fmt.Printf("Successfully deleted file/asset %s. Status: %d\n", assetId, resp.StatusCode) if len(body) > 0 { fmt.Println("Response Body:") fmt.Println(string(body)) // TODO: Unmarshal JSON if applicable } else { fmt.Println("(Response body is empty)") } } else { fmt.Printf("Failed to delete asset %s. Status: %d\nBody: %s\n", assetId, resp.StatusCode, string(body)) }}
#include <iostream>#include <string>#include <cpprest/http_client.h>#include <cpprest/filestream.h>
using namespace web;using namespace web::http;using namespace web::http::client;
pplx::task<void> DeleteAsset(const utility::string_t& assetId){ utility::string_t accessToken = U("YOUR_PERSONAL_ACCESS_TOKEN"); // Replace with your token utility::string_t orgId = U("YOUR_ORGANIZATION_ID"); // Replace with your org ID utility::string_t apiUrl = U("https://go.tallyfy.com/api/organizations/") + orgId + U("/file/") + assetId;
http_client client(apiUrl);
http_request request(methods::DEL); request.headers().add(U("Authorization"), U("Bearer ") + accessToken); request.headers().add(U("Accept"), U("application/json")); request.headers().add(U("X-Tallyfy-Client"), U("APIClient"));
return client.request(request).then([assetId](http_response response) { utility::string_t assetIdW = assetId; // Capture assetId for logging if (response.status_code() == status_codes::OK) { std::wcout << L"Successfully deleted file/asset " << assetIdW << L". Status: " << response.status_code() << std::endl; // Check if there's a response body to potentially parse return response.extract_string().then([assetIdW](utility::string_t body) { if (!body.empty()) { std::wcout << L"Response Body: " << body << std::endl; // Optionally parse JSON here if expected } else { std::wcout << L"(Response body is empty)" << std::endl; } }); } else { // Handle error return response.extract_string().then([response, assetIdW](utility::string_t body) { std::wcerr << L"Failed to delete asset " << assetIdW << L". Status: " << response.status_code() << std::endl; std::wcerr << L"Response Body: " << body << std::endl; // Throw an exception or indicate error return pplx::task_from_result(); // Indicate completion without success }); } });}
int main(){ utility::string_t assetToDelete = U("ASSET_ID_TO_DELETE"); // Replace with the actual asset ID try { DeleteAsset(assetToDelete).wait(); } catch (const std::exception &e) { std::cerr << "Error: " << e.what() << std::endl; } return 0;}// Note: Requires C++ REST SDK (Casablanca). Ensure proper setup and linking.
using System;using System.Net.Http;using System.Net.Http.Headers;using System.Threading.Tasks;
public class TallyfyFileActions{ private static readonly HttpClient client = new HttpClient();
public static async Task DeleteFileAsset(string assetId) { var accessToken = Environment.GetEnvironmentVariable("TALLYFY_ACCESS_TOKEN") ?? "YOUR_PERSONAL_ACCESS_TOKEN"; var orgId = Environment.GetEnvironmentVariable("TALLYFY_ORG_ID") ?? "YOUR_ORGANIZATION_ID"; var apiUrl = $"https://go.tallyfy.com/api/organizations/{orgId}/file/{assetId}";
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", accessToken); client.DefaultRequestHeaders.Accept.Clear(); client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); client.DefaultRequestHeaders.Add("X-Tallyfy-Client", "APIClient");
try { HttpResponseMessage response = await client.DeleteAsync(apiUrl); string responseBody = await response.Content.ReadAsStringAsync();
if (response.IsSuccessStatusCode) // Expect 200 OK { Console.WriteLine($"Successfully deleted file/asset {assetId}. Status: {response.StatusCode}"); if (!string.IsNullOrEmpty(responseBody)) { Console.WriteLine("Response Body:"); Console.WriteLine(responseBody); // TODO: Deserialize JSON if applicable } else { Console.WriteLine("(Response body is empty)"); } } else { Console.WriteLine($"Failed to delete asset {assetId}. Error: {response.StatusCode}"); Console.WriteLine(responseBody); } } catch (HttpRequestException e) { Console.WriteLine($"Request Exception for asset {assetId}: {e.Message}"); } }
// Example usage: // static async Task Main(string[] args) // { // string assetIdToDelete = "ASSET_ID_TO_DELETE"; // await DeleteFileAsset(assetIdToDelete); // }}
A successful request returns a 200 OK
status code and a JSON object containing a data
The GET endpoint allows retrieval of file metadata including filename upload date and related object details by providing organization ID and asset ID in the request URL path.
An API endpoint that permanently deletes standalone tasks through DELETE requests with mandatory authorization headers and returns a 204 status code upon successful deletion.
The API enables file management functionalities including uploading downloading getting metadata and removing files associated with tasks or kick-off forms.
About Tallyfy
- 2025 Tallyfy, Inc.
- Privacy Policy
- Terms of Use
- Report Issue
- Trademarks