In the case of sentences which contain a transitive verb such as give, get, buy, etc. one or more objects will be necessary. Whenever there´s more than one object, you'll have to determine what the direct object and indirect objects are. A question such as the following ones may be helpful:
What did [subject] give? to whom?
What did [subject] ask? to whom?
What did [subject] promise? to whom?
<u>In every case the answer to "what" is the </u><u>direct object</u><u> and the answer "to whom" the </u><u>indirect object.</u>
So, in this sentence, the structure pattern is the following:
They [subject] gave [verb] me [indirect object] a bonus [direct object].
An indirect object is a noun or a pronoun that receives the direct object or that is affected by it. We can identify an indirect object by first identifying the direct object, which is the one that receives the action of the sentence, and by answering the “for/to whom?” or “for/to what?” questions.
In the sentence "They gave me a bonus," the direct object is "a bonus" because it is the one that receives the action "gave" (<em>What did they give? Answer: a bonus</em>), and the indirect object is "me" because it is the pronoun that receives the indirect object and it answers the question: <em>To whom did they give a bonus? Answer: To me.</em>