Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

API get the attributedescriptions

  • adishardis
  • adishardis's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
9 years 5 months ago - 9 years 5 months ago #114124 by adishardis
API get the attributedescriptions was created by adishardis
Hi, I'm trying to get the Attribute names, like Attribute_1 has the description gender.

This is the code:
$property_to_fetch = 'attributedescriptions';

$attributedescriptions = $myJSONRPCClient->get_survey_properties( $sessionKey, $survey_id, $property_to_fetch );

but that returns:

Array ( [status] => No valid Data )

What am I missing?

edit: I'm using Version 2.05+ Build 141003 and other api calls such as list_groups works perfectly!

Cheers
/Adam
Last edit: 9 years 5 months ago by adishardis. Reason: Made progress and updated the question
The topic has been locked.
  • adishardis
  • adishardis's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
9 years 5 months ago #114297 by adishardis
Replied by adishardis on topic API get the attributedescriptions
Ok, so I'm getting somewhere and want to update this thread.

I got the api request working with this syntax:

$property_to_fetch = 'attributedescriptions';

$attributedescriptions = $myJSONRPCClient->get_survey_properties( $sessionKey, $survey_id, array($property_to_fetch));

This returns:

Array ( [attributedescriptions] => a:2:{s:11:"attribute_1";a:4:{s:11:"description";s:5:"tel_1";s:9:"mandatory";s:1:"Y";s:13:"show_register";s:1:"N";s:7:"cpdbmap";s:0:"";}s:11:"attribute_2";a:4:{s:11:"description";s:5:"tel_2";s:9:"mandatory";s:1:"N";s:13:"show_register";s:1:"N";s:7:"cpdbmap";s:0:"";}} )

Is there a way to get an array of "Attribute_1" => "tel_1", "Attribute_2" => "tel_2" from this?
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
9 years 5 months ago #114322 by DenisChenu
Replied by DenisChenu on topic API get the attributedescriptions
You know you can look at LS source code ?

unserialize / serialize

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose