In preparing to film “Southside With You,” which premiered at the Sundance Film Festival earlier this week, Parker Sawyers and Tika Sumpter had some impressive shoes to fill. In the film, they play Barack and Michelle Obama (née Robinson) as they were in 1989: he, a Harvard Law summer associate at a prestigious Chicago firm, and she, an ambitious young lawyer and his adviser. Telling the story of their first date, it’s the first major depiction of the Obamas in a feature film, and Sawyers and Sumpter portray the future first couple with such sweetness and magnetism that you’d be forgiven for thinking them an item offscreen. But it didn’t come without baggage. “I was worried that the CIA would come shut us down!” Sumpter says, laughing. “It is the leader of the free world, after all.”

The actress, who also serves as a producer on the film, was on board with the project from the beginning, but Sawyers may never have gotten the part it weren’t for a technical glitch. When the 32-year-old actor, who was born and raised in Indianapolis but lives in London, sent in his first audition tape, he was doing a pitch-perfect impersonation of the president at 54, rather than at 28. After he didn’t hear back, he readied a second tape — which never made it to the film’s director, Richard Tanne. “My wife and I did the tape, edited it, and were trying to upload it to Vimeo, but it was going super slow,” he says. “It was like 36 percent loaded, and it was late in London, so all I could think was, ‘God, I’m going to be up another couple hours.’” Just as the tape was about to send, Sawyers received an email from his manager with notes from Tanne telling him to strip back his performance. He adjusted accordingly, and was soon awarded the part, his first lead role in a film. “Thank God for slow Wi-Fi,” he says.

For Sumpter, 35, whose past credits include the CW teen series “Gossip Girl” and the 2014 action comedy “Ride Along,” playing the First Lady was always about “embodying her essence” rather than straight imitation. She employed a dialect coach to nail her speech patterns and picked up clues about her life as a young woman from the memoir “A Game of Character,” written by Michelle’s brother, Craig Robinson. Both Sumpter and Sawyers listened to recordings of the Pulitzer Prize-winning poet Gwendolyn Brooks and read Ralph Ellison’s “Invisible Man,” trying to put themselves in the context of the young couple when they first fell in love. Sawyers even smoked Obama’s preferred Marlboro cigarettes — which can be seen throughout the film — and scoured YouTube for clips of the president during candid moments. “There’s a video from the 2014 midterm election when he’s voting and some guy goes, ‘Don’t touch my girlfriend,’ and he says, ‘I really wasn’t planning on it.’ He could ignore the guy, but he made a joke instead. And he’s the president!”

“Southside With You” won fans at its premiere, but it has yet to reach its most famous audience: the Obamas. During a Q&A after the screening, Tanne said the president and first lady are aware of the film, if “a little baffled by its existence.” For their part, the actors are cautiously optimistic about the couple seeing their work. “I’d probably just stare at him and wait for him to speak,” says Sawyers. “I’d honestly be honored for him to see anything I’ve done, let alone me playing him.” As for the question of whether he thinks the film can reach both sides of the political divide, Sawyers is more confident. “If people on the right do want to see it, I’m pretty sure they’ll walk away delighted,” he says. “It’s the answer to the age-old question at any dinner party: How did you meet? What was your first date like?” Adds Sumpter, “Who doesn’t relate to love?”