API: getOutlinks

Hi,
i don’t know if i do the wrong API-Call or if there was a mistake on API.

My site has 3 outlinks like this:

  1. http://example.com/
  2. Example Domain
  3. Example Domain

If I do the api-call “getOutlinks”, I get a respond with the following Array like this:

Array
(
    [0] => Array
        (
            [label] => example.com/
            [nb_visits] => 2
            [nb_uniq_visitors] => 1
            [nb_hits] => 2
            [sum_time_spent] => 0
            [url] => http://example.com/
            [segment] => outlinkUrl==http%3A%2F%2Fexample.com%2F
        )

    [1] => Array
        (
            [label] => example.com/?a=1
            [nb_visits] => 2
            [nb_uniq_visitors] => 1
            [nb_hits] => 2
            [sum_time_spent] => 0
            [url] => http://example.com/?a=1
            [segment] => outlinkUrl==http%3A%2F%2Fexample.com%2F%3Fa%3D1
        )

    [2] => Array
        (
            [label] => example.com/?a=1&b=0
            [nb_visits] => 2
            [nb_uniq_visitors] => 1
            [nb_hits] => 2
            [sum_time_spent] => 0
            [url] => http://example.com/?a=1&b=0
            [segment] => outlinkUrl==http%3A%2F%2Fexample.com%2F%3Fa%3D1%26amp%3Bb%3D0
        )
)

When i use sement:

1a) http://mypiwik.de/piwik?module=API&method=Actions.getOutlinks&idSite=1&segment=outlinkUrl==http%3A%2F%2Fexample.com%2F&period=day&date=2017-12-21&token_auth=xxx&format=php&flat=1
2a) http://mypiwik.de/piwik?module=API&method=Actions.getOutlinks&idSite=1&segment=outlinkUrl==http%3A%2F%2Fexample.com%2F%3Fa%3D1&period=day&date=2017-12-21&token_auth=xxx&format=php&flat=1
3a) http://mypiwik.de/piwik?module=API&method=Actions.getOutlinks&idSite=1&segment=outlinkUrl==http%3A%2F%2Fexample.com%2F%3Fa%3D1%26amp%3Bb%3D0&period=day&date=2017-12-21&token_auth=xxx&format=php&flat=1

For 1a) and 2a) I get the right response but on 3a) there is an empty array.

What ist the problem with “ampersand”-symbol ?

My Piwik Version: 3.2.1

Hi,

Just a wild guess, but this may help:
You are using http%3A%2F%2Fexample.com%2F%3Fa%3D1%26amp%3Bb%3D0 which decodes to http://example.com/?a=1&b=0.

What if you tried http%3a%2f%2fexample.com%2f%3fa%3d1%26b%3d0 instead which should encode to http://example.com/?a=1&b=0.
The & should URL-encode to %26.

thank you Lukas for your answer.
There is the same result.
I get an empty array.