Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP]Łączenie z API.. jak sie za to zabrac
Wasper
post
Post #1





Grupa: Zarejestrowani
Postów: 82
Pomógł: 1
Dołączył: 18.09.2011

Ostrzeżenie: (0%)
-----


Witam.

Mam problem. Dostalem ostatnio szybka dokumentacje


**********************************************
Token: xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
url: api.xxxxxx.xxxxxx.com.pl

Authorization
Access to API is protected by token authorization.
Authorization header:
Token token="[MD5 TOKEN]"
so http header should looks like:
Authorization: Token token="[MD5 TOKEN]"

API resources
award order status

GET /api/v1/award_order_status/[ORDER NUMBER](.:format)

Available formats: json, xml
********************************

... i przyznam szczerze, ze nie mialem jeszcze totalnie stycznosci z tym i totalnie nie wiem jak sie za to zabrac.
Cel jest taki, ze podaje zmienna i odbieram status rekordu.

Wygrzebalem cos takiego
  1. // Create a stream
  2. $opts = array(
  3. 'http'=>array(
  4. 'method'=>"GET",
  5. 'header'=>"Accept-language: en\r\n" .
  6. "Cookie: foo=bar\r\n"
  7. )
  8. );
  9.  
  10. $context = stream_context_create($opts);
  11.  
  12. // Open the file using the HTTP headers set above
  13. $file = file_get_contents('http://www.example.com/', false, $context);


ale niewiele mi pomoglo, po prostu mam pustke przed oczami, nie wiem z ktorej strony to ugryzc.
Wesprzyjcie rada, prosze smile.gif
Pozdro

Ten post edytował Wasper 18.09.2012, 14:13:38
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 21.08.2025 - 21:02