Is there any way to pull the users that have registered in a form from a divhunt api?
Yes, from the form submissions I can access through the backoffice.
You’re in luck We are releasing API today
Well, first part of it, but it will include forms!
I’ll let you know when it’s live!
nice! let me know plz.
You are first one who will use Divhunt API officially Congratz, this is is huge!!!
- Go to Divhunt Dashboard
- Navigate to your project settings, then find the tab API Tokens
- Create token, name it like “Form Submissions”
- Go to token settings, and allow the GET endpoint forms.submission
Making the request:
- Until we release documentation, which will be in next few days (it’s auto generated), you need to learn how to get full URL for each endpoint.
So it’s domain + “/api” + add-on + endpoint
In this case GET https://your-domain.divhunt.art/api/admin/forms.submission
And along with request, you need to pass header Authorization with the token, which is provided, you can click on it to copy it.
Note: This request will ask you to provide ID, either as query param ?id= or as body JSON, the ID of form you can find in your admin panel, in form settings you can copy ID of form you need to get submissions.
Let me know if you had any success with this
Hey @dejan!
Thanks for the detailed examples!
So, I’ve followed what you said, and I’m getting this error now.
$ curl -H "Authorization: Bearer xxxxxxx-7" "https://XXX.divhunt.art/api/admin/forms.submission?id=459"
{"success":false,"message":"Invalid action.","framework":{"mode":"app","time.connection":2.4,"time.database":8.3,"time.query":5.9,"time":"12.0"}}
I’ve added the permissions and such:
Not sure if I’m missing anything.
Thanks, I removed the Bearer
and also added an s
to the end of submission
End result:
curl -H "Authorization: XXX-7" "https://xxx.divhunt.art/api/admin/forms.submissions?id=459"
Thanks, just one more thing.
Will the submissions endpoint have a pagination or something like that when there is a great amount of data?
Also, can I delete the submissions through the API?
Thanks!
I’ve added an endpoint for removing form submissions.
DELETE https://your-domain.com/api/admin/forms.submission?id=ID-of-a-submission
Also I want to check with you if is fine to update first endpoint
FROM
GET https://your-domain.com/api/admin/forms.submissions?id=ID-of-a-form
TO
GET https://your-domain.com/api/admin/forms.submissions?form=ID-of-a-form
So essentially, we just change ?id to ?form, so it does not get confusing for people so they understand that they need to provide form ID and not submission ID.
Since you are the only one who uses this endpoint, let me know if we can make a change?
Hey @dejan !
Thanks for the info and for the check.
Yes, go ahead! I’ll change that in my app as well.
Updated! Please update on your side. Thanks.
Let me know if you need any endpoint and I will deliver one by one, you can request literally anything at the end, API will cover 100% of your website data and actions.