Community articleUpload Photo or Video
Added by IBM contributorIBM on March 25, 2014
Rate this article 1 starsRate this article 2 starsRate this article 3 starsRate this article 4 starsRate this article 5 stars

Provides details on adding a photo or video the Media Gallery.

Add a photo or video to a Media Gallery by performing a multipart/form-data POST.

Table 1. Atom API request details

HTTP Method
Sample URL
Description
POST
{filesUrl}/form/cmis/repository/{repositoryId}/mfolderc/snx:files
URL to use to create a photo or video




Discoverability
You can derive the URL from the root feed, which is available using the Retrieving Community Files Root Feedsteps. Use the web address specified as the "href" attribute of the "<link rel="http://www.ibm.com/xmlns/prod/sn/cmis/multipart-form/folderChildrenCollection">" element.


Request parameters

Table 2. Input parameters

Parameter
Description
If-Match
String. Use the value "uid={userId}" where {userId} is the id of the user adding the photo or video.
X-Update-Nonce
String. See Retrieving Nonce and User id for how to retrieve the nonce value.
filter
String. Use value "cmis:constentStreamId, cmis:name". You will need these values in the response if you decide to upload a video thumbnail.
nonce
String. See Retrieving Nonce and User id for how to retrieve the nonce value.
opId
String. Use the value "upload,{filename},{numericalDateRepresentation}". Replace {filename} with the name of the file. Replace {numericalDateRepresentation} with a number that represents the current timestamp.

Table 3. POST properties

Parameter
Description
cmis:contentStream
This is the photo or video data.
snx:summary
String. Use the value you would like associated with the photo or video description
cmis:name
String. Use the name that you would like the file named
cmis:contentStreamFileName
String. Use the name that you would like the file named
notification
String. Use the value "on".
cmis:objectTypeId
String. Use the id of the cmis object type you have associated with a video if uploading a video or photo if uploading a photo. See more details on CMIS object types by going to Retrieving CMIS Object Type properties.
If-Match
String. Use the value "uid={userId}" where{userId} is the id of the user adding the photo or video.
X-Update-Nonce
String. See Retrieving Nonce and User id for how to retrieve the nonce value.
Input
Method URI Description
POST /files/{authType}/cmis/repository/{repositoryId}/mfolderc/snx:files URL to use to create a photo or video
You can derive the URL from the root feed, which is available using the Retrieving Community Files Root Feedsteps. Use the web address specified as the "href" attribute of the "<link rel="http://www.ibm.com/xmlns/prod/sn/cmis/multipart-form/folderChildrenCollection">" element.
Content Type: text/plain
Name Type Optional Description
repositoryId
string No ID of the repository containing the media content
authType
enumerated No Authentication type
Authorized values:
  • basic
  • form
  • oauth
Name Type Optional Description
If-Match
string Yes String. Use the value "uid={userId}" where {userId} is the id of the user adding the photo or video.
X-Update-Nonce
string Yes String. See Retrieving Nonce and User id for how to retrieve the nonce value.
filter
string Yes String. Use value "cmis:constentStreamId, cmis:name". You will need these values in the response if you decide to upload a video thumbnail.
nonce
string Yes String. See Retrieving Nonce and User id for how to retrieve the nonce value.
opId
string Yes String. Use the value "upload,{filename},{numericalDateRepresentation}". Replace {filename} with the name of the file. Replace {numericalDateRepresentation} with a number that represents the current timestamp.
Name Type Optional Description
cmis:contentStream
string Yes This is the photo or video data.
snx:summary
string Yes String. Use the value you would like associated with the photo or video description
cmis:name
string Yes String. Use the name that you would like the file named
cmis:contentStreamFileName
string Yes String. Use the name that you would like the file named
notification
string Yes String. Use the value "on".
cmis:objectTypeId
string Yes String. Use the id of the cmis object type you have associated with a video if uploading a video or photo if uploading a photo. See more details on CMIS object types by going to Retrieving CMIS Object Type properties.
If-Match
string Yes String. Use the value "uid={userId}" where{userId} is the id of the user adding the photo or video.
X-Update-Nonce
string Yes String. See Retrieving Nonce and User id for how to retrieve the nonce value.