# Search notification logs POST https://api-sandbox.payabli.com/api/v2/notificationlogs Content-Type: application/json Search notification logs with filtering and pagination. - Start date and end date cannot be more than 30 days apart - Either `orgId` or `paypointId` must be provided This endpoint requires the `notifications_create` OR `notifications_read` permission. Reference: https://docs.payabli.com/developers/api-reference/notification-logs/search-notification-logs-with-filtering-and-pagination ## OpenAPI Specification ```yaml openapi: 3.1.1 info: title: Search Notification Logs version: endpoint_notificationlogs.searchNotificationLogs paths: /v2/notificationlogs: post: operationId: search-notification-logs summary: Search Notification Logs description: >- Search notification logs with filtering and pagination. - Start date and end date cannot be more than 30 days apart - Either `orgId` or `paypointId` must be provided This endpoint requires the `notifications_create` OR `notifications_read` permission. tags: - - subpackage_notificationlogs parameters: - name: PageSize in: query required: false schema: $ref: '#/components/schemas/type_:Pagesize' - name: Page in: query description: The page number to retrieve. Defaults to 1 if not provided. required: false schema: type: integer - name: requestToken in: header required: true schema: type: string responses: '200': description: Response with status 200 content: application/json: schema: type: array items: $ref: '#/components/schemas/type_notificationlogs:NotificationLog' '400': description: Bad request/ invalid data content: {} '401': description: Unauthorized request. content: {} '500': description: Internal API Error content: {} '503': description: Database connection error content: {} requestBody: content: application/json: schema: $ref: >- #/components/schemas/type_notificationlogs:NotificationLogSearchRequest components: schemas: type_:Pagesize: type: integer type_notificationlogs:NotificationLogSearchRequest: type: object properties: startDate: type: string format: date-time description: The start date for the search. endDate: type: string format: date-time description: The end date for the search. notificationEvent: type: string description: The type of notification event to filter by. succeeded: type: boolean description: Indicates whether the notification was successful. orgId: type: integer format: int64 description: The ID of the organization to filter by. paypointId: type: integer format: int64 description: The ID of the paypoint to filter by. required: - startDate - endDate type_notificationlogs:NotificationLog: type: object properties: id: type: string format: uuid description: The unique identifier for the notification. orgId: type: - integer - 'null' format: int64 description: The ID of the organization that the notification belongs to. paypointId: type: - integer - 'null' format: int64 description: The ID of the paypoint that the notification is related to. notificationEvent: type: - string - 'null' description: The event that triggered the notification. target: type: - string - 'null' description: The target URL for the notification. responseStatus: type: - string - 'null' description: The HTTP response status of the notification. success: type: boolean description: Indicates whether the notification was successful. jobData: type: - string - 'null' description: Contains the body of the notification. createdDate: type: string format: date-time description: The date and time when the notification was created. successDate: type: - string - 'null' format: date-time description: The date and time when the notification was successfully delivered. lastFailedDate: type: - string - 'null' format: date-time description: The date and time when the notification last failed. isInProgress: type: boolean description: Indicates whether the notification is currently in progress. required: - id - orgId - paypointId - notificationEvent - target - responseStatus - success - jobData - createdDate - successDate - lastFailedDate - isInProgress ``` ## SDK Code Examples ```python import datetime from payabli import payabli client = payabli( api_key="YOUR_API_KEY", ) client.notificationlogs.search_notification_logs( page_size=20, start_date=datetime.datetime.fromisoformat( "2024-01-01 00:00:00+00:00", ), end_date=datetime.datetime.fromisoformat( "2024-01-31 23:59:59+00:00", ), org_id=12345, notification_event="ActivatedMerchant", succeeded=True, ) ``` ```typescript import { PayabliClient } from "@payabli/sdk-node"; const client = new PayabliClient({ apiKey: "YOUR_API_KEY" }); await client.notificationlogs.searchNotificationLogs({ PageSize: 20, body: { startDate: "2024-01-01T00:00:00Z", endDate: "2024-01-31T23:59:59Z", orgId: 12345, notificationEvent: "ActivatedMerchant", succeeded: true } }); ``` ```go import ( context "context" option "github.com/payabli/sdk-go/option" sdkgo "github.com/payabli/sdk-go" sdkgoclient "github.com/payabli/sdk-go/client" ) client := sdkgoclient.NewClient( option.WithApiKey( "", ), ) response, err := client.Notificationlogs.SearchNotificationLogs( context.TODO(), &sdkgo.SearchNotificationLogsRequest{ PageSize: sdkgo.Int( 20, ), Body: &sdkgo.NotificationLogSearchRequest{ StartDate: sdkgo.MustParseDateTime( "2024-01-01T00:00:00Z", ), EndDate: sdkgo.MustParseDateTime( "2024-01-31T23:59:59Z", ), OrgId: sdkgo.Int64( 12345, ), NotificationEvent: sdkgo.String( "ActivatedMerchant", ), Succeeded: sdkgo.Bool( true, ), }, }, ) ``` ```csharp using PayabliApi; var client = new PayabliApiClient("API_KEY"); await client.Notificationlogs.SearchNotificationLogsAsync( new SearchNotificationLogsRequest { PageSize = 20, Body = new NotificationLogSearchRequest { StartDate = new DateTime(2024, 01, 01, 00, 00, 00, 000), EndDate = new DateTime(2024, 01, 31, 23, 59, 59, 000), OrgId = 12345, NotificationEvent = "ActivatedMerchant", Succeeded = true, }, } ); ``` ```ruby require 'uri' require 'net/http' url = URI("https://api-sandbox.payabli.com/api/v2/notificationlogs?PageSize=20") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Post.new(url) request["requestToken"] = '' request["Content-Type"] = 'application/json' request.body = "{\n \"startDate\": \"2024-01-01T00:00:00Z\",\n \"endDate\": \"2024-01-31T23:59:59Z\",\n \"notificationEvent\": \"ActivatedMerchant\",\n \"succeeded\": true,\n \"orgId\": 12345\n}" response = http.request(request) puts response.read_body ``` ```java HttpResponse response = Unirest.post("https://api-sandbox.payabli.com/api/v2/notificationlogs?PageSize=20") .header("requestToken", "") .header("Content-Type", "application/json") .body("{\n \"startDate\": \"2024-01-01T00:00:00Z\",\n \"endDate\": \"2024-01-31T23:59:59Z\",\n \"notificationEvent\": \"ActivatedMerchant\",\n \"succeeded\": true,\n \"orgId\": 12345\n}") .asString(); ``` ```php request('POST', 'https://api-sandbox.payabli.com/api/v2/notificationlogs?PageSize=20', [ 'body' => '{ "startDate": "2024-01-01T00:00:00Z", "endDate": "2024-01-31T23:59:59Z", "notificationEvent": "ActivatedMerchant", "succeeded": true, "orgId": 12345 }', 'headers' => [ 'Content-Type' => 'application/json', 'requestToken' => '', ], ]); echo $response->getBody(); ``` ```swift import Foundation let headers = [ "requestToken": "", "Content-Type": "application/json" ] let parameters = [ "startDate": "2024-01-01T00:00:00Z", "endDate": "2024-01-31T23:59:59Z", "notificationEvent": "ActivatedMerchant", "succeeded": true, "orgId": 12345 ] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api-sandbox.payabli.com/api/v2/notificationlogs?PageSize=20")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "POST" request.allHTTPHeaderFields = headers request.httpBody = postData as Data 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() ```