Page 1 of 1

Non-Agent API - Some custom fields not inserting

PostPosted: Fri Jan 08, 2021 11:46 am
by rhonautics
I've been using non-agent api for some time now, and it works fine with the default fields. However, when I tried to use custom fields, some of the fields are not inserted into the custom_<list_id> table.

http://www.vicidial.org/docs/NON-AGENT_API.txt

My query string are as shown below:
Code: Select all
custom_fields=Y&ip_address=www.xxx.yyy.zzz&subid=qwerty&subsubid=zxcvb&insertdate=2021-01-08&inserttime=1000H&pain_location=joint

Only ip_address, subid, subsubid & insertdate are stored. inserttime & pain_location is not inserted into the custom_<list_id> table. I've checked the column name on the custom fields table, it matches the query string parameters.

Is there something that I've missed out, or limitations of non-agent api that I'm not aware of perhaps?

Re: Non-Agent API - Some custom fields not inserting

PostPosted: Fri Jan 08, 2021 12:03 pm
by carpenox
which function are you trying to use?

Re: Non-Agent API - Some custom fields not inserting

PostPosted: Fri Jan 08, 2021 12:15 pm
by rhonautics
I'm trying to add lead using add_lead function. Default fields works but custom fields are picky.

Re: Non-Agent API - Some custom fields not inserting

PostPosted: Fri Jan 08, 2021 12:32 pm
by carpenox
does the api user have this enabled? Custom Fields Modify = 1

Image

Re: Non-Agent API - Some custom fields not inserting

PostPosted: Fri Jan 08, 2021 12:59 pm
by rhonautics
Yes, also these options.

Modify Leads - 1
Custom Fields Modify - 1
Agent API Access -1
API Allowed Functions - All Functions

Still the same.

Re: Non-Agent API - Some custom fields not inserting

PostPosted: Fri Jan 08, 2021 1:04 pm
by carpenox
msg me on skype ill try to help you troubleshoot it and we can report back the fix afterwards

Re: Non-Agent API - Some custom fields not inserting

PostPosted: Fri Jan 08, 2021 1:13 pm
by rhonautics
sounds good. I just sent you a message on skype

Re: Non-Agent API - Some custom fields not inserting

PostPosted: Fri Jan 08, 2021 1:54 pm
by carpenox
wait i just realized that some fields were working and some were not, i didnt pay attention to that at first, im sorry. It has to perhaps be a limitation on the adds lead function

Re: Non-Agent API - Some custom fields not inserting

PostPosted: Fri Jan 08, 2021 11:02 pm
by rhonautics
I had to dig into the code of non-agent api. It is checking vicidial_lists_fields first before inserting custom fields to custom_<list_id> table.

This is not a limitation of add_lead function.

In my case, I was creating custom_<list_id> manually with a script that I created to make lead lists on a daily basis but unknowingly bypassed the vicidial_lists_fields.

Re: Non-Agent API - Some custom fields not inserting

PostPosted: Sat Jan 09, 2021 8:11 am
by carpenox
i messaged you back on skype