{"id":17042349,"url":"https://github.com/stepio/jgforms","last_synced_at":"2025-04-12T14:42:43.986Z","repository":{"id":34294841,"uuid":"164488164","full_name":"stepio/jgforms","owner":"stepio","description":"Support submitting Google Forms through Java API.","archived":false,"fork":false,"pushed_at":"2021-09-05T11:22:00.000Z","size":141,"stargazers_count":7,"open_issues_count":9,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-26T09:21:18.304Z","etag":null,"topics":["google-forms","java"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stepio.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-01-07T20:13:22.000Z","updated_at":"2024-08-26T18:18:47.000Z","dependencies_parsed_at":"2022-08-08T00:15:37.083Z","dependency_job_id":null,"html_url":"https://github.com/stepio/jgforms","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stepio%2Fjgforms","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stepio%2Fjgforms/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stepio%2Fjgforms/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stepio%2Fjgforms/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stepio","download_url":"https://codeload.github.com/stepio/jgforms/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248583397,"owners_count":21128588,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["google-forms","java"],"created_at":"2024-10-14T09:16:24.446Z","updated_at":"2025-04-12T14:42:43.969Z","avatar_url":"https://github.com/stepio.png","language":"Java","readme":"# jgforms\n\n[![Build Status](https://travis-ci.com/stepio/jgforms.svg?branch=master)](https://travis-ci.com/stepio/jgforms)\n[![Sonarcloud Status](https://sonarcloud.io/api/project_badges/measure?project=stepio_jgforms\u0026metric=alert_status)](https://sonarcloud.io/dashboard?id=stepio_jgforms)\n[![Codacy Badge](https://api.codacy.com/project/badge/Grade/6886f76bbc2347a19fe5dda0978038a9)](https://app.codacy.com/app/stepio/jgforms?utm_source=github.com\u0026utm_medium=referral\u0026utm_content=stepio/jgforms\u0026utm_campaign=Badge_Grade_Dashboard)\n[![DepShield Badge](https://depshield.sonatype.org/badges/stepio/jgforms/depshield.svg)](https://depshield.github.io)\n[![Maven Central](https://img.shields.io/maven-central/v/io.github.stepio.jgforms/jgforms.svg)](https://mvnrepository.com/artifact/io.github.stepio.jgforms/jgforms)\n[![Javadocs](http://www.javadoc.io/badge/io.github.stepio.jgforms/jgforms.svg)](http://www.javadoc.io/doc/io.github.stepio.jgforms/jgforms)\n[![Apache 2.0 License](https://img.shields.io/badge/license-Apache%202-blue.svg)](https://www.apache.org/licenses/LICENSE-2.0.txt)\n\nSupport submitting Google Forms through Java API. No third-party dependencies (except of test-scoped), compatible with Java 7 and Android.\n\nSuppose you have a Google Form with next URL:\n```properties\nhttps://docs.google.com/forms/d/1Gn8J8I-5k-0qETKchs-P2UOs3kCU17uHs0GtqCklgLk/edit\n```\nThis part is \"form's key\": `1Gn8J8I-5k-0qETKchs-P2UOs3kCU17uHs0GtqCklgLk`.\n\nWhen you submit this form and check the resulting request through \"DevTools\", you can find next form data submitted:\n```properties\nentry.1464627081: 42\nentry.786688631: This text is just dummy\nentry.1117050788_year: 2019\nentry.1117050788_month: 1\nentry.1117050788_day: 10\nentry.1117050788_hour: 11\nentry.1117050788_minute: 46\nentry.1536399354_hour: 09\nentry.1536399354_minute: 23\nentry.1536399354_second: 14\n```\nThe above given numbers in each of the `entry.\u003cnumber\u003e: value` lines identify the appropriate questions in your Google Form.\nSo while using the project you will need them along with the above mentioned form key.\n\nTo submit data to your form using this module, just follow next steps:\n1.  Add dependency to the [latest version](https://search.maven.org/search?q=g:io.github.stepio.jgforms%20AND%20a:jgforms\u0026core=gav):\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003eio.github.stepio.jgforms\u003c/groupId\u003e\n    \u003cartifactId\u003ejgforms\u003c/artifactId\u003e\n    \u003cversion\u003e1.0.1\u003c/version\u003e\n\u003c/dependency\u003e\n```\n2.  Describe metadata, matching your Google Form:\n```java\npublic enum MyForm implements MetaData {\n\n    SOME_SHORT_TEXT(1464627081L),\n    MUCH_LONGER_TEXT(786688631L),\n    EXTRA_DATE(1117050788L),\n    SAMPLE_DURATION(1536399354L);\n\n    private long id;\n\n    JGForm(long id) {\n        this.id = id;\n    }\n\n    @Override\n    public long getId() {\n        return this.id;\n    }\n}\n```\n3.  Use metadata to prepare form data and construct `URL` object with it:\n```java\nCalendar date = Calendar.getInstance();\nCalendar from = Calendar.getInstance();\nfrom.set(date.get(Calendar.YEAR) - 1, date.get(Calendar.MONTH), date.get(Calendar.DAY_OF_MONTH), 1, 2, 3);\nURL url = Builder.formKey(\"1FAIpQLScahJirT2sVrm0qDveeuiO1oZBJ5B7J0gdeI7UAZGohKEmi9g\")\n        .put(MyForm.SOME_SHORT_TEXT, 42)\n        .put(MyForm.MUCH_LONGER_TEXT, \"Any long text could be here\")\n        .putDateTime(MyForm.EXTRA_DATE, date)\n        .putDuration(MyForm.SAMPLE_DURATION, from, date)\n        .toUrl();\n```\nThe above given code generates next URL:\n```properties\nhttps://docs.google.com/forms/d/e/1FAIpQLScahJirT2sVrm0qDveeuiO1oZBJ5B7J0gdeI7UAZGohKEmi9g/formResponse?entry.1117050788_month=1\u0026entry.1117050788_day=13\u0026entry.1117050788_year=2019\u0026entry.1536399354_minute=16\u0026entry.1536399354_second=43\u0026entry.1117050788_hour=14\u0026entry.1117050788_minute=18\u0026entry.786688631=Any+long+text+could+be+here\u0026entry.1536399354_hour=13\u0026entry.1464627081=42\n```\n4.  Submit the form data:\n```java\nSubmitter submitter = new Submitter(\n    new Configuration()\n);\ntry {\n   submitter.submitForm(url);\n} catch (NotSubmittedException ex) {\n    // TODO: log \u0026 handle the exception properly\n}\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstepio%2Fjgforms","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstepio%2Fjgforms","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstepio%2Fjgforms/lists"}