Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7632175
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T06:33:16+00:00 2026-05-31T06:33:16+00:00

I am currently working on building an Android app for my Rails backend. I

  • 0

I am currently working on building an Android app for my Rails backend.

I created api_tokens_controller to create an api_token when user logs in from Android using HttpPost and save that token both in Rails user table and Android shared preferences. I was able to verify this.

I am trying to send the api_token as params[:api_token] from my Android app with every subsequent request after initial log in and have Rails verify:

In User.rb:

def self.authenticate_with_api_token(api_token_from_mobile)
    user = find_by_api_token(api_token_from_mobile)
    if user.nil?
        return nil
    else
    return user
    end
end

if user exists, then send other data as JSONObjects.

I am running into trouble conceptually here. I am now trying to have the Android app go to
…:3000/users and HttpGet user data as JSONObjects. The problem is that I don’t know how to send the api_token from Android app to Rails in HttpGet. I am assuming that since it is RESTful, my HttpRequests have to correspond to the way rails routes work.

Questions:

  1. Is it possible to send in JSONObject of params[:api_token] from android app to Rails in HttpGet?

  2. Do my HttpRequests have to correspond to the RESTful way Rails works or can I just only use HttpPost?

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T06:33:18+00:00Added an answer on May 31, 2026 at 6:33 am

    If I understand you correctly, then you just want to add the API token to as a URL parameter if using GET, so something like:

    …:3000/users.json?api_token=token

    This will put the api_token in the params hash just the same as POST data would be. The RESTful way would be to use GET for retrieving data from the API and using POST to send data, i.e. changing data on your backend but if you are going to be returning a user with the request then GET is the correct method to be using anyway.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm currently working on building a java web app. I've been looking to use
I'm working on a CakePHP project and am currently building the user authentication part
I'm currently working on redesigning an application which is building a model from input
I am currently working on an iPhone app that will have a user log
I am currently working on building a classifier using c5.0. I have a dataset
I'm currently using Monodroid to develop an android app. I'm rather new to phone
I'm currently building an app that will play sounds. When a user starts a
I'm currently working on a project that is building a java-based desktop application to
I'm working on building the Boost platform for a currently unsupported toolchain. Obviously we'd
I am currently working on building a baseball website. On one side of the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.