This is available in UserVoice Discovery Premium.
Not included in your plan? Want to learn more about the benefits? Leave us a message! If you're viewing this on our Help Center, click the Support bubble in the lower-right of this page.
Not included in your plan? Want to learn more about the benefits? Leave us a message! If you're viewing this on our Help Center, click the Support bubble in the lower-right of this page.
The UserVoice Admin API allows you to upload files and link them to suggestions. This is done through a two-step process.
- Use the Attachments API to upload your file in multipart/form-data format. Take note of the token in the response, as this will allow you to link the file to a suggestion later on. Note: If you lose your access token, don’t worry. You can retrieve it later through our GET endpoint!
$ curl https://SUBDOMAIN.uservoice.com/api/v2/admin/attachments \ -H "Authorization: Bearer <token>" \ -F "file=@/path/to/file"
{ "attachments": [ { "id": 116876320, "file_name": "test.jpg", "content_type": "image/jpeg", "size_in_bytes": 14919, "updated_at": "2017-02-16T14:06:35Z", "created_at": "2017-02-16T14:06:35Z", "url": "someUrl.com", "thumb_url": "someOtherUrl.com", "token": "1234567890ebcf3635a209ab4ozp1kd9", "links": { "suggestion": null, "note": null } } ], "links": { "attachments.note": { "type": "notes" }, "attachments.suggestion": { "type": "suggestions" } } }
- Use the token you received in the response to link the file to a suggestion or when creating a note. Take a look at our Suggestions API for how to update a suggestion with an attachment token, or at our Notes API for how to create a note with an attachment token.
$ curl https://SUBDOMAIN.uservoice.com/api/v2/admin/suggestions/ID \ -X "PUT" \ -H "Authorization: Bearer <token>" \ -d attachment_tokens=1234567890ebcf3635a209ab4ozp1kd9,someOtherToken
{ "links": { "suggestions.category": { "type": "categories" }, "suggestions.created_by": { "type": "users" }, "suggestions.forum": { "type": "forums" }, "suggestions.labels": { "type": "labels" }, "suggestions.last_status_update": { "type": "status_updates" }, "suggestions.parent_suggestion": { "type": "suggestions" }, "suggestions.status": { "type": "statuses" }, "suggestions.ticket": { "type": "tickets" } }, "suggestions": [ { "id": 12345, "title": "Make a Getting Started Guide", "body": "A good starting guide would be helpful thanks!", "body_mime_type": "", "portal_url": "http://SUBDOMAIN.uservoice.com/forums/54321/suggestions/12345", "admin_url": "https://SUBDOMAIN.uservoice.com/admin/v3/suggestions/12345", "created_at": "2013-03-08T00:17:42Z", "creator_user_agent": null, "creator_referrer": null, "creator_browser": null, "creator_browser_version": null, "creator_os": null, "creator_mobile": false, "state": "approved", "inappropriate_flags_count": 0, "approved_at": null, "updated_at": "2017-02-16T14:09:34Z", "closed_at": null, "comments_count": 2, "notes_count": 0, "requests_count": 0, "votes_count": 1, "supporters_count": 0, "supporting_accounts_count": 0, "supporter_revenue": 0, "supporter_satisfaction_score": 0, "satisfaction_detractor_count": 0, "satisfaction_promoter_count": 0, "satisfaction_neutral_count": 0, "average_engagement": 0, "recent_engagement": 0, "engagement_trend": 0, "first_support_at": null, "links": { "forum": 54321, "category": null, "labels": null, "status": 567899, "parent_suggestion": null, "ticket": null, "last_status_update": 5321563, "created_by": 32364234 } } ] }
Constraints
File Size: 50 MB (50000000 bytes)
A complete list of endpoints is available in our Admin API Reference.