Question About Lookup Field and REST API

Dear Developers,

Currently I’m creating a Kintone App which using a Lookup and REST API, and then I encountered the same problem as below post:

https://developer.kintone.io/hc/en-us/community/posts/360000665873-Is-there-any-way-to-work-with-Lookup-fields- 

And thus my problem has been solved, by following the latest reply of that post, which he said by using an X-Cybozu-Authorization included on Headers instead of X-Cybozu-API-Token― now I am able to create a record on an app using REST API where there’s a Lookup field placed

However,

As below post stated:

https://developer.kintone.io/hc/en-us/articles/229868687-Using-API-Token-authentication 

that “(…) there is also a risk of the user credentials being leaked from that system.” means that using API Token instead of User API Token probably is the best way to authorize a request API

My question is

Is there any way for me to be able to POST using REST API to an app where a Lookup field used― by using API Token (X-Cybozu-API-Token) instead of using User API Token (X-Cybozu-Authorization) ?

Any answer would be appreciated

Thanks

Afief

Hi Afief,

 

Unfortunately, you can not use POST with API token for lookup fields as the API docs says below.

 

▼ Kintone REST API Overview Under API Token Authentication
https://developer.kintone.io/hc/en-us/articles/212495188-Kintone-REST-API-Overview

“*values of Lookup fields cannot be created/updated with REST API”

 

Therefore, you may need to use a user or session authorization instead.

 

Thanks.
Junko

Hi Junko

Yes, I think that there’s no other way except using user authorization, I may do some other way so that I could use a newly created user authorization for that

You helped me a lot, for that matter I appreciate it so much

Again, thank you,

Afief