src/MediaServices/MediaServicesRestProxy.php
public function getKeyDeliveryUrl($contentKey, $contentKeyDeliveryType)
    {
        $contentKeyId = Utilities::getEntityId(
            $contentKey,
            'WindowsAzure\MediaServices\Models\ContentKey'
        );
        $contentKeyId = urlencode($contentKeyId);

        $body = json_encode(['keyDeliveryType' => $contentKeyDeliveryType]);

        $method = Resources::HTTP_POST;
        $path = "ContentKeys('{$contentKeyId}')/GetKeyDeliveryUrl";
        $headers = [
            Resources::CONTENT_TYPE => Resources::JSON_CONTENT_TYPE,
        ];
        $postParams = [];
        $queryParams = [];
        $statusCode = Resources::STATUS_OK;

        $response = $this->sendHttp(
            $method,
            $headers,
            $queryParams,
            $postParams,
            $path,
            $statusCode,
            $body
        );

        return simplexml_load_string($response->getBody())->__toString();
    }
public function getKeyDeliveryUrl($contentKey, $contentKeyDeliveryType)
    {
        $contentKeyId = Utilities::getEntityId(
            $contentKey,
            'WindowsAzure\MediaServices\Models\ContentKey'
        );
        $contentKeyId = urlencode($contentKeyId);

        $body = json_encode(['keyDeliveryType' => $contentKeyDeliveryType]);

        $method = Resources::HTTP_POST;
        $path = "ContentKeys('{$contentKeyId}')/GetKeyDeliveryUrl";
        $headers = [
            Resources::CONTENT_TYPE => Resources::JSON_CONTENT_TYPE,
        ];
        $postParams = [];
        $queryParams = [];
        $statusCode = Resources::STATUS_OK;

        $response = $this->sendHttp(
            $method,
            $headers,
            $queryParams,
            $postParams,
            $path,
            $statusCode,
            $body
        );

        return simplexml_load_string($response->getBody())->__toString();
    }
public function getKeyDeliveryUrl ( $ contentKey , $ contentKeyDeliveryType ) { $ contentKeyId = Utilities :: getEntityId ( $ contentKey , 'WindowsAzure\MediaServices\Models\ContentKey' ) ; $ contentKeyId = urlencode ( $ contentKeyId ) ; $ body = json_encode ( [ 'keyDeliveryType' => $ contentKeyDeliveryType ] ) ; $ method = Resources :: HTTP_POST ; $ path = "ContentKeys('{$contentKeyId}')/GetKeyDeliveryUrl" ; $ headers = [ Resources :: CONTENT_TYPE => Resources :: JSON_CONTENT_TYPE , ] ; $ postParams = [ ] ; $ queryParams = [ ] ; $ statusCode = Resources :: STATUS_OK ; $ response = $ this -> sendHttp ( $ method , $ headers , $ queryParams , $ postParams , $ path , $ statusCode , $ body ) ; return simplexml_load_string ( $ response -> getBody ( ) ) -> __toString ( ) ; }
Link AssetDeliveryPolicy to Asset.

@param ContentKey|string          $contentKey             Asset to link a AssetDeliveryPolicy or
Asset id
@param AssetDeliveryPolicy|string $contentKeyDeliveryType DeliveryPolicy to link or
DeliveryPolicy id

@return string
Link AssetDeliveryPolicy to Asset .