Best answer

Allow zap user to input auth/api URL

  • 13 March 2020
  • 6 replies
  • 7642 views

Userlevel 1

Is there a way to allow zaps to define which URL to use for authentication and API calls? Using the app designer + env variables gives the “Only absolute URLs are supported” error, so I guess that’s out.

icon

Best answer by ikbelkirasan 13 March 2020, 11:52

Hi @Qobo 

When you get the “Only absolute URLs are supported” error, it means that you’re using a relative URL path. You can use environment variables to set the base URL to use, then concatenate the base and relative URLs to construct the complete path. e.g.

z.request({
url: process.env.BASE_URL + "/user/profile",
// ...
})

 

View original

6 replies

Userlevel 7
Badge +11

Hi @Qobo 

When you get the “Only absolute URLs are supported” error, it means that you’re using a relative URL path. You can use environment variables to set the base URL to use, then concatenate the base and relative URLs to construct the complete path. e.g.

z.request({
url: process.env.BASE_URL + "/user/profile",
// ...
})

 

Userlevel 1

@ikbelkirasan perfect, thanks!

Userlevel 1

@ikbelkirasan can I do the same via the UI builder? I am doing something like this and getting absolute url error while testing the authentication 

 

 

@sanchitsharma hi! Did the variable on the UI mode work?

Userlevel 7
Badge +11

@sanchitsharma - I’ve just seen your comment! Yes, that’s possible and you’re probably getting that error because you didn’t define BACKEND_URL in the environment variables page.

 

Userlevel 1

Thanks @ikbelkirasan , sorry for trouble, yes I had defined the BACKEND_URL in advanced options but somehow it had not been saved.

@Pmaojo 

Once declared it works.

Real neat, the whole Zapier development environment.

Reply