# Register Push Subscription POST https://photos.conventionphotography.com/api/push/subscribe ## Register Push Subscription Registers a push notification subscription for order updates. ### Endpoint `POST https://convention.photos/api/push/subscribe` ### Description Stores the push subscription details to enable sending notifications for order status changes. ### Request Body Push subscription object from the browser Push API. ### Response Confirmation of subscription registration. ### Use Cases - Receive notifications when orders are processed - Get updates on shipping status ### Authentication No authentication required. Reference: https://docs.convention.photos/api-reference/cps-api/convention-photos/register-push-subscription ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: Convention Photography System (CPS) version: 1.0.0 paths: /api/push/subscribe: post: operationId: register-push-subscription summary: Register Push Subscription description: >- ## Register Push Subscription Registers a push notification subscription for order updates. ### Endpoint `POST https://convention.photos/api/push/subscribe` ### Description Stores the push subscription details to enable sending notifications for order status changes. ### Request Body Push subscription object from the browser Push API. ### Response Confirmation of subscription registration. ### Use Cases - Receive notifications when orders are processed - Get updates on shipping status ### Authentication No authentication required. tags: - subpackage_conventionPhotos responses: '200': description: Push subscription registered content: application/json: schema: $ref: >- #/components/schemas/convention.photos_registerPushSubscription_Response_200 servers: - url: https://photos.conventionphotography.com - url: https://convention.photos components: schemas: convention.photos_registerPushSubscription_Response_200: type: object properties: {} description: Empty response body title: convention.photos_registerPushSubscription_Response_200 ``` ## SDK Code Examples ```python import requests url = "https://photos.conventionphotography.com/api/push/subscribe" response = requests.post(url) print(response.json()) ``` ```javascript const url = 'https://photos.conventionphotography.com/api/push/subscribe'; const options = {method: 'POST'}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://photos.conventionphotography.com/api/push/subscribe" req, _ := http.NewRequest("POST", url, nil) res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby require 'uri' require 'net/http' url = URI("https://photos.conventionphotography.com/api/push/subscribe") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) response = http.request(request) puts response.read_body ``` ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.post("https://photos.conventionphotography.com/api/push/subscribe") .asString(); ``` ```php request('POST', 'https://photos.conventionphotography.com/api/push/subscribe'); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://photos.conventionphotography.com/api/push/subscribe"); var request = new RestRequest(Method.POST); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let request = NSMutableURLRequest(url: NSURL(string: "https://photos.conventionphotography.com/api/push/subscribe")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "POST" let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ```