kintone.plugin.app.proxy not working on Plugin Settings

Hello,

According to the Plugin Javascript API documentation the available pages for kintone.plugin.app.proxy includes Plugin Settings.

https://developer.kintone.io/hc/en-us/articles/212494958/

I tried it on plugin settings page but it didn’t work. I also tried the same code on Record Details page and it work.

kintone.plugin.app.proxy( PLUGIN_ID , 'https://example.com/v4_6_release/apis/3.0/system/userDefinedFields/?conditions=' + encodeURI( 'podId=4 OR podId=5' ) , 'GET', {}, {}, function(body) {
console.log( body );
}, function(error) {
console.log(error);
} );

I tried to call it too on other plugin settings page ( of course I change the PLUGIN_ID with a proper plugin id, also the config for proxy is already set ) and it didn’t work too.

Thank you

Vern

We apologize, the documents were incorrect.
We listed that the following pages were where  kintone.plugin.app.proxy could be used:

Desktop
Record List, Record Details, Record Create, Record Edit, Graph , Plugin Settings

 

Mobile
Record List, Record Details, Record Create, Record Edit

 

We have updated the document with correct information to the following:

Desktop
Record List, Record Details, Record Create, Record Edit, Graph, Print

 

Mobile
Record List, Record Details, Record Create, Record Edit, Graph

Thanks for the quick response

Hello,

Since I can’t use the  kintone.plugin.app.proxy  on the Plugin settings, the only option I think now is to use the kintone.proxy. The question is, will I encounter any security issues later on with a regular proxy? (Yes, I need to pass a sensitive information to the header). Also is there a workaround to make the  kintone.plugin.app.proxy  work on plugin settings.

Thank you

Hi Ven,

Yes, you can use kintone.proxy on the Plugin settings instead.

Regarding the security issue, are you planning to write the same function code set-up with kintone.proxy as your original example with kintone.plugin.app.proxy below?

kintone.plugin.app.proxy( PLUGIN_ID , 'https://example.com/v4_6_release/apis/3.0/system/userDefinedFields/?conditions=' + encodeURI( 'podId=4 OR podId=5' ) , 'GET', {}, {}, function(body) {
    console.log( body );
}, function(error) {
    console.log(error);
} );

If so, I think the security level is about the same at the both senarios.

Hope it helps.

Thank you.

Junko

Hi Junko,

The url would be kind of the same, with a different origin. But I need to add basic auth ie. (public key, private key) to the header to request a rest api.

Thanks

Vern

Hi Vern,

 

I see.

Regarding the user of public key and private key, I think if your coding with kintone.plugin.app.proxy works, it should work with kintone.proxy(url, method, headers, data, callback, errback) also.

 

Hope everything goes well.

 

Thanks.

 

Junko