Unable to create new issue via the API after migrating to mac M1

General discussion of Mantis.

Moderators: Developer, Contributor

Post Reply
hderiau
Posts: 1
Joined: 23 May 2021, 19:10

Unable to create new issue via the API after migrating to mac M1

Post by hderiau »

I have a php script that was creating a Mantis BT issue using the REST api.
After migrating from macos 10.14 to 10.26 all my apps (including MAMP, and a fresh install of mantis and reimported my database), my script is no longer able to create a new issue. I sent several hours on Gemini updating .htaccess, httpd.conf with no avail, I'm getting a 401 response

Here is my code, any input would be greatly appreciated:

Code: Select all

$curl = curl_init();

              curl_setopt_array($curl, array(
                CURLOPT_URL => 'http://127.0.0.1:8887/mantisbt/api/rest/issues',
                CURLOPT_RETURNTRANSFER => true,
                CURLOPT_PROXY => '',
                CURLOPT_PORT => 8887,
                CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4,
                CURLOPT_ENCODING => '',
                CURLOPT_MAXREDIRS => 10,
                CURLOPT_TIMEOUT => 0,
                CURLOPT_FOLLOWLOCATION => true,
                CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
                CURLOPT_CUSTOMREQUEST => 'POST',
                CURLOPT_POSTFIELDS =>'{
                "summary": "'.$title.'",
                "description": "'.$description.'",
                "category": {
                  "name": "General"
                },
                "project": {
                  "name": "My Project prod"
                },
                   "priority": {
                      "name": "high"
                  },
                     "handler": {
                      "name": "admin"
                  },
                    "severity": {
                      "name": "major"
                  }
              }',

                CURLOPT_HTTPHEADER => array(
                  'Authorization: {{my_newly_generated_token_is_here}}',
                  'Content-Type: application/json'
                ),
              ));

              $result = curl_exec($curl);
Post Reply