Welcome to the LimeSurvey Community Forum

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

Add attributes via API

More
2 years 3 months ago #265189 by nitish_kumar
Hey,

We are using version 5.6.56.
I created a new survey via API, but i am facing issues adding custom attributes via API in the participant table, Even tho i am able to add the custom attributes via UI (Survey Participants -> Manager Attributes),

Can someone assist me here? How can I achieve this?

Thank You

Please Log in to join the conversation.

More
2 years 3 months ago #265194 by DenisChenu
Replied by DenisChenu on topic Add attributes via API
I think you have to set Survey->attributedescriptions

github.com/LimeSurvey/LimeSurvey/blob/b5...dels/Survey.php#L678

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member. - Professional support - Plugins, theme and development .
I don't answer to private message.

Please Log in to join the conversation.

More
2 years 3 months ago - 2 years 3 months ago #265211 by nitish_kumar
Replied by nitish_kumar on topic Add attributes via API
I used the attribute you have mentioned, i.e Survey->attributedescriptions.

But I don't know the correct format to use this. Can you please assist me here.

I am doing this:

URL:  xyz.com/feedback/index.php?r=admin/remotecontrol
Parameters: 
Code:
{   "method": "set_survey_properties",   "params": {     "sSessionKey": "XamhSRdxXFsYNQ2~yYyBD405xw4LIMX7",     "iSurveyID": 100101,     "aSurveyData": {       "attributedescriptions": [         {           "mandatory": "N",           "encrypted": "N",           "show_register": "N",           "description": "abcd"         }       ]     }   },   "id": 1 }
Last edit: 2 years 3 months ago by nitish_kumar.

Please Log in to join the conversation.

More
2 years 3 months ago #265245 by DenisChenu
Replied by DenisChenu on topic Add attributes via API
Best : export a survey with your existing attributes.
I think currently it's json.

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member. - Professional support - Plugins, theme and development .
I don't answer to private message.

Please Log in to join the conversation.

Moderators: tpartner, holch

Lime-years ahead

Online-surveys for every purse and purpose