POST
/users/avatar
curl \
-X POST http://localhost:3003/api/dev/users/avatar \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: multipart/form-data" \
-F "avatar=@file"
Request example
{
"avatar": "@file"
}
Response examples (200)
# Headers
Cross-Origin-Embedder-Policy: require-corp
Cross-Origin-Opener-Policy: same-origin
Cross-Origin-Resource-Policy: same-origin
Origin-Agent-Cluster: ?1
Referrer-Policy: no-referrer
Strict-Transport-Security: max-age=15552000; includeSubDomains
X-Content-Type-Options: nosniff
X-DNS-Prefetch-Control: off
X-Download-Options: noopen
X-Frame-Options: SAMEORIGIN
X-Permitted-Cross-Domain-Policies: none
X-XSS-Protection: 0
Access-Control-Allow-Origin: *
Access-Control-Allow-Credentials: true
Retry-After: 387.443
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 90
X-RateLimit-Reset: Mon Oct 30 2023 02:46:38 GMT+0100 (Central European Standard Time)
x-powered-by: TUNISIAN RED CRESSCENT
Content-Type: application/json; charset=utf-8
Content-Length: 204
ETag: W/"cc-o64nVpo43nGS/yZqCD7aiBKqopw"
Date: Mon, 30 Oct 2023 01:40:12 GMT
Connection: keep-alive
Keep-Alive: timeout=5
# Payload
{
"code": 200,
"avatar": {
"message": {
"RESPONSE_TEXT": "Votre avatar a été défini avec succès.",
"RESPONSE_CODE": "AVATAR_UPLOAD_SAVED_MESSAGE"
},
"avatarUrl": "/media/2841b524-21b6-4b23-97c8-cca14a6baf18.png"
}
}
Response examples (200)
# Headers
Cross-Origin-Embedder-Policy: require-corp
Cross-Origin-Opener-Policy: same-origin
Cross-Origin-Resource-Policy: same-origin
Origin-Agent-Cluster: ?1
Referrer-Policy: no-referrer
Strict-Transport-Security: max-age=15552000; includeSubDomains
X-Content-Type-Options: nosniff
X-DNS-Prefetch-Control: off
X-Download-Options: noopen
X-Frame-Options: SAMEORIGIN
X-Permitted-Cross-Domain-Policies: none
X-XSS-Protection: 0
Access-Control-Allow-Origin: *
Access-Control-Allow-Credentials: true
Retry-After: 387.443
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 90
X-RateLimit-Reset: Mon Oct 30 2023 02:46:38 GMT+0100 (Central European Standard Time)
x-powered-by: TUNISIAN RED CRESSCENT
Content-Type: application/json; charset=utf-8
Content-Length: 204
ETag: W/"cc-o64nVpo43nGS/yZqCD7aiBKqopw"
Date: Mon, 30 Oct 2023 01:40:12 GMT
Connection: keep-alive
Keep-Alive: timeout=5
# Payload
{}
Response examples (400)
# Headers
Cross-Origin-Embedder-Policy: require-corp
Cross-Origin-Opener-Policy: same-origin
Cross-Origin-Resource-Policy: same-origin
Origin-Agent-Cluster: ?1
Referrer-Policy: no-referrer
Strict-Transport-Security: max-age=15552000; includeSubDomains
X-Content-Type-Options: nosniff
X-DNS-Prefetch-Control: off
X-Download-Options: noopen
X-Frame-Options: SAMEORIGIN
X-Permitted-Cross-Domain-Policies: none
X-XSS-Protection: 0
Access-Control-Allow-Origin: *
Access-Control-Allow-Credentials: true
Retry-After: 422.288
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 91
X-RateLimit-Reset: Mon Oct 30 2023 02:46:38 GMT+0100 (Central European Standard Time)
x-powered-by: TUNISIAN RED CRESSCENT
Content-Type: application/json; charset=utf-8
Content-Length: 130
ETag: W/"82-Ys6Ia3tVTdjLizO6+mobGMm5mLo"
Date: Mon, 30 Oct 2023 01:39:36 GMT
Connection: keep-alive
Keep-Alive: timeout=5
# Payload
{
"code": 400,
"message": {
"RESPONSE_TEXT": "Oups! Le champ avatar est obligatoire.",
"RESPONSE_CODE": "AVATAR_UPLOAD_REQUIRED_MESSAGE"
}
}
Response examples (400)
# Headers
Cross-Origin-Embedder-Policy: require-corp
Cross-Origin-Opener-Policy: same-origin
Cross-Origin-Resource-Policy: same-origin
Origin-Agent-Cluster: ?1
Referrer-Policy: no-referrer
Strict-Transport-Security: max-age=15552000; includeSubDomains
X-Content-Type-Options: nosniff
X-DNS-Prefetch-Control: off
X-Download-Options: noopen
X-Frame-Options: SAMEORIGIN
X-Permitted-Cross-Domain-Policies: none
X-XSS-Protection: 0
Access-Control-Allow-Origin: *
Access-Control-Allow-Credentials: true
Retry-After: 422.288
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 91
X-RateLimit-Reset: Mon Oct 30 2023 02:46:38 GMT+0100 (Central European Standard Time)
x-powered-by: TUNISIAN RED CRESSCENT
Content-Type: application/json; charset=utf-8
Content-Length: 130
ETag: W/"82-Ys6Ia3tVTdjLizO6+mobGMm5mLo"
Date: Mon, 30 Oct 2023 01:39:36 GMT
Connection: keep-alive
Keep-Alive: timeout=5
# Payload
{}