Post issues with attachment into mantis through RestAPI

General discussion of Mantis.

Moderators: Developer, Contributor

Post Reply
shanthini
Posts: 39
Joined: 10 Apr 2010, 12:01

Post issues with attachment into mantis through RestAPI

Post by shanthini »

I am trying to post an issue with attachment through Rest API.
The issue gets created but the file attachments are not posted.
Please let me know how to solve this.

Below is my request details:
{
"method": "POST",
"transformRequest": [
null
],
"transformResponse": [
null
],
"url": "http://db3:81/bugtracker/api/rest/issues",
"headers": {
"Authorization": "aWjAGERB07B9kFgkw8mTm-YIMeDdweJ5",
"Content-Type": "application/json",
"Accept": "application/json, text/plain, */*"
},
"data": "{\n \"summary\": \"Sample REST issue-test\",\n \"description\": \"Description for sample REST issue.\",\n \"project\": { \"id\": 215 },\n \"category\": {\"id\": 6},\n \"files\":[\n{\n \"name\":\"test.txt\",\n\"content\":\"dGhpcyBpcyBhIHRlc3QgZmlsZQ0KdGhpcyBpcyB0byB0ZXN0IGF0dGFjaG1lbnRzDQohIyQhQCQhQCQhQCMlI0AhJSNAISUhIyUNCkVuZCBvZiBGaWxl\" \n}\n]\n}",
"timeout": {}
}
Post Reply