POST to /api/account/ACCOUNT_CODE/bulletins/BULLETIN_ID/files
Note that this method is a multipart form.
$ curl -U 'username:password' -F bulletin_file[attachment]='@/path/to/file' base_URL/api/account/{account_code}/bulletins/{bulletin_id}/files
If you're using a REST client like Postman, below you'll find a table with the parameters you'll need. Additionally, note that this needs to be a multipart/form-data POST to function properly.
Name | Required | Location | Description | Sample |
---|---|---|---|---|
X-AUTH-TOKEN | yes | header | Your API token | |
bulletin_file[attachment] | yes | body | The file you'd like to attach. Most REST clients have an option to upload the file directly. | this_is_a_real_file.jpg |
This method requires a multipart form. XML will not work.
POST /api/account/<ACCOUNT_CODE>/bulletins/<BULLETIN_ID>/files User-Agent: Jakarta Commons-HttpClient/4.1 Host: localhost Content-Length: 498 Content-Type: multipart/form-data; boundary=--vA-rSHlEhJks2YQWyjHExUTT7bC0a_ --vA-rSHlEhJks2YQWyjHExUTT7bC0a_ Content-Disposition: form-data; name="bulletin_file[attachment]"; filename="attachment2.txt" Content-Type: text/plain Content of file attachment two --vA-rSHlEhJks2YQWyjHExUTT7bC0a_ Content-Disposition: form-data; name="bulletin_file[deliver]" true --vA-rSHlEhJks2YQWyjHExUTT7bC0a_--
When using the multipart input form, attachments are included as links to files hosted on our servers by default. If you'd like actually include the attachment as a file with the bulletin, you can use the following attributes.
<?xml version="1.0" encoding="UTF-8"?> <bulletin_file> <to-param>10000</to-param> <deliver type="boolean">true</deliver> <bulletin-file-uri>/api/account/ACCOUNT/bulletins/10000/files/10000.xml</bulletin-file-uri> <link rel="self" href="/api/account/ACME/bulletins/10000/files/10000" /> <public-uri>http://evolution.local//attachments/ACCOUNT/2012/01/19/file_attachments/10000/foo.txt</public-uri> <link rel="public" href="http://evolution.local//attachments/ACME/2012/01/19/file_attachments/10000/foo.txt" /> </bulletin_file>
Reference bulletin error codes
Was this page helpful? Can't find what you need? Let us know