The donate method of the donation API does not have a special parameter for an appeal code however it is possible to achieve the same functionality through a adding a custom field to a donation form. The added custom field can be hidden and made to pass the appeal code whenever the donate call is made.To view a report of donations made and the appeal code passed you can create a report using Report Writer.

Also see How to update a custom field in an API donation form for details on how to add the custom field on a donation form.