Jump to content

SonniT

Members
  • Posts

    3
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

SonniT's Achievements

Newbie

Newbie (1/14)

1

Reputation

  1. I have resolved the issue. Instead of trying to update the entire record i just update the specific field in question - and i have added the where-clause. $postdata = "TestTable2_SMS_sendt":true} and '/views/' . $name . "/records?q.where=" . $columnname . "=" . $columnvalue; 'Hope this can help others :-)
  2. Thanx for your reply. I tried removing the column you requested but it didn't work im affraid. The column types are as follows {"TestTable1_ProduktId (integer)":4,"TestTable1_TestTable1Id (autonumber)":43,"TestTable1_VilHaSMS (yes/no)":true,"TestTable2_DatoOprettet (date/time)":"2019-03-19T10:49:37","TestTable2_TestTable1Id (integer)":43,"TestTable2_SMS_sendt (yes/no)":true} In the Swagger UI it has a q.where clause that i don't use in the php-script - might that pose a problem? If so - how do i use that? (sorry if the question might be a bit basic). Regards, Sonni T.
  3. Hi all I am trying to update a view in Caspio that consists of 2 tables using PHP and the REST API - but i keep getting errors. I am trying to update the view using the JSON below ($postdata) {"PK_ID":"48,100","TestTable1_ProduktId":4,"TestTable1_TestTable1Id":43,"TestTable1_VilHaSMS":true,"TestTable2_DatoOprettet":"2019-03-19T10:49:37","TestTable2_TestTable1Id":43,"TestTable2_SMS_sendt":true} and this php-script $url = $this->resource_url . '/views/my-test-view/records'; $auth = 'Bearer my-test-token'; $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => $url, CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "PUT", CURLOPT_POSTFIELDS => $postdata, CURLOPT_HTTPHEADER => array( "authorization:" . $auth, "cache-control: no-cache", "content-type: application/json", 'Content-Length: ' . strlen($postdata) ) )); I keep getting this error: Message":"Cannot perform operation because the body parameter is absent or invalid. What am i doing wrong? 'Looking forward to hearing from any of you :-) Sonni T.
×
×
  • Create New...