Error when Creating Gallery Post via REST Api - ver 6.1

Error when Creating Gallery Post via REST Api - ver 6.1

This question is answered

When I try to create a Gallery post via the REST Api the response from the api is the generic error page:

"Sorry, there was a problem with your last request!

Either the site is offline or an unhandled error occurred. We apologize and have logged the error. Please try your request again or if you know who your site administrator is let them know too."

Looking at the server event logs the error is:

Exception type: ArgumentNullException

   Exception message: Value cannot be null.

Parameter name: input

  at System.Text.RegularExpressions.Regex.Matches(String input)

  at Telligent.Evolution.Components.TextPartManager.Parse(String text)

  at Telligent.Evolution.Components.CSApplication.ExecutePostEvent(Object EventKey, IContent content, ObjectState state, ApplicationType appType, PostTarget target)

  at Telligent.Evolution.MediaGalleries.Components.MediaGalleryPostDataService.FormatPost(MediaGalleryPost post)

  at Telligent.Evolution.MediaGalleries.Components.MediaGalleryPostDataService.CreateFile(Int32 sectionID, MediaGalleryPost post, Guid postAttachmentID)

  at Telligent.Evolution.MediaGalleries.Components.MediaGalleryPosts.CreateFile(Int32 sectionID, MediaGalleryPost post, Guid postAttachmentID)

  at Telligent.Evolution.Rest.Resources.Media.MediaService.CreateMedia(Nullable`1 mediaGalleryId, String name, String description, String contentType, String fileName, Byte[] fileData, String fileUrl, Nullable`1 isFeatured, String featuredImage, String tags, Boolean isPreview, RestExtendedAttributes extendedAttributes)

  at Telligent.Evolution.Rest.Resources.Media.MediaController.Create(MediaCreateRequest request)

The post data is

POST url.com/.../files.xml HTTP/1.1

Rest-User-Token: Z3YyMW5tZndvdXlwaDF1cG9qN3IzaHJiOGlkdzphZG1pbg==

Content-Type: multipart/form-data; boundary=784f0252176b40dcb46a6e992f3a846c

Host: avocenttelligent-dev

Content-Length: 58806

Expect: 100-continue

--784f0252176b40dcb46a6e992f3a846c

Content-Disposition: form-data; name="MediaGalleryId"

136

--784f0252176b40dcb46a6e992f3a846c

Content-Disposition: form-data; name="Name"

Supported client OS and browser for OBWI

--784f0252176b40dcb46a6e992f3a846c

Content-Disposition: form-data; name="ContentType"

application/vnd.openxmlformats-officedocument.wordprocessingml

--784f0252176b40dcb46a6e992f3a846c

Content-Disposition: form-data; name="FileName"

filename.docx

--8fa595c08a8649e492018b2fc2e581eb

Content-Disposition: form-data; name="FileData"; filename="filename.docx"

Content-Type: application/vnd.openxmlformats-officedocument.wordprocessingml

LOTS OF BINARY

--8fa595c08a8649e492018b2fc2e581eb--

Any Idea how I even debug the problem?

Verified Answer
All Replies
  • I was missing the field "Description". I now set it to the same as "Name" and I no longer get the error.

    Looks like a documentation error as here - telligent.com/.../create-a-gallery-post.aspx - is says Description is optional.

  • You are correct, the description field was wrongly identified by us as being optional and our documentation reflects that. The description is not optional and is required. I'll update the documentation to reflect that. Thanks.

  • Great work Fran and Dan! :)