[PHP] Probleme mit der Imagehack.us API

Dieses Thema im Forum "Webentwicklung" wurde erstellt von Richie, 30. April 2013 .

  1. 30. April 2013
    Probleme mit der Imagehack.us API

    hallo leute,

    ich versuche mich eben mal an der imageshack.us bereitgestellten api.
    ImageshackAPI -
    imageshackapi -


    ImageShack and yfrog API libraries - Google Project Hosting


    Und zwar möchte ich die API wie folgt nutzen:
    Code:
    Uploading an Image from URL
    Endpoint : https://post.imageshack.us/upload_api.php
    Parameters :
    * key : The api key for your application; found in email sent after filling out our API Key Request form
    * url : The url the image is located at
    * format : json
    tags : a CSV list of tags to describe your picture
    public : A string setting your image to public or private where "yes" is public and "no" is private. Images are public by default.
    das ist mein dazugehöriger code
    ich habe bei imageshack.us einen key angefordert und erhalten. dieser steht dann statt PLATZHALTER im code.
    PHP:
    <? php

    $postdaten 
    = array( "key"  =>  "PLATZHALTER"  , "url"  =>  "http://blogs.taz.de/arabesken/files/2012/05/testbild-sendepause.jpg" "format"  =>  "json" );
    $curl  curl_init ();
        
    curl_setopt ( $curl CURLOPT_URL "https://post.imageshack.us/upload_api.php" );
        
    curl_setopt ( $curl CURLOPT_POST true );
        
    curl_setopt ( $curl CURLOPT_POSTFIELDS $postdaten );
        
    curl_setopt ( $curl CURLOPT_RETURNTRANSFER true );
        
    curl_setopt ( $curl CURLOPT_FOLLOWLOCATION true );
        
    $body  curl_exec ( $curl );
        
    $json  json_decode ( $body );
    ?>
    nur leider erhalte ich in der $json variable immer nur "null" .
    hat einer von euch eine idee wo der fehler liegt bzw. kennt jemand diese api?

    lg und danke!
     
  2. 30. April 2013
    AW: Probleme mit der Imagehack.us API

    Eigentlich sieht alles richtig aus.

    Stell bitte sicher das alle Warnungen etz ausgeben werden.
    Ich denke es könnte ein https Problem sein.
     
  3. 30. April 2013
    AW: Probleme mit der Imagehack.us API

    genau daran lag es.
    mit http funktioniert es tadellos!
    danke!
     
  4. Video Script

    Videos zum Themenbereich

    * gefundene Videos auf YouTube, anhand der Überschrift.