# Atualizar preços na tabela PATCH https%3A%2F%2Fwww.sitedaempresa.com.br/_functions/@fw2sites/fw2-propaganda-backend/v1/tables/%7Bid%7D/prices Content-Type: application/json Atualiza preços existentes em bulk. Requer `_id` em cada item. Reference: https://api.fw2propaganda.com.br/api-fw-2-propaganda-v-1/tabelas-de-preco/atualizar-preços-na-tabela ## OpenAPI Specification ```yaml openapi: 3.1.0 info: title: collection version: 1.0.0 paths: /_functions/@fw2sites/fw2-propaganda-backend/v1/tables/%7Bid%7D/prices: patch: operationId: atualizar-preços-na-tabela summary: Atualizar preços na tabela description: Atualiza preços existentes em bulk. Requer `_id` em cada item. tags: - subpackage_tabelasDePreco parameters: - name: Authorization in: header required: true schema: type: string responses: '200': description: Successful response content: application/json: schema: $ref: >- #/components/schemas/Tabelas de Preço_Atualizar preços na tabela_Response_200 requestBody: content: application/json: schema: type: object properties: data: type: array items: $ref: >- #/components/schemas/FunctionsFw2SitesFw2PropagandaBackendV1Tables7Bid7DPricesPatchRequestBodyContentApplicationJsonSchemaDataItems required: - data servers: - url: https%3A%2F%2Fwww.sitedaempresa.com.br components: schemas: FunctionsFw2SitesFw2PropagandaBackendV1Tables7Bid7DPricesPatchRequestBodyContentApplicationJsonSchemaDataItems: type: object properties: _id: type: string price: type: integer required: - _id - price title: >- FunctionsFw2SitesFw2PropagandaBackendV1Tables7Bid7DPricesPatchRequestBodyContentApplicationJsonSchemaDataItems Tabelas de Preço_Atualizar preços na tabela_Response_200: type: object properties: {} description: Empty response body title: Tabelas de Preço_Atualizar preços na tabela_Response_200 securitySchemes: apiKeyAuth: type: apiKey in: header name: Authorization ``` ## SDK Code Examples ```python import requests url = "https://api.example.com/_functions/@fw2sites/fw2-propaganda-backend/v1/tables/%7Bid%7D/prices" payload = { "data": [ { "_id": "id-do-preco", "price": 95 } ] } headers = { "Authorization": "", "Content-Type": "application/json" } response = requests.patch(url, json=payload, headers=headers) print(response.json()) ``` ```javascript const url = 'https://api.example.com/_functions/@fw2sites/fw2-propaganda-backend/v1/tables/%7Bid%7D/prices'; const options = { method: 'PATCH', headers: {Authorization: '', 'Content-Type': 'application/json'}, body: '{"data":[{"_id":"id-do-preco","price":95}]}' }; 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" "strings" "net/http" "io" ) func main() { url := "https://api.example.com/_functions/@fw2sites/fw2-propaganda-backend/v1/tables/%7Bid%7D/prices" payload := strings.NewReader("{\n \"data\": [\n {\n \"_id\": \"id-do-preco\",\n \"price\": 95\n }\n ]\n}") req, _ := http.NewRequest("PATCH", url, payload) req.Header.Add("Authorization", "") req.Header.Add("Content-Type", "application/json") 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://api.example.com/_functions/@fw2sites/fw2-propaganda-backend/v1/tables/%7Bid%7D/prices") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Patch.new(url) request["Authorization"] = '' request["Content-Type"] = 'application/json' request.body = "{\n \"data\": [\n {\n \"_id\": \"id-do-preco\",\n \"price\": 95\n }\n ]\n}" response = http.request(request) puts response.read_body ``` ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.patch("https://api.example.com/_functions/@fw2sites/fw2-propaganda-backend/v1/tables/%7Bid%7D/prices") .header("Authorization", "") .header("Content-Type", "application/json") .body("{\n \"data\": [\n {\n \"_id\": \"id-do-preco\",\n \"price\": 95\n }\n ]\n}") .asString(); ``` ```php request('PATCH', 'https://api.example.com/_functions/@fw2sites/fw2-propaganda-backend/v1/tables/%7Bid%7D/prices', [ 'body' => '{ "data": [ { "_id": "id-do-preco", "price": 95 } ] }', 'headers' => [ 'Authorization' => '', 'Content-Type' => 'application/json', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("https://api.example.com/_functions/@fw2sites/fw2-propaganda-backend/v1/tables/%7Bid%7D/prices"); var request = new RestRequest(Method.PATCH); request.AddHeader("Authorization", ""); request.AddHeader("Content-Type", "application/json"); request.AddParameter("application/json", "{\n \"data\": [\n {\n \"_id\": \"id-do-preco\",\n \"price\": 95\n }\n ]\n}", ParameterType.RequestBody); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = [ "Authorization": "", "Content-Type": "application/json" ] let parameters = ["data": [ [ "_id": "id-do-preco", "price": 95 ] ]] as [String : Any] let postData = JSONSerialization.data(withJSONObject: parameters, options: []) let request = NSMutableURLRequest(url: NSURL(string: "https://api.example.com/_functions/@fw2sites/fw2-propaganda-backend/v1/tables/%7Bid%7D/prices")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "PATCH" 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() ```