title: Stripe Ruby On Rails Server login_link responseSerializationFailed
body: <p>I have a functioning Ruby on Rails server which is being used to handle Stripe account creation, payments, and express (connect) account management. The api says the the login_links.create api should return a JSON, however I receive the error: </p>
  
  <p>"responseSerializationFailed(Alamofire.AFError.ResponseSerializationFailureReason.jsonSerializationFailed(Error Domain=NSCocoaErrorDomain Code=3840 "Invalid value around character 0." UserInfo={NSDebugDescription=Invalid value around character 0.}))
  " </p>
  
  <p>when trying to receive any response from my own api client. The API for login_links (<a href="https://stripe.com/docs/api#create_login_link" rel="nofollow noreferrer">https://stripe.com/docs/api#create_login_link</a>) is somewhat vague, but I am a ROR beginner so any help is appreciated.</p>
  
  <p>My ROR Server /CreateBalanceLink function:</p>
  
  <pre><code>post '/createBalanceLink' do        
      begin
          accountID = params[:account]
          account = Stripe::Account.retrieve(accountID)
          account.login_links.create
  rescue Stripe::StripeError =&gt; e
      status 402
      return "Error creating link: #{e.message}"
  
  end
  
  status 200
      return "Link successfully created"
  end
  </code></pre>
  
  <p>My API Client:</p>
  
  <pre><code>func generateBalanceAccessLink(stripeAccount: String, completion: @escaping (_ result: Bool) -&gt; ()) {
  let url = "https://******.herokuapp.com/createBalanceLink" //Replaced for security
  let params: [String: Any] = [
      "account": stripeAccount
      ]
  Alamofire.request(url, method: .post, parameters: params)
      .validate(statusCode: 200..&lt;300)
      .responseJSON { responseJSON in
          switch responseJSON.result {
          case .success(let json):
              let data:[String:AnyObject] = json as! [String : AnyObject]
              print(data)
              //print("Created Link:",data["url"] as! String)
              //appDelegate.balanceLink = data["url"] as! String
              completion(true)
          case .failure(let error):
              print(error)
          }
      }
  
  }
  </code></pre>