REST API - getting Mantis Issue ID of newly added Issue?

Get help from other users here.

Moderators: Developer, Contributor

Post Reply
acoder2020
Posts: 65
Joined: 11 Jan 2024, 19:32

REST API - getting Mantis Issue ID of newly added Issue?

Post by acoder2020 »

Is it possible to retrieve the newly added ID from a newly added Issue via REST API?

For clarification, I am adding the Issue via REST. I want to add notes under it (also via REST) but need an Issue ID for posting the notes.
atrol
Site Admin
Posts: 8378
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: REST API - getting Mantis Issue ID of newly added Issue?

Post by atrol »

The ID is part of the response that you get when creating the issue.
See the example response at https://documenter.getpostman.com/view/ ... 9f9205a954
Please use Search before posting and read the Manual
acoder2020
Posts: 65
Joined: 11 Jan 2024, 19:32

Re: REST API - getting Mantis Issue ID of newly added Issue?

Post by acoder2020 »

Yep, this works perfectly (in PHP)

Code: Select all

$arr_response = json_decode($response,true);
$issue_id = $arr_response['issue']['id'];

echo "<p>issue_id $issue_id<br>";
Post Reply