Jump to content

Amilcar

Members
  • Content Count

    3
  • Joined

  • Last visited

  1. I want to update some data on my data base. I tried this and i'm getting this error message where did i go wrong??
  2. I dont know why i'm getting this error. I have a website in Wordpress and I'm trying to get data from my form and send it to an external database, not mine. How can I do That? I'm in days trying and I can't find the solution.
  3. var cbIntegrationId = "xxxxx"; //I have this data var clientId = "xxxxxx"; //I have this data var clientSecret = "xxxxxxx"; //I have this data var tableName = "xxxx"; //I have this data //Get access token $.post( "https://" + cbIntegrationId + ".caspio.com/oauth/token", { grant_type: "client_credentials", client_id: clientId, client_secret: clientSecret }, function(cbAuth){ //Run POST call $.ajax({ url: "https://" + cbIntegrationId + ".caspio.com/rest/v2/tables/" + tableName + "/records?response=rows", type: 'POST', data: '{ "SubmissionID": null, "Date_of_policy_sold": "13/08/2019","Broker_Code": "Afinidade1004","Drivers_Full_Name": "Amílcar Paco", "Drivers_BI_Number": "123456789012F","Phone_Number": "0258849279489", "Address": "Distrito Municipal 5 Matendene", "Email": "amilcarcpaco@gmail.com", "Type_Of_Cover": "Sedan/Light Duty Vehicle (6 months cover)","Amount_of_Months": "6", "Vehicle_Make_and_Model" : "Toyota Mark X", "Vehicle_Year_Model": "2008", "Vehicle_Registration_No": "AAV123MP", "Engine_Number": "GD028982", "Roadside": "Yes", "Cover_Start_Date": "14/08/2019", "Cover_End_Date": "14/2/20/2020", "Total_Amount": "2800", "Payment_Status":"cancel ", "IP": "127.0.0.0.0" }', //Define record values headers: { "Authorization": "Bearer " + cbAuth.access_token, //Extracts the access token from the initial authorization call "Content-Type": "application/json; harset=utf-8", //Required, otherwise 415 error is returned "Accept": "application/json" }, dataType: 'json', success: function (data) { console.log(data.Result); //Check the console to view the new added row }, error: function(data) { console.log(data.responseJSON); //Check the console to view error message if any } }); } ); //But I am getting this error // ------ {Message: "Authorization has been denied for this request."} Message: "Authorization has been denied for this request." __proto__: Object //I'm trying to send data an external database using rest api. I ask for help. // I have the permissions, I Guess.
×
×
  • Create New...