Answered

error in "retrieve form insight" request from response api

  • 1 July 2021
  • 4 replies
  • 194 views

Userlevel 1
Badge

Hi!

i am testing apis in the postman where in the request of “retreive form insight “ there is a error of :

{"code":"RETRIEVE_FORM_INSIGHTS_METRICS","description":"Access to metrics forbidden for form \"{{formid}}\""}

request url is:

GET:   https://api.typeform.com/insights/{{formid}}/summary

i am putting this body in the form creation request:

{
"title": "This is an example form",
"type": "form",
"settings": {
"language": "en",
"is_public": false,
"progress_bar": "percentage",
"show_progress_bar": true,
"show_typeform_branding": false,
"show_time_to_complete": true,
"hide_navigation": false,
"meta": {
"title": "Meta title",
"allow_indexing": true,
"description": "Cool meta description",
"image": {
"href": "https://images.typeform.com/images/4BKUhw8A9cSM"
}
},
"redirect_after_submit_url": "https://www.redirecttohere.com",
"google_analytics": "UA-1111-22",
"facebook_pixel": "4347295725729872",
"notifications": {
"self": {
"enabled": true,
"recipients": [
"email@example.org"
],
"reply_to": "{{field:nice_readable_email_reference}}",
"subject": "Typeform: new response for {{form:title}}",
"message": "Your typeform {{form:title}} has a new responsenn{{form:all_answers}}"
},
"respondent": {
"enabled": true,
"recipient": "{{field:nice_readable_email_reference}}",
"reply_to": [
"info@example.org"
],
"subject": "Typeform: Thank you for completing {{form:title}}!",
"message": "Hi {{field:nice_readable_short_text_reference}}!nnWe received your submission. Thank you, and have a nice day!nnSincerely,nThe Team at My Company"
}
}
},
"cui_settings": {
"avatar": "https://images.typeform.com/images/4BKUhw8A9cSM"
},
"theme": {
"href": "https://api.typeform.com/themes/qHWOQ7"
},
"workspace": {
"href": "https://api.typeform.com/workspaces/gPDrCW"},
"hidden": [
"var1",
"var2",
"var3"
],
"variables": {
"score": 0,
"price": 10.59,
"name": "typeform",
"age": 28
},
 
"welcome_screens": [
{
"ref": "nice-readable-welcome-ref",
"title": "Welcome Title",
"properties": {
"description": "Cool description for the welcome",
"show_button": true,
"button_text": "start"
},
"layout": {
"attachment": {
"type": "image",
"href": "https://images.typeform.com/images/4BKUhw8A9cSM"
},
"type": "split",
"placement": "left"
}
}
],
"thankyou_screens": [
{
"ref": "nice-readable-thank-you-ref",
"title": "Thank you Title",
"properties": {
"show_button": true,
"button_text": "start",
"button_mode": "redirect",
"redirect_url": "https://www.typeform.com",
"share_icons": false
},
"attachment": {
"type": "image",
"href": "https://images.typeform.com/images/4BKUhw8A9cSM"
}
}
],
"fields": [
{
"ref": "nice_readable_date_reference",
"title": "Date Title",
"type": "date",
"properties": {
"description": "Cool description for the date",
"structure": "DDMMYYYY",
"separator": "-"
},
"validations": {
"required": true
},
"attachment": {
"type": "video",
"href": "https://www.youtube.com/watch?v=Uui3oT-XBxs",
"scale": 0.8,
"properties": {
"description": "Typeform Home documentary"
}
}
},
{
"ref": "nice_readable_dropdown_reference",
"title": "Dropdown Title",
"type": "dropdown",
"properties": {
"description": "Cool description for the dropdown",
"alphabetical_order": false,
"randomize": false,
"choices": [
{
"label": "Foo"
},
{
"label": "Bar"
}
]
},
"validations": {
"required": false
},
"layout": {
"attachment": {
"type": "image",
"href": "https://images.typeform.com/images/4BKUhw8A9cSM"
},
"type": "float",
"placement": "right"
}
},
{
"ref": "nice_readable_email_reference",
"title": "Email Title",
"type": "email",
"properties": {
"description": "Cool description for the email"
},
"validations": {
"required": false
},
"attachment": {
"type": "video",
"href": "https://www.youtube.com/watch?v=Uui3oT-XBxs",
"scale": 0.8
}
},
{
"ref": "nice_readable_file_upload_reference",
"title": "File Upload Title",
"type": "file_upload",
"properties": {
"description": "Cool description for the file upload"
},
"validations": {
"required": false
}
},
{
"ref": "nice_readable_legal_reference",
"title": "Legal Title",
"type": "legal",
"properties": {
"description": "Cool description for the legal"
},
"validations": {
"required": false
}
},
{
"ref": "nice_readable_long_text_reference",
"title": "Long Text Title",
"type": "long_text",
"properties": {
"description": "Cool description for the long text"
},
"validations": {
"required": false,
"max_length": 20
},
"layout": {
"attachment": {
"type": "image",
"href": "https://images.typeform.com/images/4BKUhw8A9cSM"
},
"type": "wallpaper"
}
},
 
{
"ref": "nice_readable_number_reference",
"title": "Number Title",
"type": "number",
"properties": {
"description": "Cool description for the number"
},
"validations": {
"required": false,
"min_value": 20,
"max_value": 50
},
"attachment": {
"type": "image",
"href": "https://images.typeform.com/images/4BKUhw8A9cSM",
"properties": {
"description": "A beautiful sunset"
}
}
},
{
"ref": "nice_readable_opinion_scale_reference",
"title": "Opinion Scale Title",
"type": "opinion_scale",
"properties": {
"description": "Cool description for the opinion scale field",
"steps": 9,
"start_at_one": true,
"labels": {
"left": "left label",
"center": "center label",
"right": "right label"
}
},
"validations": {
"required": false
},
"attachment": {
"type": "video",
"href": "https://www.youtube.com/watch?v=Uui3oT-XBxs",
"scale": 0.8
}
},
 
{
"ref": "nice_readable_rating_reference",
"title": "Rating Title",
"type": "rating",
"properties": {
"description": "Cool description for the rating",
"steps": 10,
"shape": "star"
},
"validations": {
"required": false
},
"attachment": {
"type": "video",
"href": "https://www.youtube.com/watch?v=Uui3oT-XBxs",
"scale": 0.8
}
},
{
"ref": "nice_readable_short_text_reference",
"title": "Short Text Title",
"type": "short_text",
"properties": {
"description": "Cool description for the short text"
},
"validations": {
"required": false,
"max_length": 20
},
"attachment": {
"type": "image",
"href": "https://images.typeform.com/images/4BKUhw8A9cSM",
"properties": {
"description": "A beautiful sunset"
}
}
},
{
"ref": "nice_readable_statement_reference",
"title": "Statement Title",
"type": "statement",
"properties": {
"description": "Cool description for the statement",
"button_text": "Statement button text",
"hide_marks": true
},
"attachment": {
"type": "video",
"href": "https://www.youtube.com/watch?v=Uui3oT-XBxs",
"scale": 0.8
}
},
{
"ref": "nice_readable_website_reference",
"title": "Website Title",
"type": "website",
"properties": {
"description": "Cool description for the website"
},
"validations": {
"required": false
}
},
{
"ref": "nice_readable_yes_no_reference",
"title": "yes or no",
"type": "yes_no",
"properties": {
"description": "Cool description for the Yes/No question"
},
"validations": {
"required": false
},
"attachment": {
"type": "image",
"href": "https://images.typeform.com/images/4BKUhw8A9cSM"
}
},
{
"ref": "nice_readable_payment_reference",
"title": "payment",
"type": "payment",
"properties": {
"description": "Cool description for the payment group",
"currency": "EUR",
"price": {
"type": "variable",
"value": "price"
},
"show_button": true,
"button_text": "next"
},
"validations": {
"required": false
},
"attachment": {
"type": "image",
"href": "https://images.typeform.com/images/4BKUhw8A9cSM"
}
},
{
"ref": "a_matrix_field_ref",
"title": "matrix field",
"type": "matrix",
"properties": {
"description": "Matrix description",
"fields": [
{
"ref": "nice_readable_multiple_choice_reference_inside_matrix",
"title": "multiple choice",
"type": "multiple_choice",
"properties": {
"description": "Cool description for the multiple choice in the matrix",
"allow_multiple_selection": true,
"allow_other_choice": false,
"vertical_alignment": true,
"choices": [
{
"label": "matrix choice 1"
},
{
"label": "matrix choice 2"
}
]
}
}
]
}
}
]
}
]
}
 
 
After obtaining response from this request, i have recieved {{formid}} which i used in the “retrieve form inside” request.
 
kindly guide me if i am using wrong body params in the create a form request or what else could be the mistake.
icon

Best answer by Liz 1 July 2021, 17:19

View original

4 replies

Userlevel 7
Badge +5

Hi @Sibqo Thanks for stopping by! In order to retrieve the form insights, you’ll need to be on our Business Plan. If you’re account isn’t on this plan, you’ll receive the error message such as the one you’re seeing. Let us know if this happens to be the case!

Userlevel 1
Badge

Thankyou @Liz , my account is not business account. May be it is a reason behind when i run the image request of  /api.typeform.com/imageid/background/size  it shows same  error but when i change the url like /images.typeform.com/imageid/background/size then ii will give the correct answer. IS It? or there is any other reason?

Userlevel 7
Badge +5

Hi @Sibqo Hm, I’m not quite sure on the image issue. Do you mind sending the full API call and error you’re receiving for that?

Userlevel 1
Badge

Issue in the call is that it only gives 200 ok Status response when i give the URL 

https://images.typeform.com/images/dWwP6Caq8dJs

But when i give the original URL from the API reference i.e 

 

https://api.typeform.com/images/{image_id}/image/{size} then it gives the error.

response of the call is attached.

 

 

Reply