Loading image URL information from API

Ryan ShenkRyan Shenk Posts: 12Member

Hi all,

I'm attempting to get a base64 encoded image string to load into another system; I've got the encoding part worked out, but I'm beating my head against loading a list of images for a specific item ID.

I'm even having some difficulty finding a list of all system images, I can filter on my side, doesn't matter.

I'm executing the following using Guzzle:

GET https://api.merchantos.com/API/Account/{My Merchant ID}/Image.json

..and I'm just getting a generic Guzzle header in response (below). Any idea what I'm missing? Is there a way to load the Image relation to a GET Item request? In my main query, I'm GETting against Item and loading ItemShops.

Thank you!

object(GuzzleHttp\Psr7\Response)#70 (6) {
  ["reasonPhrase":"GuzzleHttp\Psr7\Response":private]=>
  string(2) "OK"
  ["statusCode":"GuzzleHttp\Psr7\Response":private]=>
  int(200)
  ["headers":"GuzzleHttp\Psr7\Response":private]=>
  array(20) {
    ["Date"]=>
    array(1) {
      [0]=>
      string(29) "Thu, 06 Jun 2019 17:59:43 GMT"
    }
    ["Content-Type"]=>
    array(1) {
      [0]=>
      string(16) "application/json"
    }
    ["Transfer-Encoding"]=>
    array(1) {
      [0]=>
      string(7) "chunked"
    }
    ["Connection"]=>
    array(1) {
      [0]=>
      string(10) "keep-alive"
    }
    ["Set-Cookie"]=>
    array(1) {
      [0]=>
      string(139) "__cfduid=dc692a57ab2c58155ccbc810c7390e1d81559843983; expires=Fri, 05-Jun-20 17:59:43 GMT; path=/; domain=.merchantos.com; HttpOnly; Secure"
    }
    ["x-frame-options"]=>
    array(1) {
      [0]=>
      string(10) "SAMEORIGIN"
    }
    ["X-XSS-Protection"]=>
    array(1) {
      [0]=>
      string(13) "1; mode=block"
    }
    ["X-Content-Type-Options"]=>
    array(1) {
      [0]=>
      string(7) "nosniff"
    }
    ["X-LS-Acct-Id"]=>
    array(1) {
      [0]=>
      string(6) "168424"
    }
    ["X-LS-OAuth-Client-Id"]=>
    array(1) {
      [0]=>
      string(5) "70500"
    }
    ["X-LS-API-Bucket-Level"]=>
    array(1) {
      [0]=>
      string(4) "1/60"
    }
    ["X-LS-Shard-Id"]=>
    array(1) {
      [0]=>
      string(2) "13"
    }
    ["X-LS-API-Drip-Rate"]=>
    array(1) {
      [0]=>
      string(1) "1"
    }
    ["X-LS-Master-System"]=>
    array(1) {
      [0]=>
      string(5) "false"
    }
    ["X-LS-Master-Account"]=>
    array(1) {
      [0]=>
      string(5) "false"
    }
    ["X-LS-Master-Catalog"]=>
    array(1) {
      [0]=>
      string(5) "false"
    }
    ["Vary"]=>
    array(1) {
      [0]=>
      string(15) "Accept-Encoding"
    }
    ["Expect-CT"]=>
    array(1) {
      [0]=>
      string(87) "max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct""
    }
    ["Server"]=>
    array(1) {
      [0]=>
      string(10) "cloudflare"
    }
    ["CF-RAY"]=>
    array(1) {
      [0]=>
      string(20) "4e2c4822bac199f6-EWR"
    }
  }
  ["headerNames":"GuzzleHttp\Psr7\Response":private]=>
  array(20) {
    ["date"]=>
    string(4) "Date"
    ["content-type"]=>
    string(12) "Content-Type"
    ["transfer-encoding"]=>
    string(17) "Transfer-Encoding"
    ["connection"]=>
    string(10) "Connection"
    ["set-cookie"]=>
    string(10) "Set-Cookie"
    ["x-frame-options"]=>
    string(15) "x-frame-options"
    ["x-xss-protection"]=>
    string(16) "X-XSS-Protection"
    ["x-content-type-options"]=>
    string(22) "X-Content-Type-Options"
    ["x-ls-acct-id"]=>
    string(12) "X-LS-Acct-Id"
    ["x-ls-oauth-client-id"]=>
    string(20) "X-LS-OAuth-Client-Id"
    ["x-ls-api-bucket-level"]=>
    string(21) "X-LS-API-Bucket-Level"
    ["x-ls-shard-id"]=>
    string(13) "X-LS-Shard-Id"
    ["x-ls-api-drip-rate"]=>
    string(18) "X-LS-API-Drip-Rate"
    ["x-ls-master-system"]=>
    string(18) "X-LS-Master-System"
    ["x-ls-master-account"]=>
    string(19) "X-LS-Master-Account"
    ["x-ls-master-catalog"]=>
    string(19) "X-LS-Master-Catalog"
    ["vary"]=>
    string(4) "Vary"
    ["expect-ct"]=>
    string(9) "Expect-CT"
    ["server"]=>
    string(6) "Server"
    ["cf-ray"]=>
    string(6) "CF-RAY"
  }
  ["protocol":"GuzzleHttp\Psr7\Response":private]=>
  string(3) "1.1"
  ["stream":"GuzzleHttp\Psr7\Response":private]=>
  object(GuzzleHttp\Psr7\Stream)#74 (7) {
    ["stream":"GuzzleHttp\Psr7\Stream":private]=>
    resource(82) of type (stream)
    ["size":"GuzzleHttp\Psr7\Stream":private]=>
    NULL
    ["seekable":"GuzzleHttp\Psr7\Stream":private]=>
    bool(true)
    ["readable":"GuzzleHttp\Psr7\Stream":private]=>
    bool(true)
    ["writable":"GuzzleHttp\Psr7\Stream":private]=>
    bool(true)
    ["uri":"GuzzleHttp\Psr7\Stream":private]=>
    string(10) "php://temp"
    ["customMetadata":"GuzzleHttp\Psr7\Stream":private]=>
    array(0) {
    }
  }
}


1 comment

  • Ryan ShenkRyan Shenk Posts: 12Member

    Ugh, just figured it out - added the "Images" relation to my main call - for some reason, I thought that errored out previously.

    Leaving this here for others.

Sign In or Register to comment.