Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 06 Aug 2016, 07:38
iref2010 iref2010 is offline
 
Join Date: Jun 2010
Unhappy vB5 API from Python Script Issues

Hi Guys,

I am writing to create new topic and user from python script. I am able to get the user and topic info using API's but I am facing issue with POST API namely "user.save"(INSERT or UPDATE
user). The error which I am getting is "[["fieldmissing_email"]]" and my
parameters looks like

{"userid": 0, "password": "test123","user[]":[{"username": "test", "email":"test.test@test.com"}], "options[]": [ {"showAvatar": 1}], "adminoptions[]": [{"canviewmembers":True}], "userfield[]":[{"showavatars": 1}], "notificationOptions[]": [], "hvinput[]": [], "extra[]": [] }

I am not familiar with php so can anyone help me how to pass parameters to API's to get this task done. One example will do.

Also, when I try to update title in node table from mysql, it is not reflected on forum. I have updated title,htmltitle, description in node table and also rawtext in text table but still no success.
Reply With Quote
  #2  
Old 06 Aug 2016, 14:43
Replicant's Avatar
Replicant Replicant is offline
 
Join Date: Sep 2014
Real name: Mel
Originally Posted by iref2010 View Post
Hi Guys,

I am writing to create new topic and user from python script. I am able to get the user and topic info using API's but I am facing issue with POST API namely "user.save"(INSERT or UPDATE
user). The error which I am getting is "[["fieldmissing_email"]]" and my
parameters looks like

{"userid": 0, "password": "test123","user[]":[{"username": "test", "email":"test.test@test.com"}], "options[]": [ {"showAvatar": 1}], "adminoptions[]": [{"canviewmembers":True}], "userfield[]":[{"showavatars": 1}], "notificationOptions[]": [], "hvinput[]": [], "extra[]": [] }

I am not familiar with php so can anyone help me how to pass parameters to API's to get this task done. One example will do.
This is odd. It's usually the hvinput that gives people problems. Try removing the period between test.test and see if that is causing an issue. It could be the email is failing the regex test as a valid email.
EDIT:I ran your JSON through a validator and it failed. "canviewmembers":True should probably be "canviewmembers": 1. I didn't test it but invalid JSON will cause errors.

Originally Posted by iref2010 View Post
Also, when I try to update title in node table from mysql, it is not reflected on forum. I have updated title,htmltitle, description in node table and also rawtext in text table but still no success.
Changing title and htmltitle should do the trick. Try clearing the system cache after you change the titles. Also, you need to empty your browser cache in some instances to see the changes.
__________________
VB5 mods - RepliClock VB4 mods - Member Online Status

Last edited by Replicant; 07 Aug 2016 at 03:51.
Reply With Quote
  #3  
Old 08 Aug 2016, 12:12
iref2010 iref2010 is offline
 
Join Date: Jun 2010
Thanks Mel

It worked!
Reply With Quote
  #4  
Old 08 Aug 2016, 13:58
Paul M's Avatar
Paul M Paul M is offline
 
Join Date: Sep 2004
Real name: Paul M
Could you be a little more specific on what worked
__________________

Cable Forum
Please do not PM me about custom work - I no longer undertake any.
Note: I will not answer support questions via e-mail or PM - please use the relevant thread or forum.
Reply With Quote
  #5  
Old 08 Aug 2016, 18:41
noypiscripter's Avatar
noypiscripter noypiscripter is offline
 
Join Date: Aug 2013
If removing the dot in the email address worked then there is a problem with email validation in vB as dots in email is valid.
__________________
Glenn Vergara - Former vB Developer
Looking for vB mods? Even for vBCloud?
vB Mods That Rock!

Reply With Quote
  #6  
Old 08 Aug 2016, 20:17
Replicant's Avatar
Replicant Replicant is offline
 
Join Date: Sep 2014
Real name: Mel
I think it was the invalid JSON. I guess we'll never know unless the OP comes back and tells us what worked. I don't think there's anything wrong with the email validation.
__________________
VB5 mods - RepliClock VB4 mods - Member Online Status
Reply With Quote
Reply


Tags
api extension, python, user, vb5


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


New To Site? Need Help?

All times are GMT. The time now is 02:21.

Layout Options | Width: Wide Color: