How can I insert many documents at once? - couchdb

When I want to insert a document using CouchDB, I send a request like this one:
POST http://localhost:5984/blogging/
Accept: application/json
Content-Type: application/json
{
"name": "Example",
"value": 5
}
And it Works. But, what if I want to insert two documents at once? I try:
POST http://localhost:5984/blogging/
Accept: application/json
Content-Type: application/json
[
{
"name": "Example 2",
"value": 6
},
{
"name": "Example 3",
"value": 7
}
]
And it answers me:
HTTP/1.1 400 Bad Request
Cache-Control: must-revalidate
Connection: close
Content-Length: 66
Content-Type: application/json
Date: Thu, 28 Feb 2019 08:03:52 GMT
Server: CouchDB/2.3.0 (Erlang OTP/19)
X-Couch-Request-ID: 9ed2f39fcf
X-CouchDB-Body-Time: 0
{
"error": "bad_request",
"reason": "Document must be a JSON object"
}

Well, first of all, I would suggest you to check this API from the documentation: http://docs.couchdb.org/en/1.6.1/api/database/bulk-api.html#inserting-documents-in-bulk
And, apart from that, you aren't sending a valid JSON object. I would change your request in this way:
POST http://localhost:5984/blogging/_bulk_docs
Accept: application/json
Content-Type: application/json
{
"docs": [
{
"name": "Example 2",
"value": 6
},
{
"name": "Example 3",
"value": 7
}
]
}

Related

Why does Mountebank predicate cause 200 instead of 500 in response?

Teaching self mountebank. I want to create a mock endpoint such that by issuing POST command to http://localhost:2525/test?mock-response-code=500, the response code will be 500 and the message body will be some custom text.
When I create the imposter, however, and run the relevant curl command, I am getting a 200 response.
curl -i -X POST http://localhost:2525/imposters --data '#createImposter_r500.ejs'
info: [mb:2525] POST /imposters
info: [http:61161] Open for business...
HTTP/1.1 201 Created
Access-Control-Allow-Origin: *
Location: http://localhost:2525/imposters/61161
Content-Type: application/json; charset=utf-8
Content-Length: 767
Date: Sun, 18 Aug 2019 13:57:57 GMT
Connection: keep-alive
{
"protocol": "http",
"port": 61161,
"numberOfRequests": 0,
"recordRequests": false,
"requests": [],
"stubs": [
{
"responses": [
{
"is": {
"statusCode": 500
}
}
],
"predicates": [
{
"equals": {
"path": "/test",
"method": "POST",
"query": {
"mock-response-code": 500
}
}
}
],
"_links": {
"self": {
"href": "http://localhost:2525/imposters/61161/stubs/0"
}
}
}
],
"_links": {
"self": {
"href": "http://localhost:2525/imposters/61161"
},
"stubs": {
"href": "http://localhost:2525/imposters/61161/stubs"
}
}
}
createImposter_r500.ejs:
{
"protocol": "http",
"stubs": [{
"responses": [
{ "is": { "statusCode": 500 }}
],
"predicates": [{
"equals": {
"path": "/test",
"method": "POST",
"query": {"mock-response-code": 500}
}
}]
}]
}
Here is what happens when I try using that URL:
curl -i -X POST http://localhost:61161/test?mock-response-code=500
info: [http:61161] ::1:61429 => POST /test?mock-response-code=500
HTTP/1.1 200 OK
Connection: close
Date: Sun, 18 Aug 2019 14:18:06 GMT
Transfer-Encoding: chunked
Here is some debug output:
debug: [http:62650] ::1:63139 ESTABLISHED
info: [http:62650] ::1:63139 => POST /test?mock-response-code=400
debug: [http:62650] ::1:63139 => {"requestFrom":"::1:63139","method":"POST","path":"/test","query":{"mock-response-code":"400"},"headers":{"Host":"localhost:62650","User-Agent":"curl/7.54.0","Accept":"*/*"},"body":"","ip":"::1"}
debug: [http:62650] no predicate match
debug: [http:62650] generating response from {"is":{}}
debug: [http:62650] ::1:63139 <= {"statusCode":200,"headers":{"Connection":"close"},"body":"","_mode":"text"}
debug: [http:62650] ::1:63139 CLOSED
(Port is different from above b/c it's from a different run.)
I found the answer myself with continued experimentation.
Quotation marks - that simple.
"query": {"mock-response-code": "400"}
rather than
"query": {"mock-response-code": 400}

Parse multipart/related response and save attachment to file

I'm doing a simple POST that returns the below. I'm expecting a .txt.gz file. I need to know how to retrieve the attachment. I've tried creating a buffer, delimiting, and splitting before writing the file, but it always comes back as corrupt.
The request library explains how to consume a PUT request for an attachment, but not how to consume a response back.
Can anyone help? Been at this for a week now.
JSON.stringify(res)
{
"statusCode": 200,
"body": {
"type": "Buffer",
"data": [
13,
10,
45,
45(..truncated)
]
},
"headers": {
"set-cookie": [
"JSESSIONIDSSO=982EF51351B9497045DB6AB5A2D50DBF; Path=/; Secure; HttpOnly",
"JSESSIONID=995EF8A4A893860159CE463582E4CDDD; Path=/logcollectionservice; Secure; HttpOnly",
"SoapSession.id=-2851099334472488788"
],
"x-frame-options": "SAMEORIGIN",
"strict-transport-security": "max-age=31536000; includeSubdomains",
"content-type": "multipart/related; type=\"text/xml\"; start=\"<852C508C64251E692C9217DFA4EB7433>\"; boundary=\"----=_Part_109_17473961.1526352793275\"",
"transfer-encoding": "chunked",
"date": "Tue, 15 May 2018 02:53:13 GMT",
"connection": "close",
"server": ""
},
"request": {
"uri": {
"protocol": "https:",
"slashes": true,
"auth": null,
"host": "50.22.22.22:8443",
"port": "8443",
"hostname": "50.22.22.22",
"hash": null,
"search": null,
"query": null,
"pathname": "/logcollectionservice/services/DimeGetFileService",
"path": "/logcollectionservice/services/DimeGetFileService",
"href": "https://50.22.22.22:8443/logcollectionservice/services/DimeGetFileService"
},
"method": "POST",
"headers": {
"Authorization": "Basic YWRt123123123123123123",
"SOAPAction": "http://schemas.cisco.com/ast/soap/action/#LogCollectionPort#GetOneFile",
"content-length": 467
}
}
}
res.body
------=_Part_183_12814895.1526363698144
Content-Type: text/xml; charset=UTF-8
Content-Transfer-Encoding: binary
Content-Id: <5DDAB109C3B14685FF6B0EA83D2CF8E4>
<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body>
<ns1:GetOneFileResponse
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns1="http://schemas.cisco.com/ast/soap/"><DataHandler
href="cid:36F92AA211EE04B422D4B07AB07D841A" xsi:type="ns2:DataHandler"
xmlns:ns2="DimeGetFileService"/></ns1:GetOneFileResponse>
</soapenv:Body></soapenv:Envelope>
------=_Part_183_12814895.1526363698144
Content-Type: application/octet-stream
Content-Transfer-Encoding: binary
Content-Id: <36F92AA211EE04B422D4B07AB07D841A>
����o�:���W��U����<��퐖.�I��8!h�0�l��?~���m�z��;'����>��oL���'Ϗ��3
'�tSV�EO�8zÂ���[a0����.��`�4wbO�q��FI���:�n܍>��e-
��!^#"�U5��;��^����U[V���s˽��q_��̣
����{gm����r��
���c��㬌Pf]Z�����cs���#ߵ� (truncated)
------=_Part_183_12814895.1526363698144--

Docusign API FORMAT_CONVERSION_ERROR

Trying to use the Docusign API from a Perl app.
I can sign in no problem but can't send a single document envelope for signature.
The json I get back is
{
"errorCode": "FORMAT_CONVERSION_ERROR",
"message": "The data could not be converted."
}
My request looks almost identical to the various examples given by Docusign.
The pdf is a sample I downloaded in order to rule out our in-house pdf generation. Request from API logs below.
Any thoughts?
POST https://demo.docusign.net:7802/restapi/v2/accounts/#####/envelopes
Content-Length: 11291
Content-Type: multipart/form-data; boundary=MYBOUNDARY
Connection: TEclose
Accept: application/json
Host: demo.docusign.net
TE: deflategzip; q=0.3
User-Agent: libwww-perl/6.02
X-DocuSign-Authentication: <DocuSignCredentials> <Username>#####</Username> <Password>[omitted]</Password> <IntegratorKey>[omitted]</IntegratorKey> </DocuSignCredentials>
X-Forwarded-For: 77.107.233.74
--MYBOUNDARY
Content-Type:application/json
Content-Disposition: form-data
{
"status": "sent",
"emailBlurb": "Test Email Body",
"emailSubject": "Test Email Subject 18:09",
"documents": [
{
"name": "test.pdf",
"documentId": "1",
"order": "1"
}
],
"recipients": {
"signers": [
{
"email": "myname#gmail.com",
"name": "John Doe",
"recipientId": "1",
"tabs": {
"signHereTabs": [
{
"xPosition": "100",
"yPosition": "100",
"documentId": "1",
"pageNumber": "1"
}
]
}
}
]
}
}
--MYBOUNDARY
Content-Type: application/pdf
Content-Disposition: file; filename='test.pdf';documentid=1
JVBERi0xLjMNJeLjz9MNCjcgMCBvYmoNPDwvTGluZWFyaXplZCAxL0wgNzk0NS9PIDkvRSAzNTI0L04gMS9UIDc2NTYvSCBbIDQ1MSAxMzddPj4NZW5kb2JqDSAgICAgICAgICAgIC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veGFwLzEuMC9tbS8iPgogICAgICAgICA8eG1wTU06RG9jdW1lbnRJRD51dWlkOjA4MDVlMjIxLTgwYTgtNDU5ZS1hNTIyLTYzNWVkNWMxZTJlNjwveG1wTU06RG9jdW1lbnRJRD4KICAgICAgICAgPHhtcE1NOkluc3RhbmNlSUQ+dXVpZDo2MmQ2YWU2ZC00M2M0LTQ3MmQtOWIyOC03YzRhZGQ4ZjllNDY8L3htcE1NOkluc3RhbmNlSUQ+CiAgICAgIDwvcmRmOkRlc2NyaXB0aW9uPgogICA8L3JkZjpSREY+CjwveDp4bXBtZXRhPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgCjw/eHBhY2tldCBlbmQ9InciPz4NCmVuZHN0cmVhbQ1lbmRvYmoNMiAwIG9iag08PC9GaWx0ZXIvRmxhdGVEZWNvZGUvRmlyc3QgNC9MZW5ndGggNDgvTiAxL1R5cGUvT2JqU3RtPj5zdHJlYW0NCmjeMlUwULCx0XfOL80rUTDU985MKY62BIoFxeqHVBak6gckpqcW29kBBBgA1ncLgA0KZW5kc3RyZWFtDWVuZG9iag0zIDAgb2JqDTw8L0ZpbHRlci9GbGF0ZURlY29kZS9GaXJzdCA0L0xlbmd0aCAxNjcvTiAxL1R5cGUvT2JqU3RtPj5zdHJlYW0NCmjePMvBCsIwEEXRX5mdDaKdxCpVSqFY3AkuBNexSelA6EAyRfx7A4qPu3znAAhNU3aLTByLwVkKb1Weo7dCPPdWfNGfDOYdzFGj0VivtV4hrn6vrK40RE48Cjw4Oqi3qMoruz/WuwxrvTeV3m2w+uJbZLcMPhZdxk8r0FMSCsFHqLYII0d40Oz4lVR5Jwm+uE+UIGdBfBK49RcYKXjVth8BBgBnZztkDQplbmRzdHJlYW0NZW5kb2JqDTQgMCBvYmoNPDwvRGVjb2RlUGFybXM8PC9Db2x1bW5zIDMvUHJlZGljdG9yIDEyPj4vRmlsdGVyL0ZsYXRlRGVjb2RlL0lEWzw0REM5MUExODc1QTZENzA3QUVDMjAzQkIwMjFDOTNBMD48RjZDOTJCMzY4QThBMTM0MDg0NTdBMUQzOTVBMzdFQjk+XS9JbmZvIDYgMCBSL0xlbmd0aCAzNy9Sb290IDggMCBSL1NpemUgNy9UeXBlL1hSZWYvV1sxIDIgMF0+PnN0cmVhbQ0KaN5iYmBgYGLkPcLEwD+ViYGhh4mBkYWJ8bEkkM0IEGAAKlkDFA0KZW5kc3RyZWFtDWVuZG9iag1zdGFydHhyZWYNCjExNg0KJSVFT0YNCg==
--MYBOUNDARY--
400 BadRequest
Content-Type: application/json; charset=utf-8
{
"errorCode": "FORMAT_CONVERSION_ERROR",
"message": "The data could not be converted."
}
You're missing the Base64 encoding declaration
Add Content-Transfer-Encoding: Base64 to your PDF area
This
--MYBOUNDARY
Content-Type: application/pdf
Content-Disposition: file; filename='test.pdf';documentid=1
JVBERi0xLjMNJeLjz9MNCjcgMCBvYmoNPDwvTGluZWFyaXplZCAxL0wgNzk0NS9PIDkvRSAzNTI0L04gMS9UIDc2NTYvSCBbIDQ1MSAxMzddPj4NZW5kb2JqDSAgICAgICAgICAgICAgICAgICAgICAgDQoxMyAwIG9iag08PC9EZWNvZGVQYXJtczw8L0NvbHVtbnMgNC9QcmVkaWN0b3IgMTI+Pi9GaWx0ZXIvRmxhdGVEZWNvZGUvSURbPDREQzkxQTE4NzVBNkQ3MDdBRUMyMDNCQjAyMUM5M0EwPjxGNkM5MkIzNjhBOEExMzQwODQ1N0ExRDM5NUEzN0VCOT5dL0luZGV4WzcgMjFdL0luZm8gNiAwIFIvTGVuZ3RoIDUyL1ByZXYgNzY1Ny9Sb290IDggMCBSL1NpemUgMjgvVHlwZS9YUmVmL1dbMSAyIDFdPj5zdHJlYW0NCmjeYmJkEGBgYmCyARIMIIKxAUgwpwIJNkcg8eUYAxMjwzSQLAMjucR/xp1fAAIMAEykBvANCmVuZHN0cmVhbQ1lbmRvYmoNc3RhcnR4cmVmDQowDQolJUVPRg0KICAgICAgICANCjI3IDAgb2JqDTw8L0ZpbHRlci9GbGF0ZURlY29kZS9JIDY5L0x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ICA8eG1wOk1vZGlmeURhdGU+MjAxMy0xMC0yOFQxNToyNDoxMy0wNDowMDwveG1wOk1vZGlmeURhdGU+CiAgICAgICAgIDx4bXA6TWV0YWRhdGFEYXRlPjIwMTMtMTAtMjhUMTU6MjQ6MTMtMDQ6MDA8L3htcDpNZXRhZGF0YURhdGU+CiAgICAgIDwvcmRmOkRlc2NyaXB0aW9uPgogICAgICA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIgogICAgICAgICAgICB4bWxuczpwZGY9Imh0dHA6Ly9ucy5hZG9iZS5jb20vcGRmLzEuMy8iPgogICAgICAgICA8cGRmOlByb2R1Y2VyPkFjcm9iYXQgRGlzdGlsbGVyIDQuMCBmb3IgV2luZG93czwvcGRmOlByb2R1Y2VyPgogICAgICA8L3JkZjpEZXNjcmlwdGlvbj4KICAgICAgPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIKICAgICAgICAgICAgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iPgogICAgICAgICA8eG1wTU06RG9jdW1lbnRJRD51dWlkOjA4MDVlMjIxLTgwYTgtNDU5ZS1hNTIyLTYzNWVkNWMxZTJlNjwveG1wTU06RG9jdW1lbnRJRD4KICAgICAgICAgPHhtcE1NOkluc3RhbmNlSUQ+dXVpZDo2MmQ2YWU2ZC00M2M0LTQ3MmQtOWIyOC03YzRhZGQ4ZjllNDY8L3htcE1NOkluc3RhbmNlSUQ+CiAgICAgIDwvcmRmOkRlc2NyaXB0aW9uPgogICA8L3JkZjpSREY+CjwveDp4bXBtZXRhPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgCjw/eHBhY2tldCBlbmQ9InciPz4NCmVuZHN0cmVhbQ1lbmRvYmoNMiAwIG9iag08PC9GaWx0ZXIvRmxhdGVEZWNvZGUvRmlyc3QgNC9MZW5ndGggNDgvTiAxL1R5cGUvT2JqU3RtPj5zdHJlYW0NCmjeMlUwULCx0XfOL80rUTDU985MKY62BIoFxeqHVBak6gckpqcW29kBBBgA1ncLgA0KZW5kc3RyZWFtDWVuZG9iag0zIDAgb2JqDTw8L0ZpbHRlci9GbGF0ZURlY29kZS9GaXJzdCA0L0xlbmd0aCAxNjcvTiAxL1R5cGUvT2JqU3RtPj5zdHJlYW0NCmjePMvBCsIwEEXRX5mdDaKdxCpVSqFY3AkuBNexSelA6EAyRfx7A4qPu3znAAhNU3aLTByLwVkKb1Weo7dCPPdWfNGfDOYdzFGj0VivtV4hrn6vrK40RE48Cjw4Oqi3qMoruz/WuwxrvTeV3m2w+uJbZLcMPhZdxk8r0FMSCsFHqLYII0d40Oz4lVR5Jwm+uE+UIGdBfBK49RcYKXjVth8BBgBnZztkDQplbmRzdHJlYW0NZW5kb2JqDTQgMCBvYmoNPDwvRGVjb2RlUGFybXM8PC9Db2x1bW5zIDMvUHJlZGljdG9yIDEyPj4vRmlsdGVyL0ZsYXRlRGVjb2RlL0lEWzw0REM5MUExODc1QTZENzA3QUVDMjAzQkIwMjFDOTNBMD48RjZDOTJCMzY4QThBMTM0MDg0NTdBMUQzOTVBMzdFQjk+XS9JbmZvIDYgMCBSL0xlbmd0aCAzNy9Sb290IDggMCBSL1NpemUgNy9UeXBlL1hSZWYvV1sxIDIgMF0+PnN0cmVhbQ0KaN5iYmBgYGLkPcLEwD+ViYGhh4mBkYWJ8bEkkM0IEGAAKlkDFA0KZW5kc3RyZWFtDWVuZG9iag1zdGFydHhyZWYNCjExNg0KJSVFT0YNCg==
--MYBOUNDARY--
Turns to this
--MYBOUNDARY
Content-Type: application/pdf
Content-Disposition: file; filename='test.pdf';documentid=1
Content-Transfer-Encoding: Base64
JVBERi0xLjMNJeLjz9MNCjcgMCBvYmoNPDwvTGluZWFyaXplZCAxL0wgNzk0NS9PIDkvRSAzNTI0L04gMS9UIDc2NTYvSCBbIDQ1MSAxMzddPj4NZW5kb2JqDSAgICAgICAgICAgICAgICAgICAgICAgDQoxMyAwIG9iag08PC9EZWNvZGVQYXJtczw8L0NvbHVtbn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OjA4MDVlMjIxLTgwYTgtNDU5ZS1hNTIyLTYzNWVkNWMxZTJlNjwveG1wTU06RG9jdW1lbnRJRD4KICAgICAgICAgPHhtcE1NOkluc3RhbmNlSUQ+dXVpZDo2MmQ2YWU2ZC00M2M0LTQ3MmQtOWIyOC03YzRhZGQ4ZjllNDY8L3htcE1NOkluc3RhbmNlSUQ+CiAgICAgIDwvcmRmOkRlc2NyaXB0aW9uPgogICA8L3JkZjpSREY+CjwveDp4bXBtZXRhPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgCjw/eHBhY2tldCBlbmQ9InciPz4NCmVuZHN0cmVhbQ1lbmRvYmoNMiAwIG9iag08PC9GaWx0ZXIvRmxhdGVEZWNvZGUvRmlyc3QgNC9MZW5ndGggNDgvTiAxL1R5cGUvT2JqU3RtPj5zdHJlYW0NCmjeMlUwULCx0XfOL80rUTDU985MKY62BIoFxeqHVBak6gckpqcW29kBBBgA1ncLgA0KZW5kc3RyZWFtDWVuZG9iag0zIDAgb2JqDTw8L0ZpbHRlci9GbGF0ZURlY29kZS9GaXJzdCA0L0xlbmd0aCAxNjcvTiAxL1R5cGUvT2JqU3RtPj5zdHJlYW0NCmjePMvBCsIwEEXRX5mdDaKdxCpVSqFY3AkuBNexSelA6EAyRfx7A4qPu3znAAhNU3aLTByLwVkKb1Weo7dCPPdWfNGfDOYdzFGj0VivtV4hrn6vrK40RE48Cjw4Oqi3qMoruz/WuwxrvTeV3m2w+uJbZLcMPhZdxk8r0FMSCsFHqLYII0d40Oz4lVR5Jwm+uE+UIGdBfBK49RcYKXjVth8BBgBnZztkDQplbmRzdHJlYW0NZW5kb2JqDTQgMCBvYmoNPDwvRGVjb2RlUGFybXM8PC9Db2x1bW5zIDMvUHJlZGljdG9yIDEyPj4vRmlsdGVyL0ZsYXRlRGVjb2RlL0lEWzw0REM5MUExODc1QTZENzA3QUVDMjAzQkIwMjFDOTNBMD48RjZDOTJCMzY4QThBMTM0MDg0NTdBMUQzOTVBMzdFQjk+XS9JbmZvIDYgMCBSL0xlbmd0aCAzNy9Sb290IDggMCBSL1NpemUgNy9UeXBlL1hSZWYvV1sxIDIgMF0+PnN0cmVhbQ0KaN5iYmBgYGLkPcLEwD+ViYGhh4mBkYWJ8bEkkM0IEGAAKlkDFA0KZW5kc3RyZWFtDWVuZG9iag1zdGFydHhyZWYNCjExNg0KJSVFT0YNCg==
--MYBOUNDARY--

Error when sending DOCX to DocuSign REST API

I'm getting the following error when trying to send DOCX documents to docusign through the rest API
Until now it has worked just fine for almost a year. I've tested it with a variety of DOCX files and all of them return this error
"errorCode": "UNABLE_TO_CONVERT_DOCUMENT",
"message": "System was unable to convert this document to a PDF. Unable to convert Document(afasf.docx) to a PDF.
Error: UserId:********-****-*****-*****-*********** IPAddress:***.***.***.***
Source:ApiRESTv2:Could not submit Document to Conversion Server: EnvelopeId:00000000-0000-0000-0000-000000000000 DocumentName:afasf.docx -
SubmitCode: -10242\r\nCould not submit Document to Conversion Server: EnvelopeId:00000000-0000-0000-0000-000000000000 DocumentName:afasf.docx -
SubmitCode: -10242\r\nCould not submit Document to Conversion Server: EnvelopeId:00000000-0000-0000-0000-000000000000 DocumentName:afasf.docx -
SubmitCode: -10242\r\n"
I look forward to your answers from above, but here is working example in base64 of a docx
I use this online tool for encoding, decoding files to/from base64 http://www.opinionatedgeek.com/dotnet/tools/Base64Encode/
URI, Verb and Headers:
POST /restapi/v2/accounts/225705/envelopes HTTP/1.1
Host: demo.docusign.net
X-DocuSign-Authentication: your info aka userid, password and integrator key
Content-Type: multipart/form-data; boundary=AAA
Accept: application/json
Body of Post:
--AAA
Content-Type: application/json
Content-Disposition: form-data
{
"emailBlurb": "Test for basic docx",
"emailSubject": "Test for docx",
"status": "sent",
"compositeTemplates": [
{
"inlineTemplates": [
{
"sequence": "1",
"documents": [
{
"documentId": "1",
"name": "basic.docx"
}
],
"recipients": {
"signers": [
{
"recipientId": "1",
"name": "Your Name",
"email": "youremail#yourdomain.com",
"defaultRecipient": "true",
"tabs": {
"signHereTabs": [{
"anchorString": "\\Signhere\\",
"tabLabel": "Sign Here 1"
}]
}
}
]
}
}
]
}
]
}
--AAA
Content-Type: application/vnd.openxmlformats-officedocument.wordprocessingml.document
Content-Disposition: file; filename="basic.docx"; documentid=1
Content-Transfer-Encoding: base64
UEsDBBQABgAIAAAAIQDpURCwjQEAAMIFAAATAAgCW0NvbnRlbnRfVHlwZXNdLnhtbCCiBAIooAAC **[base64 truncated to meet StackOverflow Limit of 30000 since it was 33196 ]** FYAAGRvY1Byb3BzL2FwcC54bWxQSwUGAAAAAA0ADQBOAwAAtVgAAAAA
--AAA--
Have you tried setting the file extension?
var doc = new docusign.Document();
var base64Doc = Buffer.from(fileBytes).toString('base64');
doc.documentBase64 = base64Doc;
doc.fileExtension = 'docx';

Setting an Azure Scheduler Job Retry Policy

Using the Azure Management REST API, I'm trying to update (PATCH) an existing Scheduler job with a retry policy. The request is accepted but the json response object doesn't include the retry policy entries.
In the case of an update, other changes I make are reflected in the response.
Azure Scheduler job entity structure: http://msdn.microsoft.com/library/azure/dn528941.aspx
Azure Scheduler REST API ref: http://msdn.microsoft.com/en-us/library/azure/dn528946.aspx
I've be using Burp Suite to quickly iterate through different requests, but I never see anything to suggest the retry policy has been created.
What am I missing?
The following request will create a new job name SampleJob20 (with no retry policy)
PUT /<subid>/cloudservices/<cloudservicename>/resources/scheduler/~/JobCollections/<jobcollectionname>/jobs/SampleJob20?api-version=2014-04-01 HTTP/1.1
Content-Type: application/json
x-ms-version: 2012-03-01
Host: management.core.windows.net
Content-Length: 583
{
"startTime": "2013-01-30T12:08:00-08:00",
"action":
{
"type": "http",
"request":
{
"uri": "http://bing.com/",
"method": "GET",
"headers":
{
"Content-Type": "text/plain"
}
}
},
"recurrence":
{
"frequency": "minute",
"interval": 30,
"count": 1000
},
"state": "enabled"
}
The response for this request is:
HTTP/1.1 201 Created
Cache-Control: no-cache
Pragma: no-cache
Content-Length: 364
Content-Type: application/json; charset=utf-8
Expires: -1
Server: 1.0.6198.148 (rd_rdfe_stable.141019-1428) Microsoft-HTTPAPI/2.0
x-ms-servedbyregion: ussouth2
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
x-ms-request-id: xxxxxxxxxxxxxxxxx
Date: Mon, 20 Oct 2014 19:13:40 GMT
{
"id":"SampleJob20",
"startTime":"2013-01-30T20:08:00Z",
"action":
{
"request":
{
"uri":"http:\/\/bing.com\/","method":"GET",
"headers":
{
"content-Type":"text\/plain"
}
},
"type":"http"
},
"recurrence":
{
"frequency":"minute",
"count":1000,
"interval":30
},
"state":"enabled",
"status":
{
"nextExecutionTime":"2014-10-20T19:38:00Z",
"executionCount":0,
"failureCount":0,
"faultedCount":0
}
}
When I try and update this job with a retry policy. The response is missing the retry policy detail.
PATCH /<subid>/cloudservices/<cloudservicename>/resources/scheduler/~/JobCollections/<jobcollectionname>/jobs/SampleJob20?api-version=2014-04-01 HTTP/1.1
Content-Type: application/json
x-ms-version: 2012-03-01
Host: management.core.windows.net
Content-Length: 451
{
"id": "SampleJob20",
"action":
{
"type": "http",
"request":
{
"uri": "http://bing.com",
"method": "GET",
"headers":
{
"Content-Type": "text/plain"
}
},
"retryPolicy":
{
"retryType":"fixed",
"retryInterval": "PT1M",
"retryCount": 3
}
}
}
If I create a new job with a retry policy the response contains the retry detail. However, the jobs retry policy cannot be updated either.
Can you try putting a new or the same job like this (It includes the retry policy in the Put request)
PUT
{
"startTime": "2013-01-30T12:08:00-08:00",
"action":
{
"type": "http",
"request":
{
"uri": "http://bing.com/",
"method": "GET",
"headers":
{
"Content-Type": "text/plain"
}
},
"retryPolicy":
{
"retryType":"fixed",
"retryInterval": "PT1M",
"retryCount": 3
}
},
"recurrence":
{
"frequency": "minute",
"interval": 30,
"count": 1000
},
"state": "enabled"
}

Resources