API V1 · Resources
Delete a resource container
curl --request DELETE \ --url https://api.lingohub.com/v1/WORKSPACE_URL/projects/PROJECT_URL/resources/FILE_NAME \ --header 'Authorization: Bearer YOUR_API_KEY'import requests
url = "https://api.lingohub.com/v1/WORKSPACE_URL/projects/PROJECT_URL/resources/FILE_NAME"
headers = {"Authorization": "Bearer YOUR_API_KEY"}
response = requests.delete(url, headers=headers)
print(response.json())const url = 'https://api.lingohub.com/v1/WORKSPACE_URL/projects/PROJECT_URL/resources/FILE_NAME';const options = {method: 'DELETE', headers: {Authorization: 'Bearer YOUR_API_KEY'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}package main
import ( "fmt" "net/http" "io")
func main() {
url := "https://api.lingohub.com/v1/WORKSPACE_URL/projects/PROJECT_URL/resources/FILE_NAME"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "Bearer YOUR_API_KEY")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close() body, _ := io.ReadAll(res.Body)
fmt.Println(res) fmt.Println(string(body))
}OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder() .url("https://api.lingohub.com/v1/WORKSPACE_URL/projects/PROJECT_URL/resources/FILE_NAME") .delete(null) .addHeader("Authorization", "Bearer YOUR_API_KEY") .build();
Response response = client.newCall(request).execute();<?php
$client = new \GuzzleHttp\Client();
$response = $client->request('DELETE', 'https://api.lingohub.com/v1/WORKSPACE_URL/projects/PROJECT_URL/resources/FILE_NAME', [ 'headers' => [ 'Authorization' => 'Bearer YOUR_API_KEY', ],]);
echo $response->getBody();require 'uri'require 'net/http'
url = URI("https://api.lingohub.com/v1/WORKSPACE_URL/projects/PROJECT_URL/resources/FILE_NAME")
http = Net::HTTP.new(url.host, url.port)http.use_ssl = true
request = Net::HTTP::Delete.new(url)request["Authorization"] = 'Bearer YOUR_API_KEY'
response = http.request(request)puts response.read_bodyusing System.Net.Http.Headers;var client = new HttpClient();var request = new HttpRequestMessage{ Method = HttpMethod.Delete, RequestUri = new Uri("https://api.lingohub.com/v1/WORKSPACE_URL/projects/PROJECT_URL/resources/FILE_NAME"), Headers = { { "Authorization", "Bearer YOUR_API_KEY" }, },};using (var response = await client.SendAsync(request)){ response.EnsureSuccessStatusCode(); var body = await response.Content.ReadAsStringAsync(); Console.WriteLine(body);}Deletes the specified resource container (file) and all its associated locale files. The fileName and optional path parameters must identify the source language file of the resource container. If the specified file does not belong to the source language, the request will be rejected with a 400 error.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”WorkspaceUrl
ProjectUrl
File name of the resource file to be deleted. Has to address the source language file.
Query Parameters
Section titled “Query Parameters”File Path of the resource file to deleted. Has to address the source language file.
Name of the project branch. If omitted, the project’s default branch is used. Returns 422 if the branch name does not exist in the project.
Responses
Section titled “Responses”Successfully deleted the resource container and all its associated locale files.
Bad Request: The specified file name/path does not belong to the source language of the project.
object
Example generated
{ "url": "example", "message": "example", "text": "example"}Unauthorized: Authentication credentials are missing or invalid.
object
Example generated
{ "url": "example", "message": "example", "text": "example"}Forbidden: The authenticated user does not have resource management permission on this project.
object
Example generated
{ "url": "example", "message": "example", "text": "example"}Not Found: The specified workspace, project, or resource container does not exist.
object
Example generated
{ "url": "example", "message": "example", "text": "example"}Unprocessable Entity: The specified branch name does not exist in the project.
object
Example generated
{ "url": "example", "message": "example", "text": "example"}