Important Update: Some Community URL Redirects are Under Maintenance. Learn More. .

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

Anonymous
Not applicable

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

10 REPLIES 10

Anonymous
Not applicable

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

 

 

Anonymous
Not applicable

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

Anonymous
Not applicable

Tejpal Singh,

 

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

Hi @Anonymous ,

I am also facing same issue mentioned by @TejpalSingh . I tried above solution but it only fetch 1000 records, not all records. However, I want to fetch all records at a time from an applicaiotion/questinnaire using Content API. How can I achieve it?

 

 

Anonymous
Not applicable

1000 per call is by design. If you need more, u need to use fetching, for example by using ?skip parameter:

https://help.archerirm.cloud/platform_612/en-us/content/api/contentapi/contentapi_get_level_metadata.htm

So, skip and skip unless u reach the end.

Hi @Anonymous , 

Thanks for prompt response.

I will go through above link. 

I have one more query - Is a way to filter records while fetching records from an application using content API?

Thanks!