HTTP POST

termi

Client
Регистрация
30.10.2012
Сообщения
67
Благодарностей
2
Баллы
8
I whant to make template to download content via Article builder API and this can be don by HTTP POST i try to use post request function but I'm running around blind. I try to get authenticate using this in field data:
"Action:authenticate
Format:xml
Username:xxxxx
Password:xxxxx"

But this don't work, is this even possible?
Hire you have api explanations from members part of site:

Код:
The API url is: 

http://articlebuilder.net/api.php 

 To access the API, you perform an HTTP POST to the above url. 

For a complete API example using a PHP script, [URL="http://articlebuilder.net/apiexample.txt"]click this link[/URL].

authenticate 

 Before performing any other API queries, you first need to get a session identifier from the API. To do that, you pass your username and password to the API. Your POST should contain the following variables and values: 
Variable	Value
action	authenticate
format	(output format, either "php" or "xml" -- no quotes)
username	(your login email address)
password	(your password)

 If you chose "php" as the format, the POST will return a serialized array, which you can use the PHP function unserialize() to convert into a normal PHP associative array. Otherwise an XML string will be returned. That array/XML will contain the following string values if successful: 
Variable	Value
success	true
session	(a unique session id -- you need to save this)

 The session id must be passed for every call to the API. 

 (Any time an API call fails, the success value will be set to "false" with the reason for the failure contained in the "error" value.) 

 Once you have a session id, you can then call the other actions below. 

buildArticle 

 Performs the same function as using the Build an Article form. 
Variable	Value
action	buildArticle
format	(output format, either "php" or "xml" -- no quotes)
category	(the category to build an article in)
subtopics	OPTIONAL (the subtopics to include (separated by a new line character--\n in PHP))
wordcount	(the target wordcount (min = 300, max = 1000))
lsireplacement	(set to 1 if you want automatic LSI replacement performed on the article)
superspun	(1 to use Super Spun content, 0 to use unspun content)
spintogether	OPTIONAL (if the value is 1, the number of articles specified in 'count' will be generated and spun together in one big document.)
count	OPTIONAL (the number of documents to create and spin together -- used only if 'spintogether' is set to 1)
customkeys	OPTIONAL (use custom keyword replacement)
customkeyslist	OPTIONAL (list of custom keyword replacements, separated by a line break -- see this forum thread for an explanation)

IMPORTANT NOTE: If you choose to spin multiple articles together, it costs one quota point for each article generated. That is, if you set 'spintogether' as 1 and set a 'count' of 5, it will cost you 5 daily quota points. 

injectContent 

 Performs the same function as using the Inject Content form. 
Variable	Value
action	injectContent
format	(output format, either "php" or "xml" -- no quotes)
article	(the article to inject content into)
category	(the category to build an article in)
keywords	OPTIONAL (to get tips containing specific keywords)
volume	(amount of content to add: 1 = A Lot, 2 = Quit A Bit, 3 = A Little)
style	(1 = Inside The Content, 2 = As Sidebar "Tips", 3 = Inside and Sidebar, 4 = In-Line Callout, 5 = Inside and Callout)
superspun	(1 to use Super Spun content, 0 to use unspun content -- not yet available for all categories)
sidebarBackgroundColor	OPTIONAL (the HTML background color of the tips sidebar; default is "FFFFCC")
sidebarCaption	OPTIONAL (the caption to use in the sidebar; default is "TIP!")
sidebarCaptionColor	OPTIONAL (the foreground color of the caption; default is "red")
sidebarTipColor	OPTIONAL (the foreground color of the tip text; default is "black")

superSpun 

 Generates an article from a randomly selected super-spun document in the specified category. 
Variable	Value
action	superSpun
format	(output format, either "php" or "xml" -- no quotes)
category	(the category to generate an article for)

getTip 

 Returns one tip from the given category. Very useful as blog post comments or other shorter backlink texts. 
Variable	Value
action	getTip
format	(output format, either "php" or "xml" -- no quotes)
category	(the category to generate an article for)
keywords	OPTIONAL (attempt to return a tip containing the provided keywords)
superspun	(whether to use Super Spun content. 1 = Yes, 0 = No)

categories 
Variable	Value
action	categories

 Returns a list of available topic categories. 
Variable	Value
success	true
output	(the category list--PHP array or XML table)

apiQueries 
Variable	Value
action	apiQueries

 Calling apiQueries will return the following if successful: 
Variable	Value
success	true
output	(the number of queries that have been performed today)

apiMaxQueries 
Variable	Value
action	apiMaxQueries

 Calling apiMaxQueries will return the following if successful: 
Variable	Value
success	true
output	(the number of queries that the authenticated user can make to the API per day)

apiTipQueries 
Variable	Value
action	apiTipQueries

 Calling apiTipQueries will return the following if successful: 
Variable	Value
success	true
output	(the number of getTip queries that have been performed today)

apiMaxTipQueries 
Variable	Value
action	apiMaxTipQueries

 Calling apiMaxTipQueries will return the following if successful: 
Variable	Value
success	true
output	(the number of getTip queries that the authenticated user can make to the API per day)
 

rostonix

Известная личность
Регистрация
23.12.2011
Сообщения
29 067
Благодарностей
5 707
Баллы
113

Вложения

Ethan

Client
Регистрация
02.11.2012
Сообщения
1
Благодарностей
0
Баллы
0
How can I set the Referer for a HTTP POST?
 

Кто просматривает тему: (Всего: 1, Пользователи: 0, Гости: 1)