Character Equipment API 404

Hello. At runtime:

$str = "https://eu.api.blizzard.com/profile/wow/character/galakrond/{characterName}/equipment?access_token={token}&locale=en_US&namespace=profile-eu"
$ch = curl_init($str);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_HTTPHEADER, $header);
$content = curl_exec($ch);
curl_close($ch);

I get an answer:
{"code":404,"type":"BLZWEBAPI00000404","detail":"Not Found"}

But when I follow the same link, I see a normal answer with data on the character’s equipment. I have no problems with “/wow/user/characters”, “/data/wow/region/index”, …
Any ideas?

Make sure you are passing the char name in lowercase and properly encoded. If you test using your browser it will likely deal with the encoding for you.

Here is a sample code from a library I contribute dealing with realm and char encodings:
(blizzard_api/wow/profile/character.php · master · David Matthew / Blizzard API PHP · GitLab)

private function character_url($realmName, $characterName, $variant = null) {
    $realmName = rawurlencode($this->createSlug($realmName));
    $characterName = rawurlencode($this->createSlug($characterName));
    $url = "{$this->baseUrl('profile')}/character/$realmName/$characterName";
    if ($variant) {
      $url .= "/$variant";
    }
    return $url;
  }

When I open the link in the browser, I see all the information about the character’s equipment. Unfortunately, this option is excluded.

That is exactly what I’m trying to say, the browser will encode anything, so it might work on the browser and not using curl. You have to encode char names and realms.

One other thing, what exactly are you passing on your $header variable ?

$header = array("Content-type: application/x-www-form-urlencoded");
urlencode solved the problem. Thank you very much