Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 24

Who knows how to connect to a certain API?


This discussion is about "Who knows how to connect to a certain API?" in the "Programming" forums.
dataType: json or html. Depende kung unsay ei reply sa service. contentType: application/json if ang data ako gi send kay JSON otherwise dili nako ei ...

  1. #11
    Junior Member
    Join Date
    Aug 2010
    Gender
    Male
    Posts
    293

    dataType: json or html. Depende kung unsay ei reply sa service.

    contentType: application/json if ang data ako gi send kay JSON otherwise dili nako ei specify.

  2. #12
    Newbie
    Join Date
    Sep 2014
    Gender
    Female
    Posts
    18
    I tried jsonp para cross domain gali problem is ang response nya text/html dle match sa ako contentType nga application/json. Akong url is kato nga page sa API nila murag mao sguro nga ang UI ang gi response kay mao man akong url. Ang function siguro ako tawgon, problem is asa man sad naq tawgon ang function?

  3. #13
    Junior Member
    Join Date
    Aug 2010
    Gender
    Male
    Posts
    293
    Can you share some code? ei mask lang ang mga dili angay ipa kita.

  4. #14
    Newbie
    Join Date
    Sep 2014
    Gender
    Female
    Posts
    18
    Quote Originally Posted by jerknolblerdek View Post
    Can you share some code? ei mask lang ang mga dili angay ipa kita.
    mao ni siya ayy

    <script>
    $(document).ready(function() {
    $.ajax({
    url: 'urlnisaauthenticatesessionpagesaapi/json?callback?username=sample&password=sample',
    type: "POST",
    dataType: 'jsonp',
    contentType: 'application/javascript',

    success: function(msg) {
    alert(msg);
    console.log(msg);
    }
    });
    });
    </script>

  5. #15
    Senior Member redcat_13's Avatar
    Join Date
    Mar 2013
    Gender
    Male
    Posts
    594
    Quote Originally Posted by Ms. C View Post
    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.?
    better check the api first.. you basically need to know these 3 things: (1) URL (2) method (post/get/delete/put), although first 2 pa ang supported by ajax (3) the type of response (json/html/etc).. jsonp is by default for cross-domain requests..

    - - - Updated - - -

    Quote Originally Posted by Ms. C View Post
    contentType: 'application/javascript',
    karon pa ko ani nga content type.. supposed to form or text type ni, either application/x-www-form-urlencoded, multipart/form-data, or text/plain...

  6. #16
    C.I.A. ondoy's Avatar
    Join Date
    Oct 2007
    Gender
    Male
    Posts
    2,753
    kung kana imo app e deploy rapud nimo kung asa ng api nabutang, pwede raka ani (for development testing): Does --disable-web-security work in Chrome anymore? - Stack Overflow

    but if separate jud sila nga domain e deploy, kini:
    jquery - Cross domain ajax request to a json file using JSONP - Stack Overflow

  7. #17
    Newbie
    Join Date
    Sep 2014
    Gender
    Female
    Posts
    18
    karon pa ko ani nga content type.. supposed to form or text type ni, either application/x-www-form-urlencoded, multipart/form-data, or text/plain...
    kuan nana siya if jsonp ang gamit hehehe... Nakit.an ra pud nako sa akong pag search2 ba hehehe

  8. #18
    Newbie
    Join Date
    Sep 2014
    Gender
    Female
    Posts
    18
    Quote Originally Posted by ondoy View Post
    kung kana imo app e deploy rapud nimo kung asa ng api nabutang, pwede raka ani (for development testing): Does --disable-web-security work in Chrome anymore? - Stack Overflow

    but if separate jud sila nga domain e deploy, kini:
    jquery - Cross domain ajax request to a json file using JSONP - Stack Overflow
    During the development separate but after ma accomplish ilisan napud nako ang naka set nga jsonp to json kay ilaha mang server gamiton gud.

  9. #19
    C.I.A. ondoy's Avatar
    Join Date
    Oct 2007
    Gender
    Male
    Posts
    2,753
    Quote Originally Posted by Ms. C View Post
    During the development separate but after ma accomplish ilisan napud nako ang naka set nga jsonp to json kay ilaha mang server gamiton gud.
    ah parehu rta ug style..chrome ra gamita din disable ang security,daug nka..din pwede rmna ordinary json lang yawna e jsonp pra dli nka mag ilis2

  10. #20
    Newbie
    Join Date
    Sep 2014
    Gender
    Female
    Posts
    18
    wala nalang ko nag use ug ajax guys kay murag sa ilaha jud to nga API ang problem ahahha nag curl nlang jud ko nakuha raman pud nako. Thanks for the help anyways !

  11.    Advertisement

Page 2 of 3 FirstFirst 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