You must give the API (passenger details including passport) before you are allowed to check in. They have to submit this info to the destination country before take-off. They then have to an ID check (passport check) by airport or airline staff at the gate to ensure the person getting on the plane is the same as they have submitted details for.
The USA also has a similar requirement when you fly back.
If you are having problems with the API online, then you can't do an online check-in. As long as your airline allows it, you can to both at the airport check-in desk.
As to your actual problem, are there any fields which you have left blank, or are showing with a red border after you submit the form?
Usually they require the passport expiry date. I see this is Iberia, are you perhaps giving the date in US-format, and it is being rejected?