Associate contact with potential via API

Associate contact with potential via API

Hello, I would like to associate a contact with a potential. How can I do it?
If this can be done with updateRelatedRecords method, how do I get the ID of the potential and the contact I have just created via the API in order to use it at updateRelatedRecords method.

Thanks,
Nikos