I'm following the documentation about the Cloud Recognition
and I'm stuck at the point 4: Generate a Cloud Archive for your Target Collection
I don't understand how I can generate the cloud archive because the API it's deprecated and the new one (TargetCollection - Status - Generate Cloud Archive) request a generationId that I don't have and I don't understand where to get it.
Hope someone can help
Oh ok, now I understand, thank you, your answer helped me a lot! Great explanation.
So I can create my target collection, targets and cloud archive via Studio (or via API) and then use in my code the "Target Collection Id" that I've obtained generating the cloud archive, and start developing the Cloud Recognition.
Thank you again
Have a good day
Sure you are welcome.
You are right we need to work on the cloud documentation and I created a task for that.
If you want to use the API to generate cloud archives the target collection needs to be published to the cloud. Creating a target collection via the API does that by default. Target Collections created via Studio are not published by default and you have to trigger publishing to cloud in the ui. Publishing to the cloud in Studio does also trigger a cloud archive generation so you don't need to use the API when using Studio. When adding targets via Studio the cloud archive generation is also triggered automatically. Only when using the API directly to create targets you need to trigger cloud archive generation via the API.
For your case if the target collection is published to the cloud, indicated by a filled cloud icon, you can use it and don't need todo anything else via the API. If you try using the cloud archive generation API it should return the TARGET_COLLECTION_IS_UP_TO_DATE error in this state which just means that no generation is needed. If you further add targets via Studio the generation will be triggered for you.
If you further add targets via the API then you need to call the API for generating the cloud archive. It will return a Location header that will point to the endpoint you can call for getting the progress of the process and it will return some json with information of the processing including the generationId that can be used to get the progress of the process. Using the Location header should be the preferred way though.
Thank you for your answer.
I still don't understand how to use https://www.wikitude.com/external/doc/documentation/studio-api/#api-TargetCollection-GenerateCloudArchive because, like the API documentation said, it's deprecated and return error TARGET_COLLECTION_IS_UP_TO_DATE with status code 412, so I can't use it.
Another question, If I enable manually the Cloud Archive from Studio, how/where can I get the generationId to use for example for the TargetCollection - Status - Generate Cloud Archive that requires that parameter?
Sorry for the lot of questions but the cloud documentation it's a bit chaotic.
Thank you again
sorry for the confusion with the documentation. We are planning to make the Cloud Archive generation automatically, in the background, so that in a future version triggering it won't be needed anymore. For now you can still use it. The "TargetCollection - Status - Generate Cloud Archive" API is not to replace the other one but is complementary to the current one. Generate Cloud Archive will have the Location header set which can be used to request the status of the process as well as returning the initial status and some more data.
You could also trigger the generation of the Cloud Archive from Studio manually. Depending on your specific need that might be more appropriate.