Get attachment metadata
client.Attachments.Get(ctx, attachmentID) (*AttachmentGetResponse, error)
GET/v3/attachments/{attachmentId}
Retrieve metadata for a specific attachment including its status, file information, and URLs for downloading.
Get attachment metadata
package main
import (
"context"
"fmt"
"github.com/linq-team/linq-go"
"github.com/linq-team/linq-go/option"
)
func main() {
client := linqgo.NewClient(
option.WithAPIKey("My API Key"),
)
attachment, err := client.Attachments.Get(context.TODO(), "abc12345-1234-5678-9abc-def012345678")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", attachment.ID)
}
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"filename": "photo.jpg",
"content_type": "image/jpeg",
"size_bytes": 1024000,
"status": "complete",
"download_url": "https://cdn.linqapp.com/attachments/550e8400-e29b-41d4-a716-446655440000/photo.jpg",
"created_at": "2024-01-15T10:30:00Z"
}{
"error": {
"status": 401,
"code": 2004,
"message": "Unauthorized - missing or invalid authentication token"
},
"success": false
}{
"error": {
"status": 404,
"code": 2001,
"message": "Resource not found"
},
"success": false
}{
"error": {
"status": 500,
"code": 3006,
"message": "Internal server error"
},
"success": false
}Returns Examples
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"filename": "photo.jpg",
"content_type": "image/jpeg",
"size_bytes": 1024000,
"status": "complete",
"download_url": "https://cdn.linqapp.com/attachments/550e8400-e29b-41d4-a716-446655440000/photo.jpg",
"created_at": "2024-01-15T10:30:00Z"
}{
"error": {
"status": 401,
"code": 2004,
"message": "Unauthorized - missing or invalid authentication token"
},
"success": false
}{
"error": {
"status": 404,
"code": 2001,
"message": "Resource not found"
},
"success": false
}{
"error": {
"status": 500,
"code": 3006,
"message": "Internal server error"
},
"success": false
}