No binary data of picture returned in REST-API (SOLVED)

If you think that something doesn't work in Aware IM post your message here
Post Reply
jannes
Posts: 105
Joined: Tue Jul 02, 2019 12:22 pm

No binary data of picture returned in REST-API (SOLVED)

Post by jannes »

A REST API call retrieves data from a person.
It works fine but the photo (format = Picture, stored in database) is not returned.
This field is missing in the response.

According to a tip on the forum, DOCDATA should be used in the attribute.
WebResult.Photo=Person.Photo.DOCDATA

But this doesn't work.
How to get the binary data of the picture in the response?

regards
Jannes
Last edited by jannes on Thu Sep 09, 2021 9:14 pm, edited 6 times in total.
Jaymer
Posts: 2528
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

Re: No picture returned in REST-API

Post by Jaymer »

There are like 5 things in this post that don’t make sense.
Sorry, can’t help.
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.

Jaymer
Aware Programming & Consulting - Tampa FL
jannes
Posts: 105
Joined: Tue Jul 02, 2019 12:22 pm

Re: No picture returned in REST-API

Post by jannes »

Hi Jaymer,

I changed the text of the post.
I hope it makes more sense now.

regards
Jannes
aware_support
Posts: 7565
Joined: Sun Apr 24, 2005 12:36 am
Contact:

Re: No binary data of picture returned in REST-API

Post by aware_support »

1) Are you consuming or exposing a REST service?
2) If you are consuming what are your settings?
3) Can you provide a link to the forum thread with a tip about DOCDATA?
Aware IM Support Team
jannes
Posts: 105
Joined: Tue Jul 02, 2019 12:22 pm

Re: No binary data of picture returned in REST-API

Post by jannes »

1)
Exposing :
https://cloud.f...:8444/AwareIM/REST/PV ... xtern=1155

See complete link in pm

2)
Service "GetPass" :
Process : WebGetPass
[x] Third parties will ..
Service will retun object : WebResult

REST Service Settings
Use default URL
JSON format
Do not encode undefined settings


3)
https://www.awareim.com/forum/viewtopic.php?t=3959

Post by aware_support » Mon Jan 04, 2010 9:45 am
Instead of specifying the name of the attribute, specify the name of the attribute followed by dot and "DOCDATA", for example: AttriibuteName.DOCDATA

This should return the binary data of the picture
Aware IM Support Team
jannes
Posts: 105
Joined: Tue Jul 02, 2019 12:22 pm

Re: No binary data of picture returned in REST-API (Solved)

Post by jannes »

The binary data can be retrieved via :

WebResult.Foto=IMAGE_DATA(Persoon.Foto)

WebResult.Foto must be a (big) PlainText (MEDIUMTEXT)

regards
Jannes

Thnx to Himanshu!
Post Reply