We store the user's contactId in our database and use it to fetch/edit/delete contacts when the user requests from our app. Now that Google Contacts API is to be sunset, we need to call Google People API for these actions using resource id.
Is there any way to get Google People API resource ID from Google Contacts contact Id?
I found the following answer in Stackoverflow:
The Contacts API and People API are separate API's not meant to interop with each other.
That said, the reverse engineered way to do this is to take the Contacts API contact ID, parse that hexadecimal value, convert it to decimal, and add a 'c' prefix to it, and that becomes the People API person resource ID.
e.g. if the Contacts API contact ID was 100, then the People API person ID would be c256. When you fetch contacts from the People API in this fashion, it'll have the joined profile information, if present.
I tried the solution and it is working, but need to know whether we can use this conversion error free (i.e without any exceptions) to populate the respective resource id to the contact id.