View Single Post
  #2  
Old 08-22-2016, 03:24 AM
Replicant's Avatar
Replicant Replicant is offline
 
Join Date: Sep 2014
Location: Phoenix, Az. USA
Posts: 485
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Starting a thread and posting to a thread is a simple post operation. Here's a sample JSON string that has the minimum requirements for a post or new thread. The CKEditor uses a multi-part binary postfor uploading pics and what not. A lot more code. Writing to a forum nodeid will return a nodeid for the newly created thread. Writing to a thread nodeid will return a nodeid for the new post in that thread. Writing to a Post nodeid will return the nodeid for the newly created comment. Your json string would by submitted via POST (required) to the /create-content/text url. You can use JS, Jquery, curl, or any other http protocol that is http compliant. I've used the Bash shell in Linux using the POST command.

{ "data":{"title":"Sample Title", "securitytoken":"Valid Security Token", "parentid"="Forum or Thread or Post nodeid"}}

Moving a thread can be accopmlished with a POST to /ajax/api/node/movePosts. Data required is
newtitle="Hello World", to_parent=Forum Nodeid , nodeids[] = 9305 (Array is Required), securitytoken=Valid token.

Editing an existing post will be trickier. The post request for editing pulls a ckeditor template. You can make POST nodeid="post-to-be-edited" to /api/node/getNodeContent (permissions required). That will give you a JSON string with all the info about that nodeid including the bbcode held in the rawtext field. You can import that code into your app for editing then save to create-content/Text/. You will need to get the params from the dev environment while saving a edited post. It'll be multipart binary so You'll have to play with it a bit. It's not too difficult.

Most if not all of the functions can also be done in php but I figure why bother? The VB5 api has all the checks, security, and verification in place already and puts everything where it;'s supposed to be in the database.

Good Luck.
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01204 seconds
  • Memory Usage 1,763KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.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
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • showpost_complete