Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 01-30-2012, 06:03 PM
PleaseHelp PleaseHelp is offline
 
Join Date: Jan 2012
Posts: 27
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default How to POST a NEW THREAD using the Mobile API ?

Hello,

How do you POST a NEW THREAD using the Mobile API ?

From what we can tell, you need to use the 'api_m' => 'newthread_postthread' method, but what else do we need to include in that parameter list in order for a new thread to be successfully posted?

Potential candidates include (but are not limited to) :
  • 'forumid' =>
  • 'subject' =>
  • 'message' =>
  • 'posthash' =>
  • 'poststarttime' =>

Please help. Thanks.
Reply With Quote
  #2  
Old 01-31-2012, 06:15 PM
PleaseHelp PleaseHelp is offline
 
Join Date: Jan 2012
Posts: 27
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Anyone?

We still haven't been able to get this to work, no matter which combination of parameters we use for 'api_m' => 'newthread_postthread' .

There is absolutely no documentation on this, so it's just a guessing game and we're all out of guesses.

Please help.
Reply With Quote
  #3  
Old 01-31-2012, 06:47 PM
Paul M's Avatar
Paul M Paul M is offline
 
Join Date: Sep 2004
Location: Nottingham, UK
Posts: 23,748
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I think you are missing 'loggedinuser' - Set it to the ID of current logged-in user. Set to 0 if a guest is posting.
Reply With Quote
  #4  
Old 01-31-2012, 07:10 PM
PleaseHelp PleaseHelp is offline
 
Join Date: Jan 2012
Posts: 27
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Paul M View Post
I think you are missing 'loggedinuser' - Set it to the ID of current logged-in user. Set to 0 if a guest is posting.
Thanks for your reply, but it's still not working.

To be clear, here's what we're doing:

First, we're calling newthread_newthread ("returns new thread form related data") as follows:

Code:
array('api_m' => 'newthread_newthread','forumid' => 1, 'loggedinuser' => 1);
Then, we're calling newthread_postthread ("posts new thread") using the posthash and poststarttime provided by newthread_newthread, as follows:

Code:
array('api_m' => 'newthread_postthread', 'forumid' => 1, 'subject' => 'Test SUBJECT from the Mobile API', 'message' => 'Test MESSAGE from the Mobile API', 'posthash' => $postHash, 'poststarttime' => $postStartTime, 'loggedinuser' => 1);
However, instead of posting the thread, we're getting the following return data (notice the "invalid posthash" under [newpost] and the 'nosubject' under the [postpreview] errorlist):

Code:
Array
(
    [response] => Array
        (
            [attachmentoption] => Array
                (
                    [posthash] => d78ce48039f1bcbb9f8a5a11e38607fc
                    [contentid] => 0
                    [poststarttime] => 1328039824
                    [attachuserid] => 1
                    [contenttypeid] => 1
                )

            [disablesmiliesoption] => Array
                (
                    [checked] => Array
                        (
                            [parseurl] => 
                            [disablesmilies] => 
                            [signature] => 
                            [postpoll] => 
                            [receipt] => 
                            [savecopy] => 
                            [stickunstick] => 
                            [openclose] => 
                            [sendanyway] => 
                            [rate] => 
                            [subscribe] => 
                        )

                )

            [emailchecked] => Array
                (
                    [0] => 1
                )

            [explicitchecked] => 
            [foruminfo] => Array
                (
                    [forumid] => 1
                    [title] => Test Forum
                    [description] => 
                    [title_clean] => Test Forum
                    [description_clean] => 
                )

            [forumrules] => Array
                (
                    [bbcodeon] => 
                    [can] => Array
                        (
                            [postnew] => 1
                            [replyown] => 1
                            [replyothers] => 1
                            [reply] => 1
                            [editpost] => 128
                            [postattachment] => 1
                            [attachment] => 1
                        )

                    [htmlcodeon] => 
                    [imgcodeon] => 
                    [smilieson] => 
                )

            [human_verify] => 
            [newpost] => Array
                (
                    [message] => 
                    [title] => 
                    [iconid] => 0
                    [prefixid] => 
                    [taglist] => 
                    [parseurl] => 0
                    [signature] => 0
                    [preview] => 
                    [disablesmilies] => 0
                    [rating] => 0
                    [username] => 
                    [postpoll] => 0
                    [polloptions] => 0
                    [folderid] => 0
                    [humanverify] => Array
                        (
                        )

                    [poststarttime] => 0
                    [posthash] => invalid posthash
                    [stickunstick] => 0
                    [openclose] => 0
                    [podcasturl] => 
                    [podcastsize] => 0
                    [podcastexplicit] => 0
                    [podcastkeywords] => 
                    [podcastsubtitle] => 
                    [podcastauthor] => 
                    [subscribe] => 0
                    [htmlstate] => on_nl2br
                    [emailupdate] => 9999
                    [enablesmilies] => 1
                    [visible] => 1
                )

            [podcastauthor] => 
            [podcastkeywords] => 
            [podcastsize] => 
            [podcastsubtitle] => 
            [podcasturl] => 
            [polloptions] => 0
            [posthash] => d78ce48039f1bcbb9f8a5a11e38607fc
            [posticons] => Array
                (
                    [iconchecked] => 1
                    [posticonbits] => Array
                        (
                            [0] => Array
                                (
                                    [alttext] => Post
                                    [iconchecked] => 
                                    [iconid] => 1
                                    [iconpath] => images/icons/icon1.png
                                )

                            [1] => Array
                                (
                                    [alttext] => Thumbs down
                                    [iconchecked] => 
                                    [iconid] => 13
                                    [iconpath] => images/icons/icon13.png
                                )

                            [2] => Array
                                (
                                    [alttext] => Wink
                                    [iconchecked] => 
                                    [iconid] => 12
                                    [iconpath] => images/icons/icon12.png
                                )

                            [3] => Array
                                (
                                    [alttext] => Red face
                                    [iconchecked] => 
                                    [iconid] => 11
                                    [iconpath] => images/icons/icon11.png
                                )

                            [4] => Array
                                (
                                    [alttext] => Talking
                                    [iconchecked] => 
                                    [iconid] => 10
                                    [iconpath] => images/icons/icon10.png
                                )

                            [5] => Array
                                (
                                    [alttext] => Unhappy
                                    [iconchecked] => 
                                    [iconid] => 9
                                    [iconpath] => images/icons/icon9.png
                                )

                            [6] => Array
                                (
                                    [alttext] => Angry
                                    [iconchecked] => 
                                    [iconid] => 8
                                    [iconpath] => images/icons/icon8.png
                                )

                            [7] => Array
                                (
                                    [alttext] => Smile
                                    [iconchecked] => 
                                    [iconid] => 7
                                    [iconpath] => images/icons/icon7.png
                                )

                            [8] => Array
                                (
                                    [alttext] => Cool
                                    [iconchecked] => 
                                    [iconid] => 6
                                    [iconpath] => images/icons/icon6.png
                                )

                            [9] => Array
                                (
                                    [alttext] => Question
                                    [iconchecked] => 
                                    [iconid] => 5
                                    [iconpath] => images/icons/icon5.png
                                )

                            [10] => Array
                                (
                                    [alttext] => Exclamation
                                    [iconchecked] => 
                                    [iconid] => 4
                                    [iconpath] => images/icons/icon4.png
                                )

                            [11] => Array
                                (
                                    [alttext] => Lightbulb
                                    [iconchecked] => 
                                    [iconid] => 3
                                    [iconpath] => images/icons/icon3.png
                                )

                            [12] => Array
                                (
                                    [alttext] => Arrow
                                    [iconchecked] => 
                                    [iconid] => 2
                                    [iconpath] => images/icons/icon2.png
                                )

                            [13] => Array
                                (
                                    [alttext] => Thumbs up
                                    [iconchecked] => 
                                    [iconid] => 14
                                    [iconpath] => images/icons/icon14.png
                                )

                        )

                    [remainingspan] => 0
                )

            [postpreview] => Array
                (
                    [errorlist] => Array
                        (
                            [0] => Array
                                (
                                    [errormessage] => Array
                                        (
                                            [0] => nosubject
                                        )

                                )

                            [1] => Array
                                (
                                    [errormessage] => Array
                                        (
                                            [0] => tooshort
                                            [1] => 1
                                        )

                                )

                        )

                    [newpost] => 
                    [post] => 
                    [previewmessage] => 
                )

            [poststarttime] => 1328039824
            [prefix_options] => 
            [selectedicon] => Array
                (
                    [src] => clear.gif
                    [alt] => 
                )

            [subject] => 
            [tags_remain] => 25
            [tag_delimiters] => 
        )

    [vboptions] => Array
        (
            [postminchars] => 1
            [titlemaxchars] => 100
            [maxpolloptions] => 0
        )

    [show] => Array
        (
            [tag_option] => 1
            [posticons] => 1
            [smiliebox] => 1
            [attach] => 1
            [openclose] => 1
            [stickunstick] => 1
            [closethread] => 1
            [unstickthread] => 0
            [subscribefolders] => 0
            [parseurl] => 1
            [misc_options] => 1
            [additional_options] => 1
            [poll] => 1
            [podcasturl] => 0
            [tags_remain] => 1
        )

)

Any ideas what we're doing wrong and how to fix it?

Thanks.
Reply With Quote
  #5  
Old 02-01-2012, 02:26 AM
Paul M's Avatar
Paul M Paul M is offline
 
Join Date: Sep 2004
Location: Nottingham, UK
Posts: 23,748
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You can get away with just calling newthread_postthread direct, with only forumid, message & subject.

I believe your issue is that you are sending them as a GET request, you must send them as a POST request.
Reply With Quote
Благодарность от:
PleaseHelp
  #6  
Old 02-02-2012, 07:16 PM
PleaseHelp PleaseHelp is offline
 
Join Date: Jan 2012
Posts: 27
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Paul M View Post
You can get away with just calling newthread_postthread direct, with only forumid, message & subject.

I believe your issue is that you are sending them as a GET request, you must send them as a POST request.
Thank you, Paul.
Reply With Quote
Reply


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


All times are GMT. The time now is 04:56 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04022 seconds
  • Memory Usage 2,237KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (3)bbcode_code
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (6)post_thanks_box
  • (1)post_thanks_box_bit
  • (6)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (6)post_thanks_postbit_info
  • (6)postbit
  • (6)postbit_onlinestatus
  • (6)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete