mautic / mautic/api-library

parameter_absent exception

Open
#228 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
205
Forks
129
PR merge metrics
No merged PRs in 30d

Description

I am using the Mautic library but getting the following error when making a call.

{"message":"Looks like I encountered an error (error #400). If I do it again, please report me to the system administrator!","code":400,"type":null}

The logs show the following:

[2020-11-17 08:38:09] mautic.ERROR: Uncaught PHP Exception Symfony\Component\HttpKernel\Exception\HttpException: "parameter_absent" at /home/my-mautic/public_html/vendor/willdurand/oauth-server-bundle/Service/OAuthServerService.php line 109 {"exception":"[object] (Symfony\\Component\\HttpKernel\\Exception\\HttpException(code: 0): parameter_absent at /home/my-mautic/public_html/vendor/willdurand/oauth-server-bundle/Service/OAuthServerService.php:109)"} []

Not sure what I am missing here. This is the code I am using as per the documentation:

$initAuth       = new ApiAuth();
$this->auth     = $initAuth->newAuth([
            'baseUrl'      => 'https://my-mautic-address.com/api',
            'version'      => 'OAuth1a',
            'clientKey'    => \Bin\Config::MAUTIC_CONSUMER_KEY,
            'clientSecret' => \Bin\Config::MAUTIC_CONSUMER_SECRET,
            'callback'     => \Bin\Config::MAUTIC_CALLBACK_URL
]);

$this->apiUrl   = "https://my-mautic-address.com/api";
$this->mautic   = new MauticApi();

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the documented ApiAuth and newAuth configuration in the issue, then inspect OAuthServerService.php at line 109 and the surrounding OAuth request flow. Reproduce the call using the supplied baseUrl, OAuth1a settings, credentials, and callback, and compare the request with the parameter expected at that failure point. Done means identifying the missing or malformed parameter and documenting or fixing the failing API call.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
api, authentication
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.