You are here

public function ContextApi::uploadResource in TMGMT Translator Smartling 8.3

Same name and namespace in other branches
  1. 8.4 vendor/smartling/api-sdk-php/src/Context/ContextApi.php \Smartling\Context\ContextApi::uploadResource()
  2. 8.2 api-sdk-php/src/Context/ContextApi.php \Smartling\Context\ContextApi::uploadResource()
  3. 8.2 vendor/smartling/api-sdk-php/src/Context/ContextApi.php \Smartling\Context\ContextApi::uploadResource()

Upload resource.

Parameters

$resourceId:

\Smartling\Context\Params\UploadResourceParameters $params:

Return value

bool

Throws

SmartlingApiException

File

vendor/smartling/api-sdk-php/src/Context/ContextApi.php, line 266

Class

ContextApi
Class ContextApi

Namespace

Smartling\Context

Code

public function uploadResource($resourceId, UploadResourceParameters $params) {
  $endpoint = vsprintf('resources/%s', $resourceId);
  $requestData = $this
    ->getDefaultRequestData('multipart', $params
    ->exportToArray());
  return $this
    ->sendRequest($endpoint, $requestData, self::HTTP_METHOD_PUT);
}