[dss-developer] Help needed on JSON Api request with c#/VB.net

Trollhagen, Daniel daniel.trollhagen at digitalstrom.com
Thu Feb 25 16:12:17 CET 2016



Hallo Herr Rings,



vielleicht, weil Sie jetzt zwei Fragezeichen in dem Anfragestring drin haben?

Dim url As String = ""

url = "https://" & adress & Port & "/json/apartment/device/getOutputValue"

url &= "?dsid=" & DeviceID & "&offset=0"

url &= "?token=" & Token





Freundliche Grüße



digitalSTROM GmbH



Daniel Trollhagen

Hardwareentwicklung



Mail       support at digitalstrom.com

Fon        +49 6441 870798-55

Fax         +49 6441 870798-12

Web      www.digitalstrom.com



digitalSTROM GmbH | Garbenheimer Str. 38| DE-35578 Wetzlar | Fon +49 6441 870798-0

Amtsgericht Wetzlar HRB 5029 | Geschäftsführer Dirk Debus | Commerzbank Wetzlar I IBAN DE15 5154 0037 0485 5888 00 | BIC COBADEFF515 | Ust.IdNr. DE240803113



-----Ursprüngliche Nachricht-----
Von: dss-developer-bounces at forum.digitalstrom.org [mailto:dss-developer-bounces at forum.digitalstrom.org] Im Auftrag von Siegfried Rings - VISAM GmbH
Gesendet: Donnerstag, 25. Februar 2016 15:25
An: dss-developer at forum.digitalstrom.org
Betreff: [dss-developer] Help needed on JSON Api request with c#/VB.net



i'm developing an app in a Microsoft's  Dotnet language(vb.net, c# would also match).



i can login, get a token and get some infos.





If the function is simple (like GetName() from apartment it works:



Dim url As String = ""

url = "https://" & adress & Port & "/json/apartment/getName"

url &= "?token=" & Token



        Dim Antwort As String = ""

        Request = CType(WebRequest.Create(url), HttpWebRequest) 'anfordern

        If Request IsNot Nothing Then

            Try

                Dim IoStream As System.IO.Stream = Request.GetResponse.GetResponseStream

                Dim StrRead As System.IO.StreamReader = New

System.IO.StreamReader(IoStream)

                Antwort = StrRead.ReadToEnd

                StrRead.Close() : StrRead = Nothing

                IoStream.Close() : IoStream = Nothing

            Catch wex As WebException

                MsgBox(wex.ToString)

            End Try

        End If





i got the correct json answer back.

But if i have a function with one or more parameter, it fails:





Dim url As String = ""

url = "https://" & adress & Port & "/json/apartment/device/getOutputValue"

url &= "?dsid=" & DeviceID & "&offset=0"

url &= "?token=" & Token



i got a "403" error message from the server



any hints or example in a .NET language ?









--

Beste Grüße aus Neuwied,



Siegfried Rings

Softwareentwicklung



VISAM GmbH

Irlicher Str. 20

D-56567 Neuwied (Germany)



Tel. : +49 (0) 2631 / 941288-0

Fax : +49 (0) 2631 / 941288-9



Mail: Rings at visam.de<mailto:Rings at visam.de>

Web: www.visam.de<http://www.visam.de>



Vertretungsberechtigter Geschäftsführer: Uwe Abresch

Registergericht: Amtsgericht Montabaur

Registernummer: HRB 14033



___________________________________________________________________





Hiermit widerspreche ich der Nutzung oder Übermittlung meiner persönlichen Daten für Werbezwecke gemäß Par. 28 Abs. 3 Bundesdatenschutzgesetz.



( Unsolicited commercial email is not permitted at this address.)



___________________________________________________________________



Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren, jegliche anderweitige Verwendung sowie die unbefugte Weitergabe dieser Mail ist nicht gestattet.





(This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in

error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure, distribution or otherwise use of the material or parts thereof is strictly forbidden. )



˙uʍop-ǝpısdn sı ɹoʇıuoɯ ɹnoʎ 'sıɥʇ pɐǝɹ uɐɔ noʎ ɟı





_______________________________________________

dss-developer mailing list

dss-developer at forum.digitalstrom.org<mailto:dss-developer at forum.digitalstrom.org>

http://forum.digitalstrom.org/cgi-bin/mailman/listinfo/dss-developer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://forum.digitalstrom.org/pipermail/dss-developer/attachments/20160225/483967a4/attachment-0001.html>


More information about the dss-developer mailing list