Forum Moderators: open

Message Too Old, No Replies

http request help

         

jackvull

10:58 am on Mar 31, 2006 (gmt 0)

10+ Year Member



I have received the following from a company; any ideas on how I go about implementing it?
I guess I have to use javascript for this but how do you call a function via an http request?

With the content supply interface customers can retrieve content from the system directly.
The returned values must be inserted in the function call.
The content supply is approached just like a normal XML API via an http request.

The function to be accessed is called “externalContent“.

Call parameters:
[sessionid; corresponding sessionid] Either the affiliateid or the sessionid must be stated. The session must be stated if a purchase was initiated via the shopping cart.
[affiliateid; corresponding affiliateid]
buyidsCompiled list of returned buyids via “_“
payidpayid of the external payment call returned by the system
test mode“true“ or “false“
checkThis is the md5 sum of the character string, which was compiled by all call parameter values (in the above mentioned order). This md5 sum was then encoded with the previously agreed code word XOR-. This encoded value must be encoded in base64.
errorurl*

*: errorurl is the URL, which the end consumer is directed to via redirect in the event of a faulty download. The call of this URL is complemented by the parameters
“errormsg“ und “errorcode“ from the system.

Return:
link0 ... linkNThe corresponding link to the content quotes either “album“ or “track“ in the “targettype“ attribute. The “targetid“ attribute contains the corresponding id of the content.

msgTextual representation of the result

In the event of an error (e.g. wrong “amount“ or “check“) both return values are –1.

DrDoc

5:57 pm on Apr 1, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You should probably use PHP/Perl/ASP for this.

jackvull

5:17 pm on Apr 2, 2006 (gmt 0)

10+ Year Member



I was going to program it in PHP but isn't the xml http request done with javascript?

"The content supply is approached just like a normal XML API via an http request. "

DrDoc

6:50 pm on Apr 2, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It can be ... But surely leaving it 100% up to PHP is the far more efficient way of doing it. Especially considering the possibility that your users may have JavaScript disabled. Not to mention the increased security if using PHP instead.

jackvull

8:35 am on Apr 3, 2006 (gmt 0)

10+ Year Member



is this in PHP 5 only?

So how do you actually access an external function through an http request in PHP? That's the main thing I can't find...

DrDoc

4:56 pm on Apr 3, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



What do you mean by "external function"?

jackvull

5:38 pm on Apr 3, 2006 (gmt 0)

10+ Year Member



I assume it is a function on the other server that processes some variables and then sends an XML reply:

"The content supply is approached just like a normal XML API via an http request.

The function to be accessed is called "ExternalContent" "