Home > Back-end >  Twillio : before building the app, what is the base URL?
Twillio : before building the app, what is the base URL?

Time:07-16

I wrote Twillio code to get phone verification in frontend.

And here PRACTICE_BASE_URL was my IP address like below since I just test it on expo. Whenever IP address I changed it.

const PRACTICE_BASE_URL = "http://172.30.1.18:4000";



const sendCode = async () => {
    setPhoneInserted(true);
    setwaitMessage(true);
    // send verfication code to phone number
    await fetch(`${PRACTICE_BASE_URL}/verify/${phone}`, {
      method: "GET",
      headers: {
        "Content-Type": "application/json",
      },
    })
      .then((res) => res.json())
      .then((res) => {
        if (res.status === "pending") {
          setcheckedNumber(phone);
          setwaitMessage(false);
        }
      })
      .catch((err) => {
        setPhoneInserted(false);
        setwaitMessage(false);
        setphone("");
        console.log(err);
        setDisableConfirm(true);
        goDownY.start();
        setVeriBox(true);
        setVerimessage("잘못된 휴대전화번호입니다.");
        reset();
        setretry(true);
      });
  };

I want to build the app in real or beta version from expo now.

So how do I change BASE_URL here?

I searched but not found in Twillio homepage. please help me.

CodePudding user response:

The usual base URL for the Twilio API is:

https://api.twilio.com/2010-04-01/

The base URL for the Twilio Verify API is:

https://verify.twilio.com/v2/

  • Related