GET: https://{{env}}.survey2connect.com/v2/api/surveys/{{survey_id}}/pages

The value of environment {{env}} variable depends upon your datacenter. Refer to the Environment page for more details.

"Content-Type": "application/json"
type: Api Key  
Key: x-api-key 
token: value from portal 

Request Parameter

{{survey_id}}: Unique Survey ID.

Request Sample

curl --location --request GET 'https://az1.survey2connect.com/v2/api/surveys/survey_id/pages' \ 

--header 'Authorization: Bearer eyJraWQiOiJzM3E1OWF2cFdIcXVKa0I0MjRpcFpqQVN0dXAzQzFkZEhVM3k2TjNZSXRjPSIsImFs' \ 

--header 'Content-Type: application/json' \    
var myHeaders = new Headers(); 
myHeaders.append("Authorization", "Bearer eyJraWQiOiJzM3E1OWF2cFdIcXVKa0I0MjRpcFpqQVN0dXAzQzFkZEhVM3k2TjNZSXRjPSIsImFs”); 
myHeaders.append("Content-Type", "application/json"); 
  
var requestOptions = { 
  method: GET, 
  headers: myHeaders, 
  redirect: 'follow' 
}; 
  
fetch("https://az1.survey2connect.com/v2/api/surveys/survey_id/pages", requestOptions) 
  .then(response => response.text()) 
  .then(result => console.log(result)) 
  .catch(error => console.log('error', error));    

Responses

{ 
    "data": [ 
        { 
            "title": "", 
            "description": "", 
            "questions": [ 
                { 
                    "_id": "648c3e95010777456e2eaf86", 
                    "title": "Appliances", 
                    "modified": "Fri Jun 16 2023 16:21:01", 
                    "created": "Fri Jun 16 2023 16:21:01" 
                } 
            ], 
            "question_count": 1, 
            "sur_id": "648c3bc2010777456e2eaf6e", 
            "modified": "Fri Jun 16 2023 16:21:01", 
            "created": "Fri Jun 16 2023 16:08:58", 
            "_id": "648c3bc2010777456e2eaf6f", 
            "position": 1 
        } 
    ], 
    "skip": 0, 
    "limit": 10, 
    "total": 1 
}     
{ 
    "error": { 
        "name": "Unauthorized", 
        "message": "The authorization token was not provided." 
    } 
}   
{   
    "error": {   
         "name": "Internal Server Error",   
         "message": "We were not able to process your request"   
    }   
}  

Note: Please do not share your tokens in publicly accessible areas or to anyone. Also, this token generated is valid for 24 hours only. After its expiry, you can regenerate the access token from the same API endpoint by passing the username and password or from the refresh token API with the help of refresh token.

Ask a human

Can't Find What You're Looking For?