3

The use case is the need for the (plain text) contents of a binary variant in the Tridion Content Delivery web service. The Binary Variant URL is http://localhost:82/odata.svc/BinaryVariants(BinaryId=159,PublicationId=4,VariantId='Y29uZmlnLWJvb3RzdHJhcA==')

Experimenting with the CD web service I tried http://localhost:82/odata.svc/BinaryVariants(BinaryId=159,PublicationId=4,VariantId='Y29uZmlnLWJvb3RzdHJhcA==')/Binary, This does not work out, the Binary item is the “parent” of the BinaryVariant, it does not contain any binary data.

The BinaryVariant URL gives met the metadata about the Binary such as Path (/system/config/search.json) and Type (application/json), but not the actual binary contents itself.

  • What version of Tridion? – Nickoli Roussakov Jun 5 '15 at 19:53
  • IIRC, in 2011sp1 you couldn't get binaries via the WS, only their URL on the file system. In 2013 a new feature was introduced where you can do this. But the entity is BinaryContent, not Binary. – Nickoli Roussakov Jun 5 '15 at 19:55
  • It's on SDL Tridion 2013 SP1 – Jan H Jun 5 '15 at 20:18
  • That's the right answer Nick! I checked, there is a BinaryContents collection which contains the binary I am looking for. I did not find it cause there is no relation/link from Binaries or BinaryVariants to this BinaryContents collection. There is a link from the BinaryContents to BinaryVariants though, strange... – Jan H Jun 5 '15 at 21:26
  • Ok. Converting to answer so you can give me points :) – Nickoli Roussakov Jun 5 '15 at 22:18
3

IIRC, in 2011sp1 you couldn't get binaries via the WS, only their URL on the file system. In 2013 a new feature was introduced where you can do this. But the entity is BinaryContent, not Binary.

| improve this answer | |
  • 1
    Yep, This worked for me, just grab the $value from the BinaryContents collction: http://localhost:82/odata.svc/BinaryContents(BinaryId=159,PublicationId=4,VariantId='Y29uZmlnLWJvb3RzdHJhcA==')/$value There is no relation between the BinaryVariant and the BinaryContents though, so you manually have to construct the BinaryContents URL, as you can see it is similar to the BinaryVariants URL. – Jan H Jun 6 '15 at 7:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.