Add,Update,Delete,session maintenance


(Piyush Agrawal) #1

Hello,

I have some few question while making API request:

1)Session Maintainance
I make request for login (common.db.login), then make request get party list (model.party.party.search_read), it works fine & I also saved user_ID & session Key for future API request.
But even if I make requester after a second to party list (model.party.party.search_read) with saved user_id & Session_Key then it shows me error like"Not Logged"

  1. Add,Update,Delete
    How to make API request for Add,Update,Delete? Is there any API documentation for that?

  2. GetSingleRecord
    I am make request with domains like [“re_name”,"=","%%%s%%"], but it returns me blank Array


(Cédric Krier) #2

I see no feature description in this message.
If you are looking for support, please use the mailing lists.


(Piyush Agrawal) #3

I try Mail Listing but moderator rejected my topic.
So How Can I get some help?

Thank you,


(Cédric Krier) #6

Session expires after the session timeout. For scripting, it is better to use XML-RPC with basic authentication for series <= 4.0. For future series >= 4.2, both protocol will support basic authentication.

The documentation is not complete yet: https://trytond.readthedocs.io/en/latest/topics/rpc.html
But you just have to look at the ModelStorage API and consider that instance must be id for RPC and user/session must be prepended.

There are many mistakes here. It must be: [["rec_name", "=", "<string>"]]
You can not use the % with the operation =.
See http://doc.tryton.org/4.0/trytond/doc/topics/domain.html


(Cédric Krier) #7

(Cédric Krier) #8