/api/v2/projects endpoint returns invalid project ID for use in mobile deeplinks
complete
H
Honey Swordtail
Previously, we used your https://cloud.sensopia.com/dispatchplan.php endpoint to create new projects. This returned a planID e.g. 6735c46f0a1c2. We used this planID to create a mobile deeplink to the project e.g. magicplanstd://open?plan=6735c46f0a1c2&showInfo=1.
We have been looking at moving to your new https://cloud.magicplan.app/api/v2/projects endpoint instead to create new projects. The response from this endpoint no longer returns a planID field, but instead just an ID field e.g. 09701c6b-7af3-43b2-9498-f9058f3d4172. However, using this returned ID in the mobile deeplink does not work. Clicking a deeplink with this ID gives "Project not found" in the Magicplan app.
When you go to the web view of the project created with this new endpoint (https://cloud.magicplan.app/estimator/projects/09701c6b-7af3-43b2-9498-f9058f3d4172/overview) and inspect the network requests you can see a GraphQL call to planHierarchyDataGet, which returns a response that has both ID and SensopiaID as e1b281b5-defb-46a8-af87-aec54f43a599. Creating a mobile deeplink using this ID works correctly.
So, my question is: when using the new create project endpoint, how can we know what the correct ID of the project is in order to create a mobile deeplink to the newly-created project? Is this new endpoint perhaps returning the wrong ID? Though I note this wrong ID is used in the web URL of the project.
Log In
Bernd Wolfram
complete
J
Joachim Hotonnier
The new project endpoint gives a project id, not a plan id. This is why the deeplink does not work. It works only with a plan id.
You can use a different type of deeplink to open a project with a given project id. It is magicplanstd://project/ followed by the project id.
So in your case, it is magicplanstd://project/09701c6b-7af3-43b2-9498-f9058f3d4172
H
Honey Swordtail
Joachim Hotonnier Cool - thanks for explaining and sharing about the new deeplink. I've tested it and it works perfectly, thanks.