You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To my knowledge the error occurs because the filter parameters are stored and sent not only inthe body of the cURL request but also in the header where the authorization params are stored as well.
in the file maut_connector\vendor\mautic\api-library\lib\Auth\OAuth.php
The parameters and the oAuthHeaders are merged and both stored as oAuthHeaders. Now when there are multiple entries in the filter (glue, field, type, etc...) the values in the headers would look something like this if you dump them:
If you just remove the array merge of $oAuthHeaders and $parameters other endpoints (e. g. fetching companies) will not work anymore for some reason so you probably don't want to do that.
Whenever creating or updating a segment with filters included the response shows error 401 unauthorized.
To my knowledge the error occurs because the filter parameters are stored and sent not only inthe body of the cURL request but also in the header where the authorization params are stored as well.
in the file
maut_connector\vendor\mautic\api-library\lib\Auth\OAuth.php
The parameters and the oAuthHeaders are merged and both stored as oAuthHeaders. Now when there are multiple entries in the filter (glue, field, type, etc...) the values in the headers would look something like this if you dump them:
This is a problem because 'filters' is set multiple times. If you do that the mautic endpoint will return 401 unauthorized.
I don't have a general fix for this problem, however I can provide my workaround:
Replace:
With:
If you just remove the array merge of
$oAuthHeaders
and$parameters
other endpoints (e. g. fetching companies) will not work anymore for some reason so you probably don't want to do that.Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
The text was updated successfully, but these errors were encountered: