Get Upload
Retrieve details for a specific upload.
Endpoint
GET /v2/{team_id}/project/{project_id}/upload/{upload_id}
Authentication
This endpoint requires an API key with the upload.read scope.
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
team_id | String | Yes | The ID of the team |
project_id | String | Yes | The ID of the project |
upload_id | String | Yes | The ID of the upload to get |
Example Request
- cURL
- Typescript
- Python
- C#
curl -X GET \
'https://api.send.ai/v2/team_123456/project/proj_123456/upload/upl_abcdef123456' \
-H 'Authorization: Bearer YOUR_API_KEY'
const getUpload = async (
teamId: string,
projectId: string,
uploadId: string
): Promise<any> => {
const response = await fetch(
`https://api.send.ai/v2/${teamId}/project/${projectId}/upload/${uploadId}`,
{
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
}
);
if (!response.ok) {
throw new Error(`Failed to get upload: ${response.status} ${response.statusText}`);
}
return response.json();
};
// Example usage
getUpload('team_123456', 'proj_123456', 'upl_abcdef123456')
.then(result => console.log(result))
.catch(error => console.error(error));
import requests
def get_upload(team_id, project_id, upload_id):
url = f'https://api.send.ai/v2/{team_id}/project/{project_id}/upload/{upload_id}'
headers = {
'Authorization': 'Bearer YOUR_API_KEY'
}
response = requests.get(url, headers=headers)
response.raise_for_status() # Raise exception for 4XX/5XX responses
return response.json()
# Example usage
result = get_upload('team_123456', 'proj_123456', 'upl_abcdef123456')
print(result)
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text.Json;
using System.Threading.Tasks;
public class UploadService
{
private readonly HttpClient _client;
private readonly string _apiKey;
public UploadService(string apiKey)
{
_client = new HttpClient();
_client.BaseAddress = new Uri("https://api.send.ai/");
_apiKey = apiKey;
}
public async Task<object> GetUploadAsync(string teamId, string projectId, string uploadId)
{
// Set authorization header
_client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", _apiKey);
// Send request
var response = await _client.GetAsync($"v2/{teamId}/project/{projectId}/upload/{uploadId}");
// Ensure success
response.EnsureSuccessStatusCode();
// Parse and return response
var jsonResponse = await response.Content.ReadAsStringAsync();
return JsonSerializer.Deserialize<object>(jsonResponse);
}
}
// Example usage
public class Program
{
public static async Task Main()
{
var uploadService = new UploadService("YOUR_API_KEY");
try
{
var result = await uploadService.GetUploadAsync(
"team_123456",
"proj_123456",
"upl_abcdef123456"
);
Console.WriteLine(JsonSerializer.Serialize(result, new JsonSerializerOptions { WriteIndented = true }));
}
catch (Exception ex)
{
Console.WriteLine($"Error: {ex.Message}");
}
}
}
Response
{
"payload": {
"id": "upl_abcdef123456",
"name": "Invoice-2023-001",
"status": "IN_REVIEW",
"files": {},
"meta": [
{
"name": "reference",
"value": "INV-2023-001"
},
{
"name": "customer",
"value": "Acme Corp"
}
],
"folder_id": "folder_123456",
"created_at": "2023-06-15T10:30:00Z"
}
}
Response Parameters
| Parameter | Type | Description |
|---|---|---|
| id | string | Unique identifier for the upload |
| name | string | The name of the upload |
| status | string | Current status of the upload |
| files | object | Information about associated files |
| meta | array | Array of metadata key-value pairs |
| folder_id | string | ID of the folder containing the upload |
| created_at | string | ISO timestamp of when the upload was created |
Error Codes
| Status Code | Description |
|---|---|
| 400 | Bad request, check your request parameters |
| 401 | Unauthorized, check your API key |
| 403 | Forbidden, you don't have access to this upload |
| 404 | Not found, the specified upload does not exist |
| 500 | Server error, please try again later |