API Questions on Kentico API.
Version 6.x > API > REST Service Error with columns parameter when specifying a different culture View modes: 
User avatar
Member
Member
arogers@ecompanystore.com - 8/9/2013 3:31:03 PM
   
REST Service Error with columns parameter when specifying a different culture
I was able to get the Rest Service working and I am trying to limit the number of fields it is returning. The below request works great and returns exactly what I wanted.
http://devserver/rest/content/site/testsite/defaultculture/all/Content/Global?combinewithdefaultculture=true&format=JSON&classnames=cms.faq&columns=FAQQuestion,FAQAnswer

But if I change the culture, I get an error. I tried with es-ES, de-DE, and even allcultures in the URI, but all failed with the 400 Bad Request Error.Here is the URI with a different culture.
http://devserver/rest/content/site/testsite/de-DE/all/Content/Global?combinewithdefaultculture=true&format=JSON&classnames=cms.faq&columns=FAQQuestion,FAQAnswer

I checked the Event log and found this error message:
Description: [TreeProvider.FilterOutLocalizedVersions]: NodeID column not found.

Site name: Test Site
Machine name: devserver
Event URL: /RESTService.svc/content/all?domain=devserver&siteName=testsite&aliaspath=/Content/Global&cultureCode=de-DE&combinewithdefaultculture=true&format=JSON&classnames=cms.faq&columns=FAQQuestion%2cFAQAnswer

I'm on version 7.0.34. Let me know if there is something I'm doing wrong.

User avatar
Member
Member
arogers@ecompanystore.com - 8/9/2013 3:38:47 PM
   
RE:REST Service Error with columns parameter when specifying a different culture
So apparently, if I set combinewithdefaultculture=false, the request works and will return ONLY the documents for the different culture. However, I purposely specified combinewithdefaultculture=true because there are some cases where I want to pull the document from the default culture if there isn't one specifically created for the other cultures just yet.

Here is the URI that worked
http://devserver/rest/content/site/testsite/de-DE/all/Content/Global?combinewithdefaultculture=false&format=JSON&classnames=cms.faq&columns=FAQQuestion,FAQAnswer

Please let me know if there is something I can do to get this to work.

Thanks in advance

User avatar
Member
Member
kentico_sandroj - 8/10/2013 11:46:45 AM
   
RE:REST Service Error with columns parameter when specifying a different culture
Hello,

I'm currently trying to reproduce this issue but could you quickly try this format:
Returns an object of the given type with the specified code name assigned to the current site:

•~/rest/<objecttype>/<objectcodename>, e.g. ~/rest/cms.country/usa

•~/rest/<objecttype>/currentsite/<objectcodename>, e.g. ~/rest/cms.country/currentsite/usa

e.g. ~/rest/content/currentsite/en-us/childrenof/news

Please let me know if you get any errors.

Thanks,
Sandro

User avatar
Member
Member
arogers@ecompanystore.com - 8/12/2013 7:28:02 AM
   
RE:REST Service Error with columns parameter when specifying a different culture
This format still failed with the same error when I used a culture other than en-US
~/rest/content/currentsite/de-DE/childrenof/Content/Global?format=JSON&classnames=cms.faq&columns=FAQQuestion,FAQAnswer

Both of these requests worked:
~/rest/cms.country/usa
~/rest/cms.country/currentsite/usa

User avatar
Member
Member
kentico_sandroj - 8/14/2013 12:48:44 PM
   
RE:REST Service Error with columns parameter when specifying a different culture
Hello,

Are you sure the issue is in the format and not the data?

What if you try this: /rest/content/currentsite/de-DE/childrenof?format=JSON

Does it return any results?