[Dev] Use API URL as Parameter for Connectors

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

[Dev] Use API URL as Parameter for Connectors

chanaka777
Hi,

I'm developing LinkedIn connector supporting to their REST API [0] and having some doubts on parameterizing the LinkedIn API URL (including the API version - http://api.linkedin.com/v1/).

I figured out 3 ways.

1. Let the user send the API URL with version. Here user can chose which API version to use.
2. Set default API URL with version inside the init method. This way, it's not essential to pass this parameter, but still user can override.
3. Without parameterizing API URL, hard code it inside the synapse template.

What is the most suitable approach out of those 3 options ?
Or else is there any other suited option ?

Any thoughts on this would be highly appreciated.

_______________________________________________
Dev mailing list
[hidden email]
http://wso2.org/cgi-bin/mailman/listinfo/dev
Regards !
--
Chanaka Dharmarathna
Reply | Threaded
Open this post in threaded view
|

Re: [Dev] Use API URL as Parameter for Connectors

indika prasad
Hi Chanaka,

Some API like linkedin has given few options for their api url. As an example, linkedin api can be either any of below urls for get user detial operation.


IMO is basically its user call to select the best fitting URL.

WDYT?

Thanks
BR
Indika Kularathne



On Tue, Feb 11, 2014 at 11:39 PM, Chanaka Dharmarathna <[hidden email]> wrote:
Hi,

I'm developing LinkedIn connector supporting to their REST API [0] and having some doubts on parameterizing the LinkedIn API URL (including the API version - http://api.linkedin.com/v1/).

I figured out 3 ways.

1. Let the user send the API URL with version. Here user can chose which API version to use.
2. Set default API URL with version inside the init method. This way, it's not essential to pass this parameter, but still user can override.
3. Without parameterizing API URL, hard code it inside the synapse template.

What is the most suitable approach out of those 3 options ?
Or else is there any other suited option ?

Any thoughts on this would be highly appreciated.

_______________________________________________
Dev mailing list
[hidden email]
http://wso2.org/cgi-bin/mailman/listinfo/dev



_______________________________________________
Dev mailing list
[hidden email]
http://wso2.org/cgi-bin/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: [Dev] Use API URL as Parameter for Connectors

indika prasad
In reply to this post by chanaka777
Hi Chanaka,

Some API like linkedin has given few options for their api url. As an example, linkedin api can be either any of below urls for get user detial operation.

01. http://api.linkedin.com/v1/people/~
02. https://api.linkedin.com/v1/people/~
03. http://www.linkedin.com/v1/people/~
04. https://www.linkedin.com/v1/people/~

IMO is basically its user call to select the best fitting URL.

WDYT?

Thanks
BR
Indika Kularathne
Reply | Threaded
Open this post in threaded view
|

Re: [Dev] Use API URL as Parameter for Connectors

malakasilva
Hi Chanaka,

With different versions can we use the same set of input parameters?

If there are specific parameters for specific version we need to hardcode it and do different versions of the connector accordingly.

Best Regards,
Malaka


On Wed, Feb 12, 2014 at 12:30 AM, indika prasad <[hidden email]> wrote:
Hi Chanaka,

Some API like linkedin has given few options for their api url. As an
example, linkedin api can be either any of below urls for get user detial
operation.

01. http://api.linkedin.com/v1/people/~
02. https://api.linkedin.com/v1/people/~
03. http://www.linkedin.com/v1/people/~
04. https://www.linkedin.com/v1/people/~

IMO is basically its user call to select the best fitting URL.

WDYT?

Thanks
BR
Indika Kularathne




--
View this message in context: http://wso2-oxygen-tank.10903.n7.nabble.com/Dev-Use-API-URL-as-Parameter-for-Connectors-tp92062p92064.html
Sent from the WSO2 Development mailing list archive at Nabble.com.
_______________________________________________
Dev mailing list
[hidden email]
http://wso2.org/cgi-bin/mailman/listinfo/dev



--

Best Regards,

Malaka Silva
Senior Tech Lead
M: +94 777 219 791
Fax :94 11 2145300 
LinkedIn : http://www.linkedin.com/pub/malaka-silva/6/33/77

WSO2, Inc. 
lean . enterprise . middleware 
http://www.wso2.com/

Save a tree -Conserve nature & Save the world for your future. Print this email only if it is absolutely necessary.

_______________________________________________
Dev mailing list
[hidden email]
http://wso2.org/cgi-bin/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: [Dev] Use API URL as Parameter for Connectors

chanaka777
Hi Malaka,


On Wed, Feb 12, 2014 at 11:42 AM, Malaka Silva <[hidden email]> wrote:
Hi Chanaka,

With different versions can we use the same set of input parameters?
 
It can be changed. However we cannot guarantee on this since all the rights have the API owner.
 
If there are specific parameters for specific version we need to hardcode it and do different versions of the connector accordingly.

I agree to this. But when considering the situation pointed by Indika, how we support that ?
1. Parameterize URL without version ({uri.var.apiUrl}/v1/people/~). Here we can set default value of uri.var.apiUrl to "https://api.linkedin.com"
2. Hard code complete URL (https://api.linkedin.com/v1/people/~). We can use mostly used API URL for this (https://api.linkedin.com).

Regards !
 

Best Regards,
Malaka


On Wed, Feb 12, 2014 at 12:30 AM, indika prasad <[hidden email]> wrote:
Hi Chanaka,

Some API like linkedin has given few options for their api url. As an
example, linkedin api can be either any of below urls for get user detial
operation.

01. http://api.linkedin.com/v1/people/~
02. https://api.linkedin.com/v1/people/~
03. http://www.linkedin.com/v1/people/~
04. https://www.linkedin.com/v1/people/~

IMO is basically its user call to select the best fitting URL.

WDYT?

Thanks
BR
Indika Kularathne




--
View this message in context: http://wso2-oxygen-tank.10903.n7.nabble.com/Dev-Use-API-URL-as-Parameter-for-Connectors-tp92062p92064.html
Sent from the WSO2 Development mailing list archive at Nabble.com.

_______________________________________________
Dev mailing list
[hidden email]
http://wso2.org/cgi-bin/mailman/listinfo/dev



--

Best Regards,

Malaka Silva
Senior Tech Lead
M: <a href="tel:%2B94%20777%20219%20791" value="+94777219791" target="_blank">+94 777 219 791
Fax :<a href="tel:94%2011%C2%A02145300" value="+94112145300" target="_blank">94 11 2145300 
LinkedIn : http://www.linkedin.com/pub/malaka-silva/6/33/77

WSO2, Inc. 
lean . enterprise . middleware 
http://www.wso2.com/

Save a tree -Conserve nature & Save the world for your future. Print this email only if it is absolutely necessary.



--

_______________________________________________
Dev mailing list
[hidden email]
http://wso2.org/cgi-bin/mailman/listinfo/dev
Regards !
--
Chanaka Dharmarathna
Reply | Threaded
Open this post in threaded view
|

Re: [Dev] Use API URL as Parameter for Connectors

malakasilva
Hi Chanaka,

Please find following comments.

On Wed, Feb 12, 2014 at 12:59 PM, Chanaka Dharmarathna <[hidden email]> wrote:
Hi Malaka,


On Wed, Feb 12, 2014 at 11:42 AM, Malaka Silva <[hidden email]> wrote:
Hi Chanaka,

With different versions can we use the same set of input parameters?
 
It can be changed. However we cannot guarantee on this since all the rights have the API owner.
    Write the connector for widely used version 
 
If there are specific parameters for specific version we need to hardcode it and do different versions of the connector accordingly.

I agree to this. But when considering the situation pointed by Indika, how we support that ?
1. Parameterize URL without version ({uri.var.apiUrl}/v1/people/~). Here we can set default value of uri.var.apiUrl to "https://api.linkedin.com"
2. Hard code complete URL (https://api.linkedin.com/v1/people/~). We can use mostly used API URL for this (https://api.linkedin.com).
   Give the URL as an optional parameter. Set the default to    "https://api.linkedin.com"

Regards !
 

Best Regards,
Malaka


On Wed, Feb 12, 2014 at 12:30 AM, indika prasad <[hidden email]> wrote:
Hi Chanaka,

Some API like linkedin has given few options for their api url. As an
example, linkedin api can be either any of below urls for get user detial
operation.

01. http://api.linkedin.com/v1/people/~
02. https://api.linkedin.com/v1/people/~
03. http://www.linkedin.com/v1/people/~
04. https://www.linkedin.com/v1/people/~

IMO is basically its user call to select the best fitting URL.

WDYT?

Thanks
BR
Indika Kularathne




--
View this message in context: http://wso2-oxygen-tank.10903.n7.nabble.com/Dev-Use-API-URL-as-Parameter-for-Connectors-tp92062p92064.html
Sent from the WSO2 Development mailing list archive at Nabble.com.

_______________________________________________
Dev mailing list
[hidden email]
http://wso2.org/cgi-bin/mailman/listinfo/dev



--

Best Regards,

Malaka Silva
Senior Tech Lead
M: <a href="tel:%2B94%20777%20219%20791" value="+94777219791" target="_blank">+94 777 219 791
Fax :<a href="tel:94%2011%C2%A02145300" value="+94112145300" target="_blank">94 11 2145300 
LinkedIn : http://www.linkedin.com/pub/malaka-silva/6/33/77

WSO2, Inc. 
lean . enterprise . middleware 
http://www.wso2.com/

Save a tree -Conserve nature & Save the world for your future. Print this email only if it is absolutely necessary.





--

Best Regards,

Malaka Silva
Senior Tech Lead
M: +94 777 219 791
Fax :94 11 2145300 
LinkedIn : http://www.linkedin.com/pub/malaka-silva/6/33/77

WSO2, Inc. 
lean . enterprise . middleware 
http://www.wso2.com/

Save a tree -Conserve nature & Save the world for your future. Print this email only if it is absolutely necessary.

_______________________________________________
Dev mailing list
[hidden email]
http://wso2.org/cgi-bin/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: [Dev] Use API URL as Parameter for Connectors

chanaka777
Hi Malaka,

Thanks for your valuable thoughts. We'll go with the approach you mentioned.

Regards !


On Wed, Feb 12, 2014 at 2:08 PM, Malaka Silva <[hidden email]> wrote:
Hi Chanaka,

Please find following comments.

On Wed, Feb 12, 2014 at 12:59 PM, Chanaka Dharmarathna <[hidden email]> wrote:
Hi Malaka,


On Wed, Feb 12, 2014 at 11:42 AM, Malaka Silva <[hidden email]> wrote:
Hi Chanaka,

With different versions can we use the same set of input parameters?
 
It can be changed. However we cannot guarantee on this since all the rights have the API owner.
    Write the connector for widely used version 
 
If there are specific parameters for specific version we need to hardcode it and do different versions of the connector accordingly.

I agree to this. But when considering the situation pointed by Indika, how we support that ?
1. Parameterize URL without version ({uri.var.apiUrl}/v1/people/~). Here we can set default value of uri.var.apiUrl to "https://api.linkedin.com"
2. Hard code complete URL (https://api.linkedin.com/v1/people/~). We can use mostly used API URL for this (https://api.linkedin.com).
   Give the URL as an optional parameter. Set the default to    "https://api.linkedin.com"

Regards !
 

Best Regards,
Malaka


On Wed, Feb 12, 2014 at 12:30 AM, indika prasad <[hidden email]> wrote:
Hi Chanaka,

Some API like linkedin has given few options for their api url. As an
example, linkedin api can be either any of below urls for get user detial
operation.

01. http://api.linkedin.com/v1/people/~
02. https://api.linkedin.com/v1/people/~
03. http://www.linkedin.com/v1/people/~
04. https://www.linkedin.com/v1/people/~

IMO is basically its user call to select the best fitting URL.

WDYT?

Thanks
BR
Indika Kularathne




--
View this message in context: http://wso2-oxygen-tank.10903.n7.nabble.com/Dev-Use-API-URL-as-Parameter-for-Connectors-tp92062p92064.html
Sent from the WSO2 Development mailing list archive at Nabble.com.

_______________________________________________
Dev mailing list
[hidden email]
http://wso2.org/cgi-bin/mailman/listinfo/dev



--

Best Regards,

Malaka Silva
Senior Tech Lead
M: <a href="tel:%2B94%20777%20219%20791" value="+94777219791" target="_blank">+94 777 219 791
Fax :<a href="tel:94%2011%C2%A02145300" value="+94112145300" target="_blank">94 11 2145300 
LinkedIn : http://www.linkedin.com/pub/malaka-silva/6/33/77

WSO2, Inc. 
lean . enterprise . middleware 
http://www.wso2.com/

Save a tree -Conserve nature & Save the world for your future. Print this email only if it is absolutely necessary.





--

Best Regards,

Malaka Silva
Senior Tech Lead
M: <a href="tel:%2B94%20777%20219%20791" value="+94777219791" target="_blank">+94 777 219 791
Fax :<a href="tel:94%2011%C2%A02145300" value="+94112145300" target="_blank">94 11 2145300 
LinkedIn : http://www.linkedin.com/pub/malaka-silva/6/33/77

WSO2, Inc. 
lean . enterprise . middleware 
http://www.wso2.com/

Save a tree -Conserve nature & Save the world for your future. Print this email only if it is absolutely necessary.



--

_______________________________________________
Dev mailing list
[hidden email]
http://wso2.org/cgi-bin/mailman/listinfo/dev
Regards !
--
Chanaka Dharmarathna
Reply | Threaded
Open this post in threaded view
|

Re: [Dev] Use API URL as Parameter for Connectors

Afkham Azeez-2
In reply to this post by chanaka777
Connectors have to be versioned, and each version of a connector would correspond to a version of the API. For example, LinkedInConnector-1.0 would correspond to the LinkedIn API v1, and so on. So, IMO, you need not pass in the version. It should be fine to hardcode it inside the template.

Azeez


On Tue, Feb 11, 2014 at 11:39 PM, Chanaka Dharmarathna <[hidden email]> wrote:
Hi,

I'm developing LinkedIn connector supporting to their REST API [0] and having some doubts on parameterizing the LinkedIn API URL (including the API version - http://api.linkedin.com/v1/).

I figured out 3 ways.

1. Let the user send the API URL with version. Here user can chose which API version to use.
2. Set default API URL with version inside the init method. This way, it's not essential to pass this parameter, but still user can override.
3. Without parameterizing API URL, hard code it inside the synapse template.

What is the most suitable approach out of those 3 options ?
Or else is there any other suited option ?

Any thoughts on this would be highly appreciated.

_______________________________________________
Dev mailing list
[hidden email]
http://wso2.org/cgi-bin/mailman/listinfo/dev




--
Afkham Azeez
Director of ArchitectureWSO2, Inc.; http://wso2.com
Member; Apache Software Foundation; http://www.apache.org/

email:
[hidden email] cell: +94 77 3320919
blog:
http://blog.afkham.org
twitter:
http://twitter.com/afkham_azeez
linked-in:
http://lk.linkedin.com/in/afkhamazeez

Lean . Enterprise . Middleware

_______________________________________________
Dev mailing list
[hidden email]
http://wso2.org/cgi-bin/mailman/listinfo/dev
Reply | Threaded
Open this post in threaded view
|

Re: [Dev] Use API URL as Parameter for Connectors

chanaka777
Hi Azeez,

Thanks for your quick response. We'll proceed with hard coded API version and parameterized API URL (https://api.linkedin.com).

Regards !


On Wed, Feb 12, 2014 at 6:02 PM, Afkham Azeez <[hidden email]> wrote:
Connectors have to be versioned, and each version of a connector would correspond to a version of the API. For example, LinkedInConnector-1.0 would correspond to the LinkedIn API v1, and so on. So, IMO, you need not pass in the version. It should be fine to hardcode it inside the template.

Azeez


On Tue, Feb 11, 2014 at 11:39 PM, Chanaka Dharmarathna <[hidden email]> wrote:
Hi,

I'm developing LinkedIn connector supporting to their REST API [0] and having some doubts on parameterizing the LinkedIn API URL (including the API version - http://api.linkedin.com/v1/).

I figured out 3 ways.

1. Let the user send the API URL with version. Here user can chose which API version to use.
2. Set default API URL with version inside the init method. This way, it's not essential to pass this parameter, but still user can override.
3. Without parameterizing API URL, hard code it inside the synapse template.

What is the most suitable approach out of those 3 options ?
Or else is there any other suited option ?

Any thoughts on this would be highly appreciated.

_______________________________________________
Dev mailing list
[hidden email]
http://wso2.org/cgi-bin/mailman/listinfo/dev




--
Afkham Azeez
Director of ArchitectureWSO2, Inc.; http://wso2.com
Member; Apache Software Foundation; http://www.apache.org/

email:
[hidden email] cell: <a href="tel:%2B94%2077%203320919" value="+94773320919" target="_blank">+94 77 3320919
blog:
http://blog.afkham.org
twitter:
http://twitter.com/afkham_azeez
linked-in:
http://lk.linkedin.com/in/afkhamazeez

Lean . Enterprise . Middleware



--

_______________________________________________
Dev mailing list
[hidden email]
http://wso2.org/cgi-bin/mailman/listinfo/dev
Regards !
--
Chanaka Dharmarathna