Groupilot Docs
Référence API

Media

Start an upload

POST
/media/uploads

Returns a one-time URL to PUT the file to (10 minutes), then call complete. Limits: image 16 MB (jpg, png), video 40 MB (mp4, mov, 3gp), voice 16 MB (ogg, m4a, wav, mp3), document 100 MB.

Authorization

bearerAuth
headerAuthorizationBearer <token>

An API key created in Settings > Integrations (gp_live_…), or an OAuth access token.

Request Body

application/json
  1. body
kind*MediaKind
Value in"image""video""voice""document"
filename*string
Length1 <= length <= 200

Response Body

Upload slot.

application/json
  1. response
id*string
Formatuuid
upload_url*string

PUT the file body here (header Content-Type set), then call complete.

Formaturi
expires_at*string

ISO 8601 date-time with offset.

Formatdate-time
max_bytes*integer
allowed_extensions*array<string>
curl -X POST 'https://app.groupilot.com/api/v1/media/uploads' \  -H 'Content-Type: application/json' \  -d '{  "kind": "image",  "filename": "string"}'
{  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "upload_url": "http://example.com",  "expires_at": "2019-08-24T14:15:22Z",  "max_bytes": 0,  "allowed_extensions": [    "string"  ]}

Finish an upload

POST
/media/uploads/{id}/complete

Checks the uploaded file's type and size; a file outside the limits is deleted and refused.

Authorization

bearerAuth
headerAuthorizationBearer <token>

An API key created in Settings > Integrations (gp_live_…), or an OAuth access token.

Path Parameters

id*string
Formatuuid

Response Body

Ready to use.

application/json
  1. response
id*string
Formatuuid
kind*MediaKind
Value in"image""video""voice""document"
media_url*string

Use it as media_url of a message.

Formaturi
bytes*integer
content_type*string
curl -X POST 'https://app.groupilot.com/api/v1/media/uploads/497f6eca-6276-4993-bfeb-53cbbbba6f08/complete'
{  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "kind": "image",  "media_url": "http://example.com",  "bytes": 0,  "content_type": "string"}
POST
/media/import

Groupilot downloads the file (HTTPS, public host, 40 MB max) and stores it.

Authorization

bearerAuth
headerAuthorizationBearer <token>

An API key created in Settings > Integrations (gp_live_…), or an OAuth access token.

Request Body

application/json
  1. body
kind*MediaKind
Value in"image""video""voice""document"
url*string
Formaturi
Lengthlength <= 2000
filename?string
Length1 <= length <= 200

Response Body

Stored.

application/json
  1. response
id*string
Formatuuid
kind*MediaKind
Value in"image""video""voice""document"
media_url*string

Use it as media_url of a message.

Formaturi
bytes*integer
content_type*string
curl -X POST 'https://app.groupilot.com/api/v1/media/import' \  -H 'Content-Type: application/json' \  -d '{  "kind": "image",  "url": "http://example.com"}'
{  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "kind": "image",  "media_url": "http://example.com",  "bytes": 0,  "content_type": "string"}