コード例 #1
0
 private function handleGetStatus()
 {
     if (!isset($_REQUEST['mmsId'])) {
         return;
     }
     try {
         $mmsId = $_REQUEST['mmsId'];
         $srvc = new MMSService($this->apiFQDN, $this->getFileToken());
         $response = $srvc->getMMSStatus($mmsId);
         $this->results[MMSController::RESULT_GET_STATUS] = $response;
     } catch (Exception $e) {
         $this->errors[MMSController::ERROR_GET_STATUS] = $e->getMessage();
     }
 }
コード例 #2
0
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
session_start();
require_once __DIR__ . '/common.php';
require_once __DIR__ . '/../lib/Util/Util.php';
require_once __DIR__ . '/../lib/MMS/MMSService.php';
use Att\Api\Util\Util;
use Att\Api\MMS\MMSService;
$arr = null;
try {
    envinit();
    $mmsService = new MMSService(getFqdn(), getFileToken());
    $msgId = $_POST['msgId'];
    $response = $mmsService->getMMSStatus($msgId);
    $deliveryInfoList = $response->getDeliveryInfoList();
    $values = array();
    foreach ($deliveryInfoList as $deliveryInfo) {
        $values[] = array($deliveryInfo->getId(), $deliveryInfo->getAddress(), $deliveryInfo->getDeliveryStatus());
    }
    $arr = array('success' => true, 'text' => 'ResourceURL: ' . $response->getResourceUrl(), 'tables' => array(array('caption' => 'Status:', 'headers' => array('MessageId', 'Address', 'DeliveryStatus'), 'values' => $values)));
} catch (Exception $e) {
    $arr = array('success' => false, 'text' => $e->getMessage());
}
echo json_encode($arr);
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */