It seems that you are passing the Custom Object ID as the association definition ID, which will not work. You need to check what the ID is of your association between your contact object and your custom object. You can do so by retrieving your custom object schema.
You can make the API call from the docs itself, take a look at the ‘Get an existing schema’ part and add your custom object name or object type ID to the params. You can then make a test call on the right side.