# Mobile app - Submit form

**URL:** <https://community.hubspot.com/t/mobile-app-submit-form/106548>\
**Category:** APIs & Integrations\
**Tags:** forms\
**Created:** [May 6, 2024, 4:56pm UTC](https://community.hubspot.com/t/mobile-app-submit-form/106548 "2024-05-06T16:56:39Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![NeptuneGlobal](https://avatars.discourse-cdn.com/v4/letter/n/e9c0ed/32.png) [@NeptuneGlobal](https://community.hubspot.com/u/NeptuneGlobal)\
**Post date:** [May 6, 2024, 4:56pm UTC](https://community.hubspot.com/t/mobile-app-submit-form/106548/1 "2024-05-06T16:56:39Z")

</div>

I am working on a mobile app & want to connect a Marketing \> Form to our CRM \> Contact database. I think I have to use the API to send a Post request to the server.

Can’t get the form to post. What methods are implemented when embedding forms into mobile apps?

I think this is the endpoint I need to hit - [Documented here](https://legacydocs.hubspot.com/docs/methods/forms/submit_form_v3_authentication#:~:text=As%20this%20API%20is%20authenticated%2C)  
[https://api.hsforms.com/submissions/v3/integration/secure/submit/\[ClientID]/\[FormID]](https://api.hsforms.com/submissions/v3/integration/secure/submit/%5C%5BClientID%5D/%5C%5BFormID%5D)

However, no matter what I do, it keeps kicking me back a 401 auth error (below). Do I need to obtain a bearer token before submitting form or is there another way?

{  
&nbsp;&nbsp;&nbsp;&nbsp;“status”: “error”,  
&nbsp;&nbsp;&nbsp;&nbsp;“message”: “Any of the listed authentication credentials are missing”,  
&nbsp;&nbsp;&nbsp;&nbsp;“correlationId”: “6e5e…”,  
&nbsp;&nbsp;&nbsp;&nbsp;“engagement”: {  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;“oauth-token”: “oauth-token not engaged. OAuth access token not found in request header.”,  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;“service-to-service”: “service-to-service not engaged. Metadata for service-to-service request not found.”,  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;“hapikey”: “hapikey not engaged. hapikey is not present in query params.”,  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;“app-cookie”: “app-cookie not engaged. App cookie is not present on the request.”,  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;“internal-cookie”: “internal-auth not engaged. Service using internal auth must be deployed on an internal load balancer.”  
&nbsp;&nbsp;&nbsp;&nbsp;}  
}

---

<div class="post-metadata">

**Author:** ![DianaGomez](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/dianagomez/32/48035_2.png) [@DianaGomez](https://community.hubspot.com/u/DianaGomez)\
**Post date:** [May 7, 2024, 9:22am UTC](https://community.hubspot.com/t/mobile-app-submit-form/106548/2 "2024-05-07T09:22:14Z")

</div>

Hi @NeptuneGlobal,

Thank you for reaching out to the Community!

Let’s consult with a few experts for guidance.

Hello @Jnix284, @JuanGomez0818, @GRajput - Do you have any advice for @NeptuneGlobal regarding the error they are encountering?

Thanks,

Diana

---

<div class="post-metadata">

**Author:** ![jnix284](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jnix284/32/29_2.png) [@jnix284](https://community.hubspot.com/u/jnix284)\
**Post date:** [May 7, 2024, 11:35am UTC](https://community.hubspot.com/t/mobile-app-submit-form/106548/3 "2024-05-07T11:35:58Z")

</div>

Thanks for the tag @DianaGomez, this is a little outside of my experience with APIs, hopefully one of the others can help!

---

<div class="post-metadata">

**Author:** ![NeptuneGlobal](https://avatars.discourse-cdn.com/v4/letter/n/e9c0ed/32.png) [@NeptuneGlobal](https://community.hubspot.com/u/NeptuneGlobal)\
**Post date:** [May 7, 2024, 3:02pm UTC](https://community.hubspot.com/t/mobile-app-submit-form/106548/4 "2024-05-07T15:02:53Z")

</div>

I heard back from support. They indicate that I have to use one of these two methods.

After reading I think the private app method will work. It is hard to say, since they don’t seem to give a clear indication of what the private app is.

> **[Authentication overview - HubSpot docs](https://developers.hubspot.com/docs/apps/developer-platform/build-apps/authentication/overview)**
>
> Learn how to manage authentication for your apps and when developing locally.

> **[What's Best for my HubSpot Integration? Choosing Private vs. Public HubSpot Apps](https://developers.hubspot.com/blog/hubspot-integration-choosing-private-public-hubspot-apps)**
>
> Recommendations from our developer relations team on whether to build a public or private HubSpot app for your custom integration.

> **[Developer platform - HubSpot docs](https://developers.hubspot.com/docs/apps/developer-platform/overview)**
>
> Learn how to create apps on the HubSpot developer platform.

---

<div class="post-metadata">

**Author:** ![Jaycee\_Lewis](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jaycee_lewis/32/61352_2.png) [@Jaycee\_Lewis](https://community.hubspot.com/u/Jaycee_Lewis)\
**Post date:** [May 7, 2024, 9:14pm UTC](https://community.hubspot.com/t/mobile-app-submit-form/106548/5 "2024-05-07T21:14:10Z")

</div>

Hey, @NeptuneGlobal👋 I’m happy to help. You are on the right path.

Here are some steps to take, plus an example of what including your Private App might look like:

- Create a Private App — navigate to Settings \> Integrations \> Private Apps \> [Create a Private App](https://developers.hubspot.com/docs/api/private-apps#create-a-private-app)

 ![CleanShot 2024-05-07 at 15.02.03.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/7/d/7d664dd6d0e03e5ee159140c6937364a945abddd.png)

- Give your Private App the necessary scopes. You can find this info in the [Forms API dev doc](https://legacydocs.hubspot.com/docs/methods/forms/submit_form_v3_authentication)

 ![CleanShot 2024-05-07 at 14.53.33.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/8/7/87522bb91c6b351dede928ba53a64fc51d2d568b.png)

- In this case, you’ll need to add the **Forms** scope

An example request using a Private App for auth and cURL (I used the example JSON from the dev doc and added the auth header example):

```lia-code-sample
curl -X POST \
 'https://api.hubapi.com/submissions/v3/integration/submit/YOUR_PORTAL_ID/YOUR_FORM_GUID' \
 -H 'Content-Type: application/json' \
 -H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
 -d '{
 "submittedAt": "1517927174000",
 "fields": [
 {
 "objectTypeId": "0-1",
 "name": "email",
 "value": "example@example.com"
 },
 {
 "objectTypeId": "0-1",
 "name": "firstname",
 "value": "Jeff"
 }
 ],
 "context": {
 "hutk":"hutk",
 "pageUri": "www.example.com/page",
 "pageName": "Example page"
 },
 "legalConsentOptions": {
 "consent": {
 "consentToProcess": true,
 "text": "I agree to allow Example Company to store and process my personal data.",
 "communications": [
 {
 "value": true,
 "subscriptionTypeId": 999,
 "text": "I agree to receive marketing communications from Example Company."
 }
 ]
 }
 }
}'

```

Lastly, if you use Postman, you can get it to generate various code examples, which include the formatting for your auth header, from the \</\> (code) option

 ![CleanShot 2024-05-07 at 15.10.44.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/5/7/571b59e4e07d6f9b22b76d93a4d1385c7d08f34f.png)

I hope this helps get you moving forward! Talk soon — Jaycee
