2

I'm programming an Android App for a company, and they use CiviCRM for subscribing to newsletters. The form is available to anyone online, but I have to add the form in an android app. On the android app, i use a button "Send", who should send the form as the online form. Then the form is recorded in a database using CiviCRM. In order to do that, I need to create a JSON object, and send the request using Ajax. But I have no idea of what should be the url of the ajax request, and what should be the variables I should use.

The form is composed of three parts: a select, four text inputs and two checkbox sets.

1

You might want to check the CiviMobile Extension:

https://civicrm.org/extensions/civimobile

and see how things are done in that app. Might help give you a better direction for the app.

In general, you might want to first design / develop what you want to do with CiviCRM first before deciding how to do it in an app. Your use case seems to be an instance of CiviCRM profiles.

| improve this answer | |
1

Visit the API Explorer (Help menu > Developer > API Explorer) on your CiviCRM installation. You can use it to generate both the set of variables you can use, and view the REST API URL specific to your installation.

If your form submits fields that are part of different entities (an entity generally maps to a SQL table), start with getting it to work with a single entity. Once you've got that handled, you can do API chaining to avoid multiple REST calls.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.