cancel
Showing results for 
Search instead for 
Did you mean: 

All records of Questionnaire using Content API

TejpalSingh
Contributor III

Dear All, 

 

I want to extract all the records of a questionnaire. Content API provides a way to extract all the records from an application but not for the questionnaire. Instead, when we extract data for a questionnaire it provides "Questionnaire_Interface_id" and Questionnaire content id. 

 

Please guide me if there is a way to extract all records with their content for a questionnaire with REST API or Content API

 

Thanks, 

Tejpal Singh

1 ACCEPTED SOLUTION

Accepted Solutions

ScottHagemeyer
Archer Employee
Archer Employee

Tejpal Singh,

 

The Content API can retrieve questionnaire records. Just like for applications, all you need to provide is the Alias of the Questionnaire. If you do not know it, you can find it from a call to ../contentapi/$metadata to get the full listing. Here you can see my call to the Account Scoping Questionnaire which targets the G/L Accounts application.

 

pastedImage_1.png

View solution in original post

6 REPLIES 6

ScottHagemeyer
Archer Employee
Archer Employee

Tejpal Singh,

 

The Content API can retrieve questionnaire records. Just like for applications, all you need to provide is the Alias of the Questionnaire. If you do not know it, you can find it from a call to ../contentapi/$metadata to get the full listing. Here you can see my call to the Account Scoping Questionnaire which targets the G/L Accounts application.

 

pastedImage_1.png

Thank you Scott Hagemeyer for the quick reply. 

 

I will try this and update it on this post. 

Dear Scott Hagemeyer‌, 

 

Yes, I was able to extract all the records of the questionnaire using the content API. Thanks again!

But, I found a situation where a particular questionnaire was not listed in the output of "../contentapi/$metadata".

1. Is there any specific scenario when the URL for a questionnaire is not created in the system (like the old version of the archer)? This particular questionnaire with the issue was created in 2014.

2. If the above is a known issue,  can we look into archer DB to figure out or fix a URL for such questionnaire? 

 

BR, 

Tejpal

 

 

Tejpal Singh,

 

What has probably happened is the Questionnaire has been renamed without also updating the level alias, which is what the Content API leverages. Check out the response from "..\contentapi" to search for your questionnaire name and compare it to the alias URL it is returning.

 

The "name" property will be the UI name you see for the questionnaire. The URL should reflect the level alias for the questionnaire, as well as what you put behind "..\contentapi\LEVEL_ALIAS_HERE".

 

pastedImage_2.png

Dear Scott, 

Thank you again!

 

I found the questionnaire id by checking all the possible similar names.

But as you mentioned "level Alias", is it the one available in the General tab as "*Alias", like in the below example? 

 

pastedImage_1.png

 

Because the name of the questionnaire URL, with which I was facing the issue, is not same as above alias.

instead, it had a name starting with "Test".  

pastedImage_2.png

ScottHagemeyer
Archer Employee
Archer Employee

Tejpal Singh,

 

As I suspected, it looks like the questionnaire was created with one name, and then later renamed without updating the alias.