Get an upload by ID
client.Uploads.Get(ctx, workspaceID, id) (*Upload, error)
GET/v1/workspaces/{workspaceId}/uploads/{id}
Retrieves the current state of an upload, including its lifecycle status
Get an upload by ID
package main
import (
"context"
"fmt"
"github.com/cadenya/cadenya-go"
"github.com/cadenya/cadenya-go/option"
)
func main() {
client := cadenya.NewClient(
option.WithAPIKey("My API Key"),
)
upload, err := client.Uploads.Get(
context.TODO(),
"workspaceId",
"id",
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", upload.Info)
}
{
"info": {
"createdBy": {
"metadata": {
"id": "id",
"accountId": "accountId",
"name": "name",
"profileId": "profileId",
"externalId": "externalId",
"labels": {
"foo": "string"
}
},
"spec": {
"type": "PROFILE_TYPE_UNSPECIFIED",
"email": "email",
"name": "name"
}
},
"status": "UPLOAD_STATUS_UNSPECIFIED",
"uploadUrl": "uploadUrl",
"uploadUrlExpiresAt": "2019-12-27T18:11:19.117Z"
},
"metadata": {
"id": "id",
"accountId": "accountId",
"createdAt": "2019-12-27T18:11:19.117Z",
"name": "name",
"profileId": "profileId",
"workspaceId": "workspaceId",
"bundleKey": "bundleKey",
"externalId": "externalId",
"labels": {
"foo": "string"
}
},
"spec": {
"contentType": "contentType",
"filename": "filename",
"sizeBytes": "sizeBytes"
}
}Returns Examples
{
"info": {
"createdBy": {
"metadata": {
"id": "id",
"accountId": "accountId",
"name": "name",
"profileId": "profileId",
"externalId": "externalId",
"labels": {
"foo": "string"
}
},
"spec": {
"type": "PROFILE_TYPE_UNSPECIFIED",
"email": "email",
"name": "name"
}
},
"status": "UPLOAD_STATUS_UNSPECIFIED",
"uploadUrl": "uploadUrl",
"uploadUrlExpiresAt": "2019-12-27T18:11:19.117Z"
},
"metadata": {
"id": "id",
"accountId": "accountId",
"createdAt": "2019-12-27T18:11:19.117Z",
"name": "name",
"profileId": "profileId",
"workspaceId": "workspaceId",
"bundleKey": "bundleKey",
"externalId": "externalId",
"labels": {
"foo": "string"
}
},
"spec": {
"contentType": "contentType",
"filename": "filename",
"sizeBytes": "sizeBytes"
}
}