API Reference

Media.insertTextFile

Creates a new text file in Media Factory (filetype 4).

If a user ID is specified a check will be made to ensure the user exists, if the user doesn't this call will fail.

If a valid API KEY is supplied, the uid argument can be used to specify the user id. If this is not supplied, the file will be owned by the 'public' user. If no valid API KEY is supplied, a valid session token must be supplied. In this case the user-id will be determined based on the currently logged in user.

POST A COMMENT:
This is the function to use in order to post a comment on a media; please note that you have to specify the parentid to make the new text a comment on the pre-existing media.


Syntax

mixed media.insertTextFile ( mixed vhost, mixed fileData, mixed recaptchaToken = false, mixed returnGameInfo = false )

Arguments

NameTypeRequiredDefault valueDescription
vhostmixedRequirednone
fileDatamixedRequirednone
recaptchaTokenmixedOptionalfalse
returnGameInfomixedOptionalfalse

Sample Response

Sample REST Response
http://api.newspark.ca/services/rest/media/insertTextFile?vhost=[VHOST_ID]&fileData[title]=[MEDIA_TITLE]
<?xml version="1.0" encoding="UTF-8"?>
<result>MEDIA_ID</result>
Sample JSON Response
{
    "status": true,
    "result": MEDIA_ID
}

Code examples

0 comments

Be the first to comment on insertTextFile.

Add a Comment

  • captcha