Step 1: Log In Using the SOAP API

The Bulk API doesn't provide a login operation, so you must use SOAP API to log in.
To establish a session, you need to use SOAP API’s login() function as described in the SOAP API Developer Guide:

The login() function returns an XML response that includes <sessionId> and <serverUrl> elements. Note the values of the <sessionId> element and the first part of the host name (instance), such as yourInstance-api, from the <serverUrl> element. Use these values in subsequent requests to the Bulk API.