lib/square/api/bookings_api.rb
# Retrieves a booking.
# To call this endpoint with buyer-level permissions, set
# `APPOINTMENTS_READ` for the OAuth scope.
# To call this endpoint with seller-level permissions, set
# `APPOINTMENTS_ALL_READ` and `APPOINTMENTS_READ` for the OAuth scope.
# @param [String] booking_id Required parameter: The ID of the
# [Booking]($m/Booking) object representing the to-be-retrieved booking.
# @return [RetrieveBookingResponse Hash] response from the API call
Retrieves a booking.
To call this endpoint with buyer-level permissions, set
`APPOINTMENTS_READ` for the OAuth scope.
To call this endpoint with seller-level permissions, set
`APPOINTMENTS_ALL_READ` and `APPOINTMENTS_READ` for the OAuth scope.
Retrieves a booking . To call this endpoint with buyer - level permissions set ` APPOINTMENTS_READ ` for the OAuth scope . To call this endpoint with seller - level permissions set ` APPOINTMENTS_ALL_READ ` and ` APPOINTMENTS_READ ` for the OAuth scope .
def retrieve_booking(booking_id:)
      _query_builder = config.get_base_uri
      _query_builder << '/v2/bookings/{booking_id}'
      _query_builder = APIHelper.append_url_with_template_parameters(
        _query_builder,
        'booking_id' => { 'value' => booking_id, 'encode' => true }
      )
      _query_url = APIHelper.clean_url _query_builder
      _headers = {
        'accept' => 'application/json'
      }
      _request = config.http_client.get(
        _query_url,
        headers: _headers
      )
      OAuth2.apply(config, _request)
      _response = execute_request(_request)
      decoded = APIHelper.json_deserialize(_response.raw_body)
      _errors = APIHelper.map_response(decoded, ['errors'])
      ApiResponse.new(
        _response, data: decoded, errors: _errors
      )
    end
def retrieve_booking ( booking_id : ) _query_builder = config . get_base_uri _query_builder << '/v2/bookings/{booking_id}' _query_builder = APIHelper . append_url_with_template_parameters ( _query_builder , 'booking_id' => { 'value' => booking_id , 'encode' => true } ) _query_url = APIHelper . clean_url _query_builder _headers = { 'accept' => 'application/json' } _request = config . http_client . get ( _query_url , headers : _headers ) OAuth2 . apply ( config , _request ) _response = execute_request ( _request ) decoded = APIHelper . json_deserialize ( _response . raw_body ) _errors = APIHelper . map_response ( decoded , [ 'errors' ] ) ApiResponse . new ( _response , data : decoded , errors : _errors ) end
Retrieves a booking.
Retrieves a booking .
# Prepare query url. # Prepare headers. # Prepare and execute HttpRequest. # Return appropriate response type.
response from the API call
response from the API call
RetrieveBookingResponse Hash
booking_id
<not_specific>
<not_specific>
booking_id Required parameter: The ID of the [Booking]($m/Booking) object representing the to-be-retrieved booking.
booking_id Required parameter : The ID of the [ Booking ] ( $m / Booking ) object representing the to - be - retrieved booking .