Word came Friday that Zaarly, a San Francisco-based start-up that has created a platform for users to buy and sell goods locally, will be opening an office in New York City.

The news by itself wasn't all that surprising. The company has been growing like crazy, raising tons of cash, and attracting celebrity board members such as Meg Whitman. Growing companies expand—this is not breaking news.

But what caught our eye was something a bit juicier: New York City mayor Mike Bloomberg gushed over the company, welcoming it to the Big Apple in a prepared statemtfent.

"Zaarly, which connects small businesses and other entrepreneurs with potential customers, is a great addition to our exploding tech sector and I want to wish them and CEO Bo Fishback a warm welcome," Bloomberg said.

To be sure, Bloomberg been on the prowl to promote the New York tech scene, having attending his first NY Tech Meetup in October, and announcing the creation of a New York Tech Council. But it's the kind of shout-out that plenty of start-ups and entrepreneurs would kill to get.

So this made us wonder: What does it take—or who do you have to know—to get your start-up a similar welcome?

We caught up with the company's founders and asked them how they got the hook-up.

Eric Koester, Zaarly's co-founder and chief marketing officer, explains that before the company even launched—let alone had a functioning product—it was building a "dream team" of New York-based people that would advocate for the brand and create buzz before it even arrived. They held happy hours in New York for Zaarly and drew in a mixture of people from tech scene, journalists, investors—even accountants and stay-at-home moms.

By networking and developing relationships with people in the New York tech community, it caught the eye of Bloomberg's office. It helped, too, that the company's investors—such as Kleiner Perkins, Michael Arrington, and Meg Whitman—had their own connections with the local government.

"From the beginning, they said 'Please let us know how we can be helpful,'" says Bo Fishback, the company's co-founder and CEO. "So we said sure. The quote that we got was pretty awesome. I could not have written it better if I could have tried."

It all came down to getting face time with the people that mattered. "You can't build those relationships through e-mail. You gotta be there."

So, what's Fishback's advice on getting your start-up under the noses of local officials?

"One of the things I've been learning is that there are really long-standing and robust relationships between a lot of the people who make stuff like that happen," says Fishback. "We've been through a few different PR firms and didn't have a huge amount of luck, so we started to pick who we wanted to work with much more by the individual, rather than the firm."

Even hiring is a matter of relationships. "We think very clearly—beyond just PR—what relationships they bring to the table that we might not have," he says. "The cold-call out of the blue to say, 'Hey, I want something from you right now' is not the most effective way to get things done. It means you have to start investing in those relationships."

And if you don't have those built-in relationships, Pravina Raghavan, the U.S. Small Business Administration District Director for New York, says it's not always as hard as you think to get recognized by the high-profile politicians.

"The government needs to know you exist," she says. "I think almost every government agency would love to be behind a start-up. Even just picking up the phone—I have plenty of entrepreneurs that meet me at an event and call me and ask to sit down for 20 to 30 minutes.  Part of it is, we need to know they're out there."