How can I add dashboard.json file to dashboards?

My aim is to upload a dashboard to dashboard. I tried export the dashboard using API.
Can someone please give me a hint on whether I can use API instead of using UI. Another thing could you please tell me, How we use API key tokens.