Overview

Packages

  • LegiScan
    • API
    • Cache
    • Common
    • Exceptions
    • Utility
  • PHP

Classes

  • LegiScan_Bulk
  • LegiScan_Process
  • LegiScan_Pull
  • LegiScan_Push
  • Overview
  • Package
  • Class

Class LegiScan_Push

LegiScan API Push Interface Class

Framework to process and decode incoming payloads as the endpoint listener in a Push API interface.

Package: LegiScan\API
Copyright: 2010-2020 LegiScan LLC
License: https://opensource.org/licenses/BSD-2-Clause
Author: LegiScan API Team api@legiscan.com
See: LegiScan_Endpoint
See: LegiScan_Process
Link: https://api.legiscan.com/dl/
Link: https://legiscan.com/legiscan
Located at LegiScan.php
Methods summary
public
# __construct( )

Class constructor

Class constructor

public boolean
# processPush( )

Processes an incoming LegiScan API JSON payload into an associative array

Processes an incoming LegiScan API JSON payload into an associative array

Returns

boolean
Success of payload processing

Throws

APIException
public mixed[]
# getPayload( )

Returns the decoded payload associative array for the most recently processed record

Returns the decoded payload associative array for the most recently processed record

Returns

mixed[]
The decoded payload array
public string
# getPayloadType( )

Returns the type of payload that was most recently processed

Returns the type of payload that was most recently processed

Returns

string
The type of payload [bill, text, amendment, supplement, roll_call, person, session]
public
# respondOk( array $missing = array() )

Wrapper function around respond() that creates a valid OK response

Wrapper function around respond() that creates a valid OK response

Parameters

$missing
Optional array listing missing objects to request in the response
public
# respondError( string $error_message )

Wrapper function around respond() that creates a valid ERROR response

Wrapper function around respond() that creates a valid ERROR response

Parameters

$error_message
A descriptive user-defined error message to explain the error response
private
# respond( array $response )

Encode and send a valid API response back to LegiScan

Encode and send a valid API response back to LegiScan

Parameters

$response
Contains the push endpoint server response structure
Properties summary
protected array $payload

The decoded payload that was last processed through LegiScan_Push::processPush()

The decoded payload that was last processed through LegiScan_Push::processPush()

#
protected string $payload_type

The type of payload that was last processed through LegiScan_Push::processPush()

The type of payload that was last processed through LegiScan_Push::processPush()

#
protected string $form_var

Form variable name in the case of cooked x-www-form-urlencoded payload

Form variable name in the case of cooked x-www-form-urlencoded payload

#
LegiScan API Client API documentation generated by ApiGen