Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

- API v1 Launch changes

  • Loading branch information...
commit 239040b24d1c25aca2c8cc3e99cb54eb2db961e2 1 parent 33f4643
@d33psky d33psky authored
Showing with 0 additions and 52 deletions.
  1. +0 −52 php-pecl/QuoteModel-oauth1-pecl.php
View
52 php-pecl/QuoteModel-oauth1-pecl.php
@@ -1,52 +0,0 @@
-#!/usr/bin/php
-<?php
-
-require "consumer_key.php";
-require "access_token.php";
-require "api_url_base.php";
-require "error.php";
-$verbose_debug = false;
-
-try {
- $oauth = new Oauth($consumer_key, $consumer_secret, OAUTH_SIG_METHOD_HMACSHA1, OAUTH_AUTH_TYPE_AUTHORIZATION);
- $oauth->enableDebug();
- $oauth->setToken($access_token, $access_secret);
-} catch(OAuthException $E) {
- Error("setup exception", $E->getMessage(), null, null, $E->debugInfo);
-}
-
-try {
- $volume = 1 / (100*100*100); # 1 cm^3 in m^2
- $area = 600 / (1000*1000); # 600 mm^2 (6 cm^2) in m^2
- $xBoundMin = 0;
- $yBoundMin = 0;
- $zBoundMin = 0;
- $xBoundMax = 0.01; # 1 cm in m
- $yBoundMax = 0.01;
- $zBoundMax = 0.01;
- $data = array("volume" => "$volume",
- "area" => $area,
- "xBoundMin" => $xBoundMin,
- "xBoundMax" => $xBoundMax,
- "yBoundMin" => $yBoundMin,
- "yBoundMax" => $yBoundMax,
- "zBoundMin" => $zBoundMin,
- "zBoundMax" => $zBoundMax,
- );
- $data_string = json_encode($data);
-
- $oauth->fetch($api_url_base ."/quote/model/v1", $data_string, OAUTH_HTTP_METHOD_POST);
- $response = $oauth->getLastResponse();
- $json = json_decode($response);
- if (null == $json) {
- PrintJsonLastError();
- var_dump($response);
- } else {
- print_r($json);
- }
-} catch(OAuthException $E) {
- Error("fetch exception", $E->getMessage(), null, $oauth->getLastResponseInfo(), $E->debugInfo);
-}
-
-?>
-
Please sign in to comment.
Something went wrong with that request. Please try again.