Create media for a user
post
/swm/rs/v1/users/{userId}/media
Uploads a media file for a user. File is scanned and stored.
Media file type is limited to the jpg, jpeg, gif, and png formats.
The API user can only upload his/her own media file, and it will replace any existing media for the user.
Returns the relative SWM-based access URL for the stored media file.
Media file type is limited to the jpg, jpeg, gif, and png formats.
The API user can only upload his/her own media file, and it will replace any existing media for the user.
Returns the relative SWM-based access URL for the stored media file.
Request
Supported Media Types
- application/json
Path Parameters
-
userId: string
The ID of the user post
{
"file":"string", - Base64 encoded file content
"fileName":"string" - Name of the file
}
"file":"string", - Base64 encoded file content
"fileName":"string" - Name of the file
}
Root Schema : schema
Type:
string
Response
Supported Media Types
- application/json; charset=UTF-8
200 Response
successful operation
Root Schema : JSONObject
Type:
object
201 Response
media resource created
403 Response
not media creator
404 Response
user not found
Examples
Sample Request:
{ "file":"encrypted_file_contents", "fileName":"productImage.jpg" }
Sample Response:
{"response":{"code":"201.0","developerMessage":"media resource created"}, "mediaId":"Aex2YHW8qmBHX2gC61PU8VGu", "mediaUrl":"/preview/media/product/AMA1iqn08Jz8QGqG/rpCcZTzUdDbVAmRjCy2BFCOO/Aex2YHW8qmBHX2gC61PU8VGu.jpg"}
Possible Error Codes:
{ "code":"403.2","developerMessage":"not content creator", "code":"400.2","developerMessage":"media resource invalid type" }