Welcome to the LimeSurvey Community Forum

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

Add attributes via API

  • nitish_kumar
  • nitish_kumar's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
11 months 2 weeks ago #265189 by nitish_kumar
Add attributes via API was created 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.

  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team & Official Partner
  • LimeSurvey Community Team & Official Partner
More
11 months 2 weeks 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.

  • nitish_kumar
  • nitish_kumar's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
11 months 2 weeks ago - 11 months 2 weeks 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: 11 months 2 weeks ago by nitish_kumar.

Please Log in to join the conversation.

  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team & Official Partner
  • LimeSurvey Community Team & Official Partner
More
11 months 1 week 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: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose