Get the ref and id for choices in a webhook | Community
Skip to main content
Answered

Get the ref and id for choices in a webhook


Mikkel
Forum|alt.badge.img+2
  • Sharing wisdom
  • 21 replies

Hey,

Would it be possible to have the ref for choices be added to the webhook payload? Right now, the response from the response API looks like this:

{
	"field": {
		"id": "VGEKytqoG5pL",
		"ref": "question-type_membership-level",
		"type": "multiple_choice"
	},
	"type": "choice",
	"choice": {
		"id": "oIw7G6Aav6vT",
		"ref": "membership-level_Lev5",
		"label": "Level 5 - Phaser Lotus"
	}
}

While the webhook payload, for the same response, looks like this:

{
	"type": "choice",
	"choice": {
		"label": "Level 5 - Phaser Lotus"
	},
	"field": {
		"id": "oIw7G6Aav6vT",
		"type": "multiple_choice",
		"ref": "question-type_membership-level"
	}
}

Both the id and ref field for the choice is absent from the payload. 

As far as I can tell, these fields were added to the response API a few months ago. Would it be possible to also have it added to the webhook payload?

 


 

If relevant, the main use case that this impacts is that we are using a typeform to gather input, which in turn is used to generate a new typeform. For instance, in the initial typeform, we gather the name, workspace, theme, and more, for a desired new typeform. We then use this information to generate a new typeform through the Generate API. We prefer to use the ref field instead of the label to identify choices, as the strings in the labels will probably be more frequently changed than the code we add to the ref field.

We’d prefer this to happen right after the initial typeform is submitted, as webhook response. However, without the ref field, that’s a bit more tricky. We could work around it, for instance by adding an API call to the response API using the token from the webhook payload, but instead settled on a scheduled update once an hour.

Regards,

Mikkel

Best answer by mathio-tf

Hello @Mikkel I think this is a valid point and a good feature request. @Liz can you please help with getting this request to respective team?

View original

11 replies

Liz
Community Team
Forum|alt.badge.img+5
  • Tech Community Advocate
  • 14840 replies
  • July 14, 2022

@picsoung or @mathio might have some insight on this!


mathio-tf
Typeform
Forum|alt.badge.img+5
  • Typeform
  • 888 replies
  • Answer
  • July 15, 2022

Hello @Mikkel I think this is a valid point and a good feature request. @Liz can you please help with getting this request to respective team?


Mikkel
Forum|alt.badge.img+2
  • Author
  • Sharing wisdom
  • 21 replies
  • July 15, 2022

Much obliged, @mathio 😊


picsoung
Typeform
Forum|alt.badge.img+5
  • Developer Advocate @ Typeform
  • 384 replies
  • July 19, 2022

Hey @Mikkel 

This makes a lot of sense, and we indeed added this to the webhook payload a few months ago, but we had to revert it because it was causing issues with forms with too many options 😅

We are looking for better solutions to implement this feature, and hopefully, it should be back soon 🤞


Mikkel
Forum|alt.badge.img+2
  • Author
  • Sharing wisdom
  • 21 replies
  • July 20, 2022

Hey @picsoung, and thank you for the update! Out of curiosity, would it be possible to read somewhere about what the issues were?


picsoung
Typeform
Forum|alt.badge.img+5
  • Developer Advocate @ Typeform
  • 384 replies
  • July 20, 2022

@Mikkel I believe the issue was mainly about sending payloads that were too big, and it was causing some overflow issues on both sides.


Mikkel
Forum|alt.badge.img+2
  • Author
  • Sharing wisdom
  • 21 replies
  • July 22, 2022

Ah, I see! Thank you for explaining, and I hope you can resolve the issue without too much trouble.


  • Explorer
  • 4 replies
  • November 19, 2022

Hi @picsoung,

Is there any update ? We are very interested for this feature, as we have complexe scores processing in the backend for a survey of more than 500 questions.

Without the ref of the choice for each answer in the payload, we must find the choice number based on the label in the backend side, which is very time consumming when the backend receives the payload.

Best regards

 


  • Navigating the Land
  • 1 reply
  • March 1, 2023

Is there any update with this? We are also experiencing the same pain point. 


  • Navigating the Land
  • 1 reply
  • May 9, 2023

Any update here? Also running into this issue here. Otherwise I need to match the label to a record in the db...


Liz
Community Team
Forum|alt.badge.img+5
  • Tech Community Advocate
  • 14840 replies
  • July 25, 2023

@Mikkel @makle @PaJones @nickola we just released this update below which you might like! 😀