Get Started         Best Practices         Developer Guide         FAQ        
Name is required.
Email address is required.
Invalid email address
Answer is required.
Exceeding max length of 5KB

Management API and Item creation with contents

Brian H. Mayo Nov 09, 2017

Maybe I missed it while reading over the Management API, but how can we fully construct a trackable Item that contains contents, which are references to media?

In the example to create and update an Item, I see the content JSON object being used to contain random key/values. What I want to do is this, I want to programmatically be able to create an Item, and in that item specify trackage content in the item, and for each trackable content, provide the values like translation matrix, scale matrix, etc.

Thank you.


( Agent )
Luis Martinell

Nov 10, 2017

Hi Brian,

Have you been able to retrieve and update AR Items and their contents through the managemt API already?

This is possible. I recommend you create an AR Item with some contents and then inspect the JSON when you retrieve the item through the management API.

You can find documentation here about the JSON structure for AR contents:
https://support.catchoom.com/customer/portal/articles/2037859

Best regards,
Luis

0 rated
Brian H. Mayo

Nov 14, 2017

I reviewed the page reference you sent, and it speaks to the return JSON object you get.

What I need is the JSON object structure I must send TO the Management API to make the item with the content.

Thus, I am using the Management API, and the Create Item end point (https://catchoom.com/documentation/management-api/create-item/)
It speaks to a key of "content" that must be a valid JSON object. I assume this where I can specify what contents are to be associated within the Item. My confusion lies in the example you given on that Management API reference page where you give a value for "content" as this: "content": {"year": 1893, "artist": "Edvard Munch"} }', which appears to be custom key/value pairs and not specific to formal content.

What I don't know is what structure that is to have? I assume there is an array in there somewhere.
I assume I would include specifics like: rotation_euler, rotation_matrix, scale, translation, type, alpha. But, do I give it the "media_uuid" to reference previously uploaded media?

Please provide me an example of a specific JSON object that I would include in the Create Item end point call that allows me to create an Item and specify the content on this Item given previously uploaded media.

Thank you.
0 rated
Brian H. Mayo

Nov 14, 2017

Okay, so I think I figured it out... check my logic here.

There is a specific progression of steps you must go through in order to pull this off.

Step #1:
Create the Item with information that you have including the content JSON object.
** note, that if you check the result of the created Item the content key will have a string for the value where you would expect a JSON object.

Step #2:
Create the Image and reference the Item UUID you got back from Step #1
** note, after this step, the content key, which was a string, now comes back as a proper JSON object.

A few things I noticed from this. When you do this and then go into the Content Editor, it will say the scene is not yet generated. I have not yet done a full AR interaction yet on the device to check if all is working okay but I assume this is just a message strictly in reference to the Content Editor.

One thing I am still not 100% sure about is exactly what the required fields are when creating the Item and given the content JSON object. Right now I included everything including the media_uuid and the image_url (for an image type content). I assume you don't need both, maybe just the media_uuid since if I am providing that either a) it is an invalid media_uuid, or b) it is valid and you have the image_url or video_url that is retrieved from the formal media item itself.

I'm not sure how much usage the Management API gets, but I would suggest a bit more documentation around specifics of using the API to 1) add media, 2) create items, 3) associate reference images to Items, 4) add content to Items.

This has been a lot of trail and error for me to unravel that would been made easier with more complete documentation.
0 rated
( Agent )
Kristoffer Pantic

Nov 15, 2017

Hi Brian,

We’ll take those things into account and work on improving our documentation in the areas you cited. What were the specific issues you had with the documentation regarding 1 (Add media), 2 (Create items) and 3 (Associate reference images to items)? We’re aware that the documentation for dynamically adding content to items is incomplete and will improve it soon.

As for the issue with the Item saying “The scene is not yet generated” it is in fact related to the Content Editor, without opening it and rendering it, we can’t generate a preview which also takes into account the position of the camera. We’ll also review the issue with returning a String instead of a proper JSON object. Which of our Management API libraries are you using?

Cheers,
Kristoffer

0 rated

Post Your Public Answer

Your name (required)
Your email address (required)
Answer (required)

Couldn't find what you were looking for?

support@catchoom.com
https://cdn.desk.com/
false
catchoom
Loading
seconds ago
a minute ago
minutes ago
an hour ago
hours ago
a day ago
days ago
about
false
Invalid characters found
/customer/en/portal/articles/autocomplete