New Mobile Guy
Posts: 0
Joined: Tue Jan 29, 2013 9:09 pm

Issue with accessing tiggzi backend via php

I need to access the tiggzi database via php. After a bunch of research on the web, I came up with the following code. However, when I try to echo the results, I get the error that the database id wasn't supplied. Any idea what I'm doing wrong?

'"'. $application/json .'"',
'X-Tiggzi-Database-Id' = '""',

);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);

//make the request
$result = curl_exec($ch);

?

Is there some simpler way to access Tiggzi database via php?

New Mobile Guy
Posts: 0
Joined: Tue Jan 29, 2013 9:09 pm

Issue with accessing tiggzi backend via php

Hmmm... looks like some of my code got cut off.

Basically, I'm trying to use this method: http://drupal.org/node/305799

For the database Id, I'm setting one of the $data array parameter of "X-Tiggzi-Database-Id" to my database id.

Any working samples of accessing Tiggzi via PHP?

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

Issue with accessing tiggzi backend via php

Make sure you send X-Tiggzi-Database-Id as a header parameter. Find a PHP examples that sends a basic GET request but also includes a header parameter.

New Mobile Guy
Posts: 0
Joined: Tue Jan 29, 2013 9:09 pm

Issue with accessing tiggzi backend via php

Thanks. I'm 1 step closer. Now it looks like I'm connecting to the database but not getting any data...

I'm showing my small bit of code as a picture (replacing the username and password.) It's pieced together from a whole bunch of different articles on php, json, http, etc (doesn't seem to be any single example that will work.) Do you see anything that jumps out at you re: I'm doing wrong? Image

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

Issue with accessing tiggzi backend via php

Sorry, don't have much experience with PHP. Why are you including the username/password in the header? Then it seems like you are including the database is as part of data again?

New Mobile Guy
Posts: 0
Joined: Tue Jan 29, 2013 9:09 pm

Issue with accessing tiggzi backend via php

where should the username and password go?

I'm not tied to using php. I just need to create a page where I can access and update the database content (though outside the tiggzi app). do you have a recommendation (ideally one with example code.)

thanks! you've been very helpful so far!

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

Issue with accessing tiggzi backend via php

If you do a regular GET against a custom collection (not User), you don't need username/password.

Return to “Issues”