Page 1 of 3 123 LastLast
Results 1 to 10 of 24
  1. #1

    Default Who knows how to connect to a certain API?


    Im a newbie and currently developing a website but I dont know how to connect to an API. Request and response is via JSON. Thanks for the help!

  2. #2
    Try using $.ajax() from jQuery

  3. #3
    read more about ajax or better yet, use frameworks like jQuery..

  4. #4
    I tried using ajax but the thing is I always get this error No "Access-Control-Allow-Origin" . Would curl be okay to connect to an API? I also use it however the response is the UI of the API. I have a third party username and password to authenticate and the response would be a sessionID if I directly input it to the API. I tried to send a request with the data and use post method in curl. Status is 200 but unfortunately i got the UI as a reponse. I badly need your help guys. Thanks!

  5. #5
    download the api library., install curl...

    follow the manual.

    use JQuery framework.

  6. #6
    using curl meaning you would be doing it on the server side.. using ajax, you'll be doing it at client side.. so better think of which is which, depende sa imong situation.. and Access-Control-Allow-Origin means you are not allowed to access the site using the current domain you are using in (my guess would be localhost).. find a way to work around with that..

  7. #7
    I had that problem before creating my first Rest-FUL web service. Your app should be in the same domain with your "API"... If you're the one creating your "API" you should be implementing CORS (cross-origin resource sharing) sa server side in that way the service will include the Access-Control-Origin sa server's header response. This is not the problem sa client side, sa server side ni.

    In your case check the documentation sa imong third party web service if kung inig hatag nila ug SessionID sa imong App kay ma apil na sa white list sa ilang server imong domain sa imong app.

    Have you tried putting this one "$.support.cors =true;"?

  8. #8
    love to watch this topic.

  9. #9
    you can use php curl for that or jquery ajax and jason..pero depende sa imung api gi gamit

  10. #10
    Unfortunately I am not the one who develop the API they only provide me with the URL of the API, third party username and password to test it directly to their API and see what is the sample result. We don't share the same domain, but they white listed my Public IP Address and the IP of the domain of my site to connect to the API. Request and response is via JSON so I would prefer on AJAX. Akong gamiton nga dataType is jsonp? or mu depende pud sa gigamit sa API? hmmm?? dayun application/javascript ang contentType.?

  11.    Advertisement

Page 1 of 3 123 LastLast

Similar Threads

 
  1. Who knows how to sketch?
    By HybernaTe in forum Manga & Anime
    Replies: 2
    Last Post: 09-18-2007, 09:30 AM
  2. Who knows how to setup Mail Server (linux)
    By jdimpas in forum Networking & Internet
    Replies: 5
    Last Post: 09-07-2007, 09:08 AM
  3. Help: Who knows how to Organize Bazaars?
    By secret_anx in forum Parties & Events
    Replies: 13
    Last Post: 08-09-2007, 08:03 PM
  4. LF: Who knows how to run Fallout 1&2 in WinXP
    By Hitchiker in forum Software & Games (Old)
    Replies: 2
    Last Post: 10-18-2006, 09:57 AM
  5. Who knows how to BEATBOX?
    By celtic_predator in forum Music & Radio
    Replies: 1
    Last Post: 07-19-2006, 12:46 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
about us
We are the first Cebu Online Media.

iSTORYA.NET is Cebu's Biggest, Southern Philippines' Most Active, and the Philippines' Strongest Online Community!
follow us
#top