I got a free ticket.

Literal

I [topic-は] free [as-で] ticket [object-を] received.

ただ literally means 'ordinary, just' but idiomatically means 'free (of charge).' The で here marks the manner or condition — 'as/in a free state.' もらう is the verb for 'to receive (as a favor),' implying the giver did the speaker a kindness.