php sample code to retrieving message attachments

  • 1
  • Question
  • Updated 1 week ago
I would like to know how I can read the response and write to file.

RingCentral\SDK\Http\ApiResponse Object ( [_jsonAsArray:protected] => [_jsonAsObject:protected] => [_multiparts:protected] => [_response:protected] => GuzzleHttp\Psr7\Response Object ( [reasonPhrase:GuzzleHttp\Psr7\Response:private] => OK [statusCode:GuzzleHttp\Psr7\Response:private] => 200 [headers:GuzzleHttp\Psr7\Response:private] => Array ( [Server] => Array ( [0] => nginx ) [Date] => Array ( [0] => Tue, 07 Aug 2018 22:15:14 GMT ) [Content-Type] => Array ( [0] => text/plain;charset=utf-8 ) [Content-Length] => Array ( [0] => 60 ) [Connection] => Array ( [0] => keep-alive ) [RCRequestId] => Array ( [0] => 5bf03a88-9a8f-11e8-a6b9-005056bb26b9 ) [RoutingKey] => Array ( [0] => SJC11P01PAS01 ) [Accept-Ranges] => Array ( [0] => bytes [1] => bytes ) [Content-Disposition] => Array ( [0] => inline;filename=4622047004.txt ) [Content-Language] => Array ( [0] => en-US ) [X-Rate-Limit-Group] => Array ( [0] => medium ) [X-Rate-Limit-Limit] => Array ( [0] => 40 ) [X-Rate-Limit-Remaining] => Array ( [0] => 38 ) [X-Rate-Limit-Window] => Array ( [0] => 60 ) ) [headerNames:GuzzleHttp\Psr7\Response:private] => Array ( [server] => Server [date] => Date [content-type] => Content-Type [content-length] => Content-Length [connection] => Connection [rcrequestid] => RCRequestId [routingkey] => RoutingKey [accept-ranges] => Accept-Ranges [content-disposition] => Content-Disposition [content-language] => Content-Language [x-rate-limit-group] => X-Rate-Limit-Group [x-rate-limit-limit] => X-Rate-Limit-Limit [x-rate-limit-remaining] => X-Rate-Limit-Remaining [x-rate-limit-window] => X-Rate-Limit-Window ) [protocol:GuzzleHttp\Psr7\Response:private] => 1.1 [stream:GuzzleHttp\Psr7\Response:private] => GuzzleHttp\Psr7\Stream Object ( [stream:GuzzleHttp\Psr7\Stream:private] => Resource id #121 [size:GuzzleHttp\Psr7\Stream:private] => [seekable:GuzzleHttp\Psr7\Stream:private] => 1 [readable:GuzzleHttp\Psr7\Stream:private] => 1 [writable:GuzzleHttp\Psr7\Stream:private] => 1 [uri:GuzzleHttp\Psr7\Stream:private] => php://temp [customMetadata:GuzzleHttp\Psr7\Stream:private] => Array ( ) ) ) [_request:protected] => GuzzleHttp\Psr7\Request Object ( [method:GuzzleHttp\Psr7\Request:private] => GET [requestTarget:GuzzleHttp\Psr7\Request:private] => [uri:GuzzleHttp\Psr7\Request:private] => GuzzleHttp\Psr7\Uri Object ( [scheme:GuzzleHttp\Psr7\Uri:private] => https [userInfo:GuzzleHttp\Psr7\Uri:private] => [host:GuzzleHttp\Psr7\Uri:private] => platform.devtest.ringcentral.com [port:GuzzleHttp\Psr7\Uri:private] => [path:GuzzleHttp\Psr7\Uri:private] => /restapi/v1.0/account/244580004/extension/244580004/message-store/4622047004/content/4622047004 [query:GuzzleHttp\Psr7\Uri:private] => [fragment:GuzzleHttp\Psr7\Uri:private] => ) [headers:GuzzleHttp\Psr7\Request:private] => Array ( [Host] => Array ( [0] => platform.devtest.ringcentral.com ) [content-type] => Array ( [0] => application/json ) [accept] => Array ( [0] => application/json ) [Authorization] => Array ( [0] => bearer U0pDMTFQMDFQQVMwMHxBQUI3Q2pJU0F6QmZZTjVFM0lLVTk3RGRVN3RjSWlqQndiZm1qNHVxSmtiaWxLZVFEc2cweEUwb0h6ZkRKaHBTTE9GNF9QWWRPMEVYNEhPV3FzbEwwTUtuZDluN0F6ZmNHRTg4RWFEc3FFZ0lVSFdWdnU5RlJERTg3bmR2dVpoR0lUaUw2VnNtYTVMZzBsMWRBbjBPS3J0M0hsd09iX0MyajdBMG5rU2ozWk9MMHk3ZVBSMVhNNmJvQXk5QnB5ZkplVU18SzN0ZDJRfHJkX09IcnVvU1VfWXJlWVJSZlp2TUF8QUE ) [User-Agent] => Array ( [0] => Demo/1.0.0 Windows NT/10.0 PHP/5.6.31 RCPHPSDK/2.1.2 ) [RC-User-Agent] => Array ( [0] => Demo/1.0.0 Windows NT/10.0 PHP/5.6.31 RCPHPSDK/2.1.2 ) ) [headerNames:GuzzleHttp\Psr7\Request:private] => Array ( [content-type] => content-type [accept] => accept [host] => Host [authorization] => Authorization [user-agent] => User-Agent [rc-user-agent] => RC-User-Agent ) [protocol:GuzzleHttp\Psr7\Request:private] => 1.1 [stream:GuzzleHttp\Psr7\Request:private] => GuzzleHttp\Psr7\Stream Object ( [stream:GuzzleHttp\Psr7\Stream:private] => Resource id #119 [size:GuzzleHttp\Psr7\Stream:private] => 0 [seekable:GuzzleHttp\Psr7\Stream:private] => 1 [readable:GuzzleHttp\Psr7\Stream:private] => 1 [writable:GuzzleHttp\Psr7\Stream:private] => 1 [uri:GuzzleHttp\Psr7\Stream:private] => php://temp [customMetadata:GuzzleHttp\Psr7\Stream:private] => Array ( ) ) ) )

Photo of Nibu Eapen

Nibu Eapen

  • 200 Points 100 badge 2x thumb

Posted 2 weeks ago

  • 1
Photo of Phong Vu

Phong Vu, Devangelist

  • 2,476 Points 2k badge 2x thumb