Description:
Upload an icon via API to CompetitionLabs.
Resource URL:
https://<apphost>.competitionlabs.com/api/<your-space-name>/achievements/icon-uploads
Key | Value | Required |
X-API-KEY | Your unique API key | Yes |
Content-Type | application/json | Yes |
Accept-Encoding | gzip, deflate | Yes |
Content-Length | length of file | Yes |
content-type | multipart/form-data | Yes |
Request URL parameter
| | | |
---|
space | String | Yes | This is the space name which is linked to the account |
Post body parameters
The file has to be sent as "multipart/form-data". The content key/name has to be "file". The value inserted has to be an image that you want to upload.
EXAMPLE
curl
--header 'Accept-Encoding: gzip, deflate'
--header 'Content-Length: 69112'
--header 'Content-Type: application/x-www-form-urlencoded'
--header 'X-API-KEY: <your-api-key>'
--header 'content-type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW'
--request POST https://app.competitionlabs.com/api/tester/achievements/icon-uploads
-F file=@/usr/home/files/image.jpg
{
"meta": {
"time": "2019-11-06T16:40:52.335Z"
},
"data": {
"jsonClass": "Attachment",
"attachmentType": "achievement-icons",
"bucketName": "demo.competitionlabs.com",
"md5Hash": "DwBM27/fIsfRHnHuG1heIw==",
"accountId": "0sn4DmUBkPH_lz9GgxBM",
"fileName": "3D5.jpg",
"mimeType": "image/jpeg",
"extension": "jpg",
"locationKey": "margarita/achievement-icons/3D5.jpg",
"locationFolder": "margarita/achievement-icons",
"permission": 744,
"created": "2019-11-06T16:40:52.302+0000",
"metadata": [],
"id": "nriXQW4Bl-kxmqaGG-tS"
}
}
ERROR CODES
Code | HTTP Status | Description | Example |
---|
1007 | 404 | - The X-API-KEY is incorrect
- Incorrect space name
|
{
"errors": [
{
"message": "No key found for value - [123345567888edgddfgdrgd]",
"code": 1007,
"status": 404
}
]
}
{
"errors": [
{
"message": "No account found for space name - [test]",
"code": 1007,
"status": 404
}
]
}
|
1002 | 404 | The form-data that is sent is incorrect - The key is missing or incorrect
- The value is missing or incorrect
|
{
"errors": [
{
"message": "Mandatory parameter missing.",
"code": 1002,
"status": 404
}
]
}
|
| 404 | The Request URL is incorrect | |
| 401 | The X-API-KEY is missing | |