### Initialize ShowClix REST API Server Source: https://github.com/showclix/showclixclientphp/blob/master/examples.markdown Initializes the ShowClix REST API server client. This code segment is a prerequisite for all other examples. It requires the 'rest.php' file and configures the server connection with protocol, client certificate, and client key paths. ```php "https", "clientcert" => , "clientkey" => )); ?> ``` -------------------------------- ### Seller Resource with Hyperlinked Events Example Source: https://github.com/showclix/showclixclientphp/blob/master/README.markdown An example of a Seller resource representation. It demonstrates hyperlinking by including a URI for the 'events' attribute, which points to a related resource. ```json { "seller_id": "6", "first_name": "Joe", "organization": "Showclix", "last_name": "Schmoe", "events": "https:\/\/api.showclix.com\/rest.api\/Seller\/6\/events" } ``` -------------------------------- ### Get Event Options using HTTP OPTIONS Source: https://github.com/showclix/showclixclientphp/blob/master/examples.markdown Fetches the available HTTP methods and other options for a specific event instance using the HTTP OPTIONS request method. It configures cURL to return headers and use SSL certificates for authentication. ```php clientcert); curl_setopt($ch, CURLOPT_SSLKEY, $server->clientkey); //$output holds the the JSON result $output = curl_exec($ch); var_dump($output); //Will be similar to: /* HTTP/1.1 200 OK Date: Thu, 24 Sep 2009 15:52:24 GMT Server: Apache/2.0.63 (Unix) mod_ssl/2.0.63 OpenSSL/0.9.8e-fips-rhel5 DAV/2 mod_bwlimited/1.4 PHP/5.2.8 X-Powered-By: PHP/5.2.8 ETag: dcca48101505dd86b703689a604fe3c4 Allow: GET,PUT,DELETE Content-Length: 0 Content-Type: text/plain */ curl_close($ch); ?> ``` -------------------------------- ### POST /Seller Source: https://github.com/showclix/showclixclientphp/blob/master/examples.markdown Creates a new seller resource in the system. ```APIDOC ## POST /Seller ### Description Adds a new seller record to the ShowClix system by submitting seller details in the request body. ### Method POST ### Endpoint `/Seller` ### Parameters #### Request Body - **first_name** (string) - Required - The first name of the seller. - **last_name** (string) - Required - The last name of the seller. - **organization** (string) - Optional - The organization the seller belongs to. - **phone** (string) - Required - The contact phone number for the seller. - **email** (string) - Required - The contact email address for the seller. ### Request Example ```php "https", "clientcert" => , "clientkey" => )); $new_seller = $server->create_resource('Seller', array("first_name" => "Nathan", "last_name" => "Good", "organization" => "ShowClix", "phone" => "5555555555", "email" => "noreply@showclix.com")); var_dump($new_seller); ?> ``` ### Response #### Success Response (201 Created) - **(Object)** - The newly created seller resource, typically including its unique ID and details. #### Response Example ```json { "seller_id": "101", "first_name": "Nathan", "last_name": "Good", "organization": "ShowClix", "email": "noreply@showclix.com", "phone": "5555555555", "uri": "/v1/sellers/101" } ``` ``` -------------------------------- ### Get Seller Information via Indirect URI Source: https://github.com/showclix/showclixclientphp/blob/master/examples.markdown Retrieves seller information indirectly through a related resource, such as an event. This example demonstrates fetching seller details using a direct URI that specifies the event and then the seller relationship. ```php get_resource('https://www.showclix.com/rest.api/Event/4044/seller'); var_dump($output); ?> ``` -------------------------------- ### GET /Seller/{id} Source: https://github.com/showclix/showclixclientphp/blob/master/examples.markdown Retrieves information for a specific seller by their ID. ```APIDOC ## GET /Seller/{id} ### Description Retrieves detailed information for a specific seller using their unique identifier. ### Method GET ### Endpoint `/Seller/{id}` ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the seller. ### Request Example ```php "https", "clientcert" => , "clientkey" => )); $output = $server->get_resource(array("entity" => "Seller", "id" => "1")); var_dump($output); ?> ``` ### Response #### Success Response (200) - **(Object)** - Seller details including name, contact information, etc. #### Response Example ```json { "seller_id": "1", "first_name": "John", "last_name": "Doe", "organization": "Example Org", "email": "john.doe@example.com", "phone": "123-456-7890", "events_uri": "/v1/sellers/1/events" } ``` ``` -------------------------------- ### Verify Seller Deletion using cURL Source: https://github.com/showclix/showclixclientphp/blob/master/examples.markdown Verifies that a seller resource has been deleted by attempting to retrieve it. This example uses cURL to make a request to the seller's URI, expecting a 404 Not Found response. It configures cURL for secure connections and header retrieval. ```php clientcert); curl_setopt($ch, CURLOPT_SSLKEY, $server->clientkey); //$output holds the the JSON result $output = curl_exec($ch); var_dump($output); curl_close($ch); ?> ``` -------------------------------- ### GET /Seller/{id} (After Deletion) Source: https://github.com/showclix/showclixclientphp/blob/master/examples.markdown Attempts to retrieve a seller resource after it has been deleted to verify deletion. ```APIDOC ## GET /Seller/{id} (After Deletion) ### Description This example demonstrates attempting to fetch a seller resource after it has been deleted to confirm the deletion was successful, expecting a 404 Not Found error. ### Method GET ### Endpoint `/Seller/{id}` ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the seller that was deleted. ### Request Example ```php "https", "clientcert" => , "clientkey" => )); // Assuming $new_seller holds the URI of the deleted seller $ch = curl_init($new_seller); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_HEADER, 1); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2); curl_setopt($ch, CURLOPT_SSLCERTTYPE, 'PEM'); curl_setopt($ch, CURLOPT_SSLKEYTYPE, 'PEM'); curl_setopt($ch, CURLOPT_SSLCERT, $server->clientcert); curl_setopt($ch, CURLOPT_SSLKEY, $server->clientkey); $output = curl_exec($ch); var_dump($output); curl_close($ch); ?> ``` ### Response #### Error Response (404 Not Found) - Indicates that the requested seller resource could not be found, confirming its deletion. #### Response Example ```text HTTP/1.1 404 Not Found Content-Type: text/javascript { "error": { "code": 404, "message": "Resource not found." } } ``` ``` -------------------------------- ### OPTIONS /Event/{id}/ Source: https://github.com/showclix/showclixclientphp/blob/master/examples.markdown Retrieves the available HTTP methods and other communication options for a specific event instance. ```APIDOC ## OPTIONS /Event/{id}/ ### Description Fetches the available communication options, such as supported HTTP methods (GET, PUT, DELETE), for a given event resource. ### Method OPTIONS ### Endpoint `/Event/{id}/` ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the event. ### Request Example ```php "https", "clientcert" => , "clientkey" => )); $ch = curl_init('https://www.showclix.com/rest.api/Event/4044/'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_HEADER, 1); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'OPTIONS'); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2); curl_setopt($ch, CURLOPT_SSLCERTTYPE, 'PEM'); curl_setopt($ch, CURLOPT_SSLKEYTYPE, 'PEM'); curl_setopt($ch, CURLOPT_SSLCERT, $server->clientcert); curl_setopt($ch, CURLOPT_SSLKEY, $server->clientkey); $output = curl_exec($ch); var_dump($output); curl_close($ch); ?> ``` ### Response #### Success Response (200 OK) - **Allow** (string) - Comma-separated list of allowed HTTP methods (e.g., GET,PUT,DELETE). - **ETag** (string) - An ETag value for caching purposes. #### Response Example ```text HTTP/1.1 200 OK Date: Thu, 24 Sep 2009 15:52:24 GMT Server: Apache/2.0.63 (Unix) mod_ssl/2.0.63 OpenSSL/0.9.8e-fips-rhel5 DAV/2 mod_bwlimited/1.4 PHP/5.2.8 X-Powered-By: PHP/5.2.8 ETag: dcca48101505dd86b703689a604fe3c4 Allow: GET,PUT,DELETE Content-Length: 0 Content-Type: text/plain ``` ``` -------------------------------- ### Get Seller Information by ID Source: https://github.com/showclix/showclixclientphp/blob/master/examples.markdown Retrieves information for a specific seller using their ID. This function is part of the ShowClix PHP client library and outputs the seller's details using var_dump. ```php get_resource(array("entity" => "Seller", "id" => "1")); var_dump($output); ?> ``` -------------------------------- ### API Token Response Example Source: https://github.com/showclix/showclixclientphp/blob/master/README.markdown The expected JSON response after a successful API token generation request. It contains the authentication token, user ID, seller ID, and user information. ```json { "token": "", "user_id": "", "seller_id": "", "name": { "first": "", "last": "" }, "org": "", "avatar": "", "locale": "en_US" } ``` -------------------------------- ### API Error Response Example Source: https://github.com/showclix/showclixclientphp/blob/master/README.markdown This is an example of a JSON error response from the API, providing status, response details, and specific error messages. It's typically returned for invalid client requests. ```json { "status": "400", "response": "HTTP/1.1 400 Bad Request", "details": "Phone is required, Email is required" } ``` -------------------------------- ### ShowClix API Authentication and Server Initialization (PHP) Source: https://context7.com/showclix/showclixclientphp/llms.txt Initializes the ShowClix API Server object and demonstrates token-based authentication. It includes examples for both a deprecated SSL certificate method and the recommended token exchange process using cURL. This sets up the connection for subsequent API interactions. ```php "https", "base_url" => "api.showclix.com", "clientcert" => "/path/to/your/certificate.crt", "clientkey" => "/path/to/your/private.key", "verifypeer" => false, "is_sandbox" => false )); // Modern token-based authentication (recommended) // First, obtain an API token via the token exchange $ch = curl_init('https://admin.showclix.com/api/registration'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query(array( 'email' => 'api@example.com', 'password' => 'opensesame' ))); $response = curl_exec($ch); curl_close($ch); $auth_data = json_decode($response, true); // Result: {"token":"","user_id":"","seller_id":"","name":{"first":"","last":""},"org":"","avatar":"","locale":"en_US"} // Use the token in subsequent API requests $token = $auth_data['token']; ?> ``` -------------------------------- ### Add a New Seller Source: https://github.com/showclix/showclixclientphp/blob/master/examples.markdown Creates a new seller resource in the ShowClix system. This function takes the entity name ('Seller') and an associative array of seller details as input. The result, including the new seller's URI, is outputted. ```php create_resource('Seller', array("first_name" => "Nathan", "last_name" => "Good", "organization" => "ShowClix", "phone" => "5555555555", "email" => "noreply@showclix.com")); var_dump($new_seller); ?> ``` -------------------------------- ### Discover Allowed Methods with OPTIONS Request (cURL) Source: https://github.com/showclix/showclixclientphp/blob/master/README.markdown Demonstrates how to use the HTTP OPTIONS request to determine which HTTP methods are permitted for a given resource. The response includes an 'Allow' header listing the allowed operations (e.g., GET, PUT, DELETE). ```cURL curl -v --header "X-API-Token: " -X OPTIONS http:\/\/api.showclix.com\/Event\/6456 ``` -------------------------------- ### PUT /Seller/{id} or PATCH /Seller/{id} Source: https://github.com/showclix/showclixclientphp/blob/master/examples.markdown Updates an existing seller resource. Supports partial updates. ```APIDOC ## PUT /Seller/{id} or PATCH /Seller/{id} ### Description Modifies an existing seller's information. This endpoint supports both full replacements (PUT) and partial updates (PATCH) of the seller resource. ### Method PUT or PATCH ### Endpoint `/Seller/{id}` ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the seller to update. #### Request Body - **(Object)** - Contains the fields to be updated for the seller. For example: `{"first_name": "Nate"}`. ### Request Example ```php "https", "clientcert" => , "clientkey" => )); // Assuming $new_seller contains the URI or ID of the seller created previously $output = $server->modify_resource($new_seller, array("first_name" => "Nate")); var_dump($output); ?> ``` ### Response #### Success Response (200 OK) - **(Object)** - The updated seller resource, reflecting the changes made. #### Response Example ```json { "seller_id": "101", "first_name": "Nate", "last_name": "Good", "organization": "ShowClix", "email": "noreply@showclix.com", "phone": "5555555555", "uri": "/v1/sellers/101" } ``` ``` -------------------------------- ### API Request with Authentication Token using cURL Source: https://github.com/showclix/showclixclientphp/blob/master/README.markdown An example of how to make an API request using cURL, including the 'X-API-Token' header for authentication. This shows how to pass the generated token to secure endpoints. ```bash curl -v --header "X-API-Token: " https:\/\/api.showclix.com\/Event\/6454 ``` -------------------------------- ### HEAD /Event/{id} Source: https://github.com/showclix/showclixclientphp/blob/master/README.markdown The HEAD request is similar to GET but only returns the HTTP headers, not the resource representation. ```APIDOC ## HEAD /Event/{id} ### Description The HEAD request is almost identical to the GET request, with the exception that it only returns the headers for that HTTP request rather than the headers and representation. ### Method HEAD ### Endpoint /rest.api/Event/{id} ### Parameters #### Path Parameters - **id** (string) - Required - The ID of the event to retrieve headers for. ### Request Example (No request body for HEAD) ### Response #### Success Response (200) - **Content-Length**: The size of the response body (usually 0 for HEAD). - **Content-Type**: The MIME type of the resource. - Other standard HTTP headers. #### Response Example (Response contains only headers, no body content) ``` -------------------------------- ### Update Seller Information (Partial Update) Source: https://github.com/showclix/showclixclientphp/blob/master/examples.markdown Modifies an existing seller resource, supporting partial updates. It takes the seller's resource URI and an associative array of fields to update. The output shows the result of the modification. ```php modify_resource($new_seller, array("first_name" => "Nate")); var_dump($output); ?> ``` -------------------------------- ### Create Venue Resource - PHP and cURL Source: https://context7.com/showclix/showclixclientphp/llms.txt This snippet shows how to create a new venue entity to host events using the ShowClix API. It includes examples using both a direct PHP client and cURL, demonstrating the necessary parameters for venue creation. ```php create_resource("Venue", array( "venue_name" => "Test Venue", "capacity" => "999", "description" => "Downtown music venue", "address" => "123 Sesame St.", "city" => "Pittsburgh", "state" => "PA", "zip" => "15201", "country" => "USA" )); $venue = $server->get_resource($venue_uri); $venue_id = $server->extract_from_uri($venue_uri)[1]; echo $venue_id; // Outputs: numeric venue ID // Using curl $venue_data = json_encode(array( "venue_name" => "Test Venue", "capacity" => "999", "address" => "123 Sesame St.", "city" => "Pittsburgh", "state" => "PA", "zip" => "15201" )); $ch = curl_init('https://api.showclix.com/Venue'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $venue_data); curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'X-API-Token: ' . $token, 'Content-Type: text/javascript', 'Expect:' )); curl_setopt($ch, CURLOPT_HEADER, 1); $response = curl_exec($ch); curl_close($ch); ?> ``` -------------------------------- ### Generate Private Key using OpenSSL Source: https://github.com/showclix/showclixclientphp/blob/master/client_certificates.markdown This command generates a private RSA key file named 'showclix_api.key'. This key is essential for creating a certificate signing request and should be kept secure. ```bash openssl genrsa -out showclix_api.key ``` -------------------------------- ### Fetch Event Information using cURL Source: https://github.com/showclix/showclixclientphp/blob/master/README.markdown This snippet demonstrates how to retrieve detailed information about a specific event using a GET request with cURL. It requires an API token for authentication and targets a specific event resource URI. The response is typically in JSON format. ```shell curl -v --header "X-API-Token: " https://api.showclix.com/Event/6454 ``` -------------------------------- ### Delete a Seller Resource Source: https://github.com/showclix/showclixclientphp/blob/master/examples.markdown Removes a seller resource from the ShowClix system using their resource URI. The function `delete_resource` is used for this operation, and the output indicates the success or failure of the deletion. ```php delete_resource($new_seller); var_dump($output); ?> ``` -------------------------------- ### Retrieve Headers Only with HEAD Request (cURL) Source: https://github.com/showclix/showclixclientphp/blob/master/README.markdown Shows how to perform an HTTP HEAD request, which is similar to GET but only retrieves the headers of the response, not the actual resource representation. This is useful for checking resource metadata without downloading the full content. ```cURL curl -v --header "X-API-Token: " -X HEAD https:\/\/api.showclix.com\/Event\/6456 ``` -------------------------------- ### Check HTTP Options using cURL and PHP Source: https://context7.com/showclix/showclixclientphp/llms.txt This code snippet demonstrates how to determine the available HTTP methods (e.g., GET, PUT, DELETE) for a specific ShowClix API resource using an OPTIONS request via cURL. It sends an OPTIONS request to a given event endpoint and then parses the response headers to extract and display the allowed methods. ```php ``` -------------------------------- ### ShowClix API Resource Retrieval - Event Information (PHP & cURL) Source: https://context7.com/showclix/showclixclientphp/llms.txt Demonstrates how to retrieve event information from the ShowClix API. It shows methods using the ShowClix PHP client's `get_resource` function and direct cURL requests with token authentication. Examples include fetching by ID, URI, and embedding related resources like venue details. ```php get_resource(array("entity" => "Event", "id" => "6454")); var_dump($event); // Output: {"event_id":"6454","event":"Event Title","ages":"0","genre":"Alternative","date_added":"2009-09-19 14:39:00","sales_open":"2009-09-19 14:39:00","event_start":"2009-11-08 18:30:00","event_end":"0000-00-00 00:00:00","price_levels":"https://api.showclix.com/Event/6454/price_levels","venue":"https://api.showclix.com/Event/6454/venue","seller":"https://api.showclix.com/Event/6454/seller"} // Retrieve event by direct URI $event_by_uri = $server->get_resource('https://api.showclix.com/Event/6454'); // Using curl with token authentication $ch = curl_init('https://api.showclix.com/Event/6454'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_HTTPHEADER, array('X-API-Token: ' . $token)); $output = curl_exec($ch); curl_close($ch); $event_data = json_decode($output, true); // GET with follow parameter to embed related resources $ch = curl_init('https://api.showclix.com/Event/6454?follow[]=venue'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_HTTPHEADER, array('X-API-Token: ' . $token)); $output = curl_exec($ch); curl_close($ch); // Output includes venue representation embedded: {"event_id":"6454",...,"venue":{"venue_name":"The REST Venue","capacity":"999","address":"123 Sesame St.","city":"Pittsburgh","state":"PA",...}} ?> ``` -------------------------------- ### API Authentication and Server Initialization Source: https://context7.com/showclix/showclixclientphp/llms.txt Demonstrates how to initialize the ShowClix API server object and authenticate using a token. ```APIDOC ## API Authentication and Server Initialization ### Description Initialize the Server object with authentication credentials to establish connection to the ShowClix API. ### Method N/A (Initialization code) ### Endpoint N/A (Initialization code) ### Parameters #### Request Body * **protocol** (string) - Optional - Specifies the protocol (e.g., 'https'). * **base_url** (string) - Required - The base URL of the ShowClix API. * **clientcert** (string) - Optional - Path to the client certificate file. * **clientkey** (string) - Optional - Path to the client private key file. * **verifypeer** (boolean) - Optional - Whether to verify the peer's SSL certificate. * **is_sandbox** (boolean) - Optional - Whether to use the sandbox environment. ### Request Example ```php "https", "base_url" => "api.showclix.com", "clientcert" => "/path/to/your/certificate.crt", "clientkey" => "/path/to/your/private.key", "verifypeer" => false, "is_sandbox" => false )); // Modern token-based authentication (recommended) // First, obtain an API token via the token exchange $ch = curl_init('https://admin.showclix.com/api/registration'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query(array( 'email' => 'api@example.com', 'password' => 'opensesame' ))); $response = curl_exec($ch); curl_close($ch); $auth_data = json_decode($response, true); // Result: {"token":"","user_id":"","seller_id":"","name":{"first":"","last":""},"org":"","avatar":"","locale":"en_US"} // Use the token in subsequent API requests $token = $auth_data['token']; ?> ``` ### Response N/A (Initialization code) ### Response Example N/A (Initialization code) ``` -------------------------------- ### GET /Event/{id}/seller Source: https://github.com/showclix/showclixclientphp/blob/master/examples.markdown Retrieves the seller associated with a specific event indirectly via the event's URI. ```APIDOC ## GET /Event/{id}/seller ### Description Retrieves the seller information linked to a specific event by navigating through the event's resource URI. ### Method GET ### Endpoint `/Event/{id}/seller` ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the event. ### Request Example ```php "https", "clientcert" => , "clientkey" => )); $output = $server->get_resource('https://www.showclix.com/rest.api/Event/4044/seller'); var_dump($output); ?> ``` ### Response #### Success Response (200) - **(Object)** - Seller details associated with the event. #### Response Example ```json { "seller_id": "5", "first_name": "Jane", "last_name": "Smith", "organization": "Event Planners Inc.", "email": "jane.smith@eventplanners.com", "phone": "987-654-3210", "events_uri": "/v1/sellers/5/events" } ``` ``` -------------------------------- ### Create Resource with POST Request (cURL) Source: https://github.com/showclix/showclixclientphp/blob/master/README.markdown Demonstrates how to create a new resource, such as an event, using an HTTP POST request. The request body should be JSON formatted and sent to the Class URI. A successful creation returns a 201 Created status and a Location header with the new resource's URI. ```cURL curl -v --header "X-API-Token: " -X POST -d '{"seller_id":"678","venue_id":"842","event":"Event Title","description":"event desc","inventory":"600","private_event":"0","price":"18.00","price_label":"General Admission","price_limit":"1","ticket_purchase_timelimit":null,"ticket_purchase_limit":null,"will_call_ticketing":null,"ages":"18","image":"20091252630916.jpg","url":"http:\/\/www.coolevents.com","event_type":"3","ticket_note":null,"genre":"Alternative","status":"5","scheme_id":null,"keywords":null,"sales_open":"2009-09-19 14:39:00","event_start":"2009-11-08 18:30:00","event_end":"0000-00-00 00:00:00","short_name":"","parent":null,"display_image":"1"}' https:\/\/api.showclix.com\/Event ``` -------------------------------- ### GET /Event/{id} Source: https://github.com/showclix/showclixclientphp/blob/master/README.markdown Retrieves detailed information about a specific event using its ID. This is a read-only operation. ```APIDOC ## GET /Event/{id} ### Description Retrieves detailed information about a specific event using its ID. This is a read-only operation. ### Method GET ### Endpoint `/Event/{id}` ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the event. ### Request Example ```json { "example": "(No request body for GET requests)" } ``` ### Response #### Success Response (200) - **event_id** (string) - The unique identifier of the event. - **event** (string) - The title of the event. - **ages** (string) - Age restrictions for the event. - **genre** (string) - The genre of the event. - **date_added** (string) - The date and time the event was added. - **date_edited** (string) - The date and time the event was last edited. - **sales_open** (string) - The date and time sales for the event opened. - **event_start** (string) - The start date and time of the event. - **event_end** (string) - The end date and time of the event. - **price_levels** (string) - URL to access price level information for the event. - **venue** (string) - URL to access venue information for the event. - **seller** (string) - URL to access seller information for the event. #### Response Example ```json { "event_id": "6454", "event": "Event Title", "ages": "0", "genre": "Alternative", "date_added": "2009-09-19 14:39:00", "date_edited": null, "sales_open": "2009-09-19 14:39:00", "event_start": "2009-11-08 18:30:00", "event_end": "0000-00-00 00:00:00", "price_levels": "https:\/\/api.showclix.com\/rest.api\/Event\/6454\/price_levels", "venue": "https:\/\/api.showclix.com\/rest.api\/Event\/6454\/venue", "seller": "https:\/\/api.showclix.com\/rest.api\/Event\/6454\/seller" } ``` ``` -------------------------------- ### DELETE /Seller/{id} Source: https://github.com/showclix/showclixclientphp/blob/master/examples.markdown Deletes a specific seller resource from the system. ```APIDOC ## DELETE /Seller/{id} ### Description Removes a seller resource from the ShowClix system. This action is irreversible. ### Method DELETE ### Endpoint `/Seller/{id}` ### Parameters #### Path Parameters - **id** (string) - Required - The unique identifier of the seller to delete. ### Request Example ```php "https", "clientcert" => , "clientkey" => )); // Assuming $new_seller contains the URI or ID of the seller to delete $output = $server->delete_resource($new_seller); var_dump($output); ?> ``` ### Response #### Success Response (204 No Content) - The request was successful, and the seller has been deleted. No response body is returned. #### Response Example (No content body) ``` -------------------------------- ### Create Event with Price Levels using PHP Source: https://context7.com/showclix/showclixclientphp/llms.txt This snippet demonstrates how to create a complete event, including a seller, venue, and multiple price levels (e.g., General Admission and VIP). It uses the ShowClix API to create resources and retrieve them with embedded relationships. Dependencies include a ShowClix API token and a server object with create_resource and get_resource methods. ```php create_resource("Seller", array( "first_name" => "Silas", "last_name" => "Snider", "phone" => "15555555555", "email" => "noreply@showclix.com" )); $seller_id = $server->extract_from_uri($seller_uri)[1]; $venue_uri = $server->create_resource("Venue", array( "venue_name" => "Test Venue" )); $venue_id = $server->extract_from_uri($venue_uri)[1]; // Create event $event_uri = $server->create_resource('Event', array( "event" => "Rock Concert 2024", "sales_open" => "2024-01-01", "event_start" => "2024-06-15 20:00:00", "event_type" => "3", "status" => "1", "price" => "25.00", "price_label" => "General Admission", "price_limit" => "500", "venue_id" => $venue_id, "seller_id" => $seller_id, "genre" => "Rock", "ages" => "18", "description" => "Amazing rock concert" )); $event_id = $server->extract_from_uri($event_uri)[1]; // Add premium price level $price_level_uri = $server->create_resource("PriceLevel", array( "event_id" => $event_id, "price" => "100.00", "level" => "VIP Admission", "limit" => "50" )); // Retrieve all price levels for the event $all_price_levels = $server->get_resource($event_uri . "/price_levels"); var_dump($all_price_levels); // Get complete event with embedded relationships $ch = curl_init("https://api.showclix.com/Event/{$event_id}?follow[]=venue&follow[]=seller&follow[]=price_levels"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_HTTPHEADER, array('X-API-Token: ' . $token)); $event_complete = json_decode(curl_exec($ch), true); curl_close($ch); ?> ``` -------------------------------- ### GET /api/events/{event_id}/venue Source: https://context7.com/showclix/showclixclientphp/llms.txt Retrieve the venue details for a specific event. ```APIDOC ## Retrieve Event's Venue ### Description Get the venue information associated with a particular event. ### Method GET ### Endpoint /api/events/{event_id}/venue ### Parameters #### Path Parameters - **event_id** (integer) - Required - The ID of the event whose venue is to be retrieved. ### Request Example ```php // Assuming $token is defined $event_venue = $server->get_resource('https://api.showclix.com/Event/6454/venue'); var_dump($event_venue); ``` ### Response #### Success Response (200 OK) - **venue** (object) - The venue details. #### Response Example ```json { "venue_id": 101, "venue_name": "Test Venue", "address": "123 Main St", "city": "Anytown", "state": "CA", "zip_code": "90210" } ``` ``` -------------------------------- ### GET /api/events/{event_id}/seller Source: https://context7.com/showclix/showclixclientphp/llms.txt Retrieve the seller details for a specific event. ```APIDOC ## Retrieve Event's Seller ### Description Get the seller information associated with a particular event. ### Method GET ### Endpoint /api/events/{event_id}/seller ### Parameters #### Path Parameters - **event_id** (integer) - Required - The ID of the event whose seller is to be retrieved. ### Request Example ```php // Assuming $token is defined $event_seller = $server->get_resource('https://api.showclix.com/Event/6454/seller'); var_dump($event_seller); ``` ### Response #### Success Response (200 OK) - **seller** (object) - The seller details. #### Response Example ```json { "seller_id": 202, "first_name": "Silas", "last_name": "Snider", "phone": "15555555555", "email": "noreply@showclix.com" } ``` ``` -------------------------------- ### GET /api/sellers/{seller_id}/events Source: https://context7.com/showclix/showclixclientphp/llms.txt Retrieve a list of all events associated with a specific seller. ```APIDOC ## Retrieve Seller's Events ### Description Access all events created by a specific seller using their seller ID. ### Method GET ### Endpoint /api/sellers/{seller_id}/events ### Parameters #### Path Parameters - **seller_id** (integer) - Required - The ID of the seller whose events are to be retrieved. ### Request Example ```php // Assuming $token is defined $ch = curl_init('https://api.showclix.com/Seller/6/events'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_HTTPHEADER, array('X-API-Token: ' . $token)); $events_list = json_decode(curl_exec($ch), true); curl_close($ch); foreach ($events_list as $event) { echo "Event: " . $event['event'] . " on " . $event['event_start'] . "\n"; } ``` ### Response #### Success Response (200 OK) - **events** (array) - An array of event objects associated with the seller. #### Response Example ```json [ { "event_id": 12345, "event": "Rock Concert 2024", "event_start": "2024-06-15 20:00:00" }, { "event_id": 12346, "event": "Jazz Festival", "event_start": "2024-07-20 19:00:00" } ] ``` ``` -------------------------------- ### PHP Complete Event Management Workflow with ShowClix API Source: https://context7.com/showclix/showclixclientphp/llms.txt This comprehensive PHP script demonstrates the full lifecycle of managing events through the ShowClix API, including creating sellers, venues, events, and price levels, then retrieving and cleaning them up. It requires the 'rest.php' helper file and assumes a valid SSL certificate path for secure API communication. The output includes IDs and status messages for each step. ```php "https", "clientcert" => '/path/to/cert.crt', "clientkey" => '/path/to/key.key' )); // Step 1: Create seller $seller_uri = $server->create_resource("Seller", array( "first_name" => "John", "last_name" => "Promoter", "phone" => "15555555555", "email" => "john@promoters.com" )); $seller_id = $server->extract_from_uri($seller_uri)[1]; echo "Created Seller ID: {$seller_id}\n"; // Step 2: Update seller with address $server->modify_resource($seller_uri, array( "address1" => "1234 Main St", "city" => "Pittsburgh", "state" => "PA", "zip" => "15201" )); echo "Updated seller address\n"; // Step 3: Create venue $venue_uri = $server->create_resource("Venue", array( "venue_name" => "Downtown Arena", "capacity" => "5000", "address" => "456 Arena Blvd", "city" => "Pittsburgh", "state" => "PA", "zip" => "15220" )); $venue_id = $server->extract_from_uri($venue_uri)[1]; echo "Created Venue ID: {$venue_id}\n"; // Step 4: Create event $event_uri = $server->create_resource('Event', array( "event" => "Summer Music Festival 2024", "sales_open" => "2024-03-01 09:00:00", "event_start" => "2024-07-15 18:00:00", "event_end" => "2024-07-15 23:00:00", "event_type" => "3", "status" => "1", "price" => "45.00", "price_label" => "General Admission", "price_limit" => "3000", "venue_id" => $venue_id, "seller_id" => $seller_id, "genre" => "Music Festival", "ages" => "21", "description" => "Annual summer music festival" )); $event_id = $server->extract_from_uri($event_uri)[1]; echo "Created Event ID: {$event_id}\n"; // Step 5: Add VIP price level $price_level_uri = $server->create_resource("PriceLevel", array( "event_id" => $event_id, "price" => "150.00", "level" => "VIP Pass", "limit" => "200" )); echo "Added VIP price level\n"; // Step 6: Retrieve complete event info $event_details = $server->get_resource($event_uri); echo "Event: " . $event_details->event . "\n"; echo "Start: " . $event_details->event_start . "\n"; // Step 7: Get all price levels $price_levels = $server->get_resource($event_uri . "/price_levels"); echo "Total price levels: " . count($price_levels) . "\n"; // Step 8: Check tickets remaining $tickets_remaining = $server->get_resource($event_uri . "/tickets_remaining"); echo "Tickets available: {$tickets_remaining}\n"; // Cleanup (for testing purposes) $server->delete_resource($price_level_uri); $server->delete_resource($event_uri); $server->delete_resource($venue_uri); $server->delete_resource($seller_uri); echo "Cleaned up all resources\n"; ?> ``` -------------------------------- ### Create New Seller - PHP and cURL Source: https://context7.com/showclix/showclixclientphp/llms.txt Demonstrates creating a new seller entity using the ShowClix API. It shows two methods: one using a direct PHP client library and another using cURL with token authentication. Both methods post JSON data to the Seller class URI. ```php create_resource('Seller', array( "first_name" => "Nathan", "last_name" => "Good", "organization" => "ShowClix", "phone" => "5555555555", "email" => "noreply@showclix.com" )); echo $new_seller_uri; // Returns: https://api.showclix.com/Seller/123 // Using curl with token authentication $seller_data = json_encode(array( "first_name" => "Nathan", "last_name" => "Good", "organization" => "ShowClix", "phone" => "5555555555", "email" => "noreply@showclix.com" )); $ch = curl_init('https://api.showclix.com/Seller'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $seller_data); curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'X-API-Token: ' . $token, 'Content-Type: text/javascript', 'Expect:' )); curl_setopt($ch, CURLOPT_HEADER, 1); $response = curl_exec($ch); curl_close($ch); // Response: HTTP/1.1 201 Created, Location: https://api.showclix.com/Seller/123 // Extract the URI from Location header preg_match('/Location:\s*?([^\s]+)/', $response, $matches); $new_seller_uri = $matches[1]; ?> ```