Yes it is temporary. You have not associated it with the content at this point.
Hi Kevin, do you know how to associate the temporary image with the content so it is not temporary anymore?
1 person found this helpful
I got very interesting but valid reply from jive support. I tried and the behavior is as described below (with minor changes) by jive support analyst John Decker
When the image is associated with content the objecttype and objectid of the image will be updated accordingly in the database. However, when using the URL, the image is not being properly associated with that image during content creation. This parameter (in bold) prevents the image from converting:
The work-around here is if you are referencing the image URL, do it without the unnecessary URL parameter
1 person found this helpful
Hi there !
Many many thanks for this tip you saved my day !
I tried different ways to add an image to a blog post. I managed to do so, but I didn't figured out how to display the image as a thumbnail of my blogpost in the activity stream.
So here is my process :
- Upload the image using the image service endpoint : Jive REST API v3.14 → Image service
- Retrieve the image URL given in the result ("Location" param in the Header)
- Strip off all the parameters in the url as Ashish mentionned
- Then create a blog post with a HTML content. The image URL must be put in a <img> tag
- Don't know how, put then my image is processed by Jive and the URL becomes something like http://example.com/servlet/JiveServlet/downloadImage/38-2312-58504/image.jpg
- Et voilà !
This tip should definitely be explained in the API documentation, 'cause nothing explains exactly how to add an image to a post...
Hello, can you share some sample code how you uploaded the image to the image service?
I keep getting a 403 error message.
Hello Klas Mamto
My code is in C#.
Assuming you are already connected to the API and have an access token :
var client = new HttpClient(); string urlJivePost = "https://yourcompany.com/api/core/v3/images"; // authentication client.DefaultRequestHeaders.Add("Authorization", "Bearer " + accessToken); client.DefaultRequestHeaders.Add("X-Jive-Run-As", "username " + user); var requestContent = new MultipartFormDataContent(); var imageContent = new ByteArrayContent(ImageData); imageContent.Headers.ContentType = MediaTypeHeaderValue.Parse("image/png"); requestContent.Add(imageContent, "image", "image.jpg"); var task = System.Threading.Tasks.Task.Run(async () => await client.PostAsync(urlJivePost, requestContent)); task.Wait(); var result = task.Result; String imageLocation = result.Headers.Location.ToString(); int returnResult = result.StatusCode;
hope this will help you
How is this an answer to the problem?
"the image is not being properly associated with that image" ? How is it that just removing the url parameter help avoiding the "temporary image" problem? how would the content become associated with the image (or viceversa) so that the image becomes truly persisted and no longer resides in the temporary path?
I have notices that for profile images there's an available service to associate a temporary image with the profile, but that seems to be unavailable for contents.