Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SDK Can't be Used to Download Attachment Data #1

Closed
provoaggie opened this issue Jun 19, 2015 · 1 comment
Closed

SDK Can't be Used to Download Attachment Data #1

provoaggie opened this issue Jun 19, 2015 · 1 comment

Comments

@provoaggie
Copy link

I am using:

$attachment = "https://platform.devtest.ringcentral.com/restapi/v1.0/account/130980004/extension/130980004/message-store/1146871004/content/1146871004";
$res2 = $rcsdk->getPlatform()->get($attachment);
file_put_contents("file.pdf",$res2->getBody());

This grabs the content and creates a file that is 189KB (It's a few bytes off the size of the PDF I get from logging into my account). The file that it creates though is corrupt thought. It appears that the data returned by getBody() isn't usable for creating a valid file. Either that method should be updated to retrieve proper data or a new method should be created.

@kirill-konshin
Copy link
Contributor

Use the following method to retrieve attachment URL with credentials:

$urlWithCredentials = $platform->apiUrl($attachment, array('addToken' => true));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants