Marketo "Import Lead" fails with error 610 Requested resource not found
Question: I'm trying to batch **update a bunch of existing records** through Marketo's
REST API. According [to the
documentation](http://developers.marketo.com/documentation/rest/import-lead/),
the Import Lead function seems to be ideal for this.

In short, I'm getting the error "610 Resource Not Found" upon using the curl
sample from the documentation. Here are some steps I've taken.

  1. Fetching the auth_token is not a problem:

    
    
    $ curl "https://<identity_path>/identity/oauth/token?
        grant_type=client_credentials&client_id=<my_client_id>
        &client_secret=<my_client_secret>"
    

  2. Proving the token is valid, fetching a single lead isn't a problem as well:

    
    
    # Fetch the record - outputs just fine
    $ curl "https://<rest_path>/rest/v1/lead/1.json?access_token=<access_token>"
    
    # output:
    {
      "requestId": "ab9d#12345abc45",
      "result": [
        {
          "id": 1,
          "updatedAt": "2014-09-18T13:00:00+0000",
          "lastName": "Potter",
          "email": "harry@hogwartz.co.uk",
          "createdAt": "2014-09-18T12:00:00+0000",
          "firstName": "Harry"
        }
      ],
      "success": true
    }
    

  3. Now here's the pain, when I try to upload a CSV file using the [Import Lead function](http://developers.marketo.com/documentation/rest/import-lead/). Like so:

    
    
    # "Import Lead" function
    $ curl -i -F format=csv -F file=@test.csv -F access_token=<access_token> 
        "https://<rest_path>/rest/bulk/v1/leads.json"
    
    # results in the following error
    {
      "requestId": "f2b6#14888a7385a",
      "success": false,
      "errors": [
        {
          "code": "610",
          "message": "Requested resource not found"
        }
      ]
    }
    

The [error codes
documentation](http://developers.marketo.com/documentation/rest/error-codes/)
only states _Requested resource not found_ , nothing else. So my question is:
what is causing the 610 error code - and **how can I fix it**?

Further steps I've tried, with no success:

  * Placing the access_token as url parameter (e.g. appending '?access_token=xxx' to the url), with no effect.
  * Stripping down the CSV (yes, it's comma seperated) to a bare minimum (e.g. only fields 'id' and 'lastName')
  * Looked at the question [Marketo API and Python, Post request failing](http://stackoverflow.com/questions/25411664/marketo-api-and-python-post-request-failing)
  * Verified that the CSV doesn't have some funky line endings
  * I have no idea if there are specific requirements for the CSV file, like column orders, though...

Any tips or suggestions?


Answer: Error code 610 can represent something akin to a '404' for urls under the REST
endpoint, i.e. your `rest_path`. I'm guessing this is why you are getting that
'404': Marketo's docs show REST paths as starting with '/rest', yet their rest
endpoint ends with /rest, so if you follow their directions you get an url
like, `xxxx.mktorest.com/rest/rest/v1/lead/...`, i.e. with '/rest' twice. This
is not correct. Your url must have only one 'rest/'.

