-
Working with File Content Sent From API file download curl request (php code)
I have a file that is in the form of a word doc on my dropbox application. I was able to get a working php curl without any errors from dropbox's side to download the file. I understand through the http docs that it is the file content that you are reading from the api. However, in my application, the curl is executed and…
-
Files Uploaded are Corrupted After api usage
I tried uploading various documents of types ms word doc and pdf to the site using the standard fread method in my curl postfields input. The files are corrupted and cannot be repaired by a word processor like libreoffice afterwards. I tried encoding the fread in base64, but the corruption still occured. How can I ensure…
-
php curl and data input for standard api curls
I know about the authorization and Content Type headers for each curl request I do to the api. But, when I am required to provide data when the require Content Type is application/json, should I include the data in a json encoded array with my http header, or should I reserve this json encoded array for the post fields…
-
redirect_uri mismatch with unknown cause php
I was using my php curl to request a token from the api. I set up my parameter array correctly. However, I get this error in return :{"error_description": "redirect_uri mismatch", "error": "invalid_grant"}400 This was my implementation: $dropbox_url = "https://api.dropboxapi.com/oauth2/token"; $timeout = 40; $app_key =…
-
header array invalid request for token auth php
I have been trying to get the header array for my php curl working. This is the structure of it. $http_headers = array( "Authorization: " . base64_encode($app_key . ":" . $app_secret), "Content-Type: application/x-www-form-urlencoded", "Dropbox-API-Arg: " . json_encode(array( 'code' => $code, 'grant_type' =>…
-
App Code and App Secret Input php curl
When I add the required app code and app secret for the 0auth2/token curl, should it be placed in the http header, or in the curlopt_postfields setopt? If it goes in the http header, should it be a seperate item in the array, or in my json encoded array with the other 3 parameters?
-
API oauth code/token storage php
What array variable get returned to following the redirect uri upon a successful oauth2 flow on my app? Is it stored in a variable like $_GET['code'] or something like that? I tried checking for it in a variable and I recieved a error that the variable did not exist.
-
The address is not understood error authentication
When trying to authenticate my web platform for file upload using the 0auth2 code flow, I experienced a error. I got my php code to use a header to reach the correct dropbox url for 0auth which worked. I log in, and press accept to allow the app to work with my account, then I get a error in firefox "The address was not…
-
http header issue with file send via php curl
I keep getting errors in my php code regarding a missing authorization header in my http request using curl. This is what my code looks like: $doc = $_FILES['Resume']; $filename = $doc['tmp_name']; $dropbox_token = "token"; $dropbox_url = "https://content.dropboxapi.com/2/files/upload"; /*$dropbox_api_headers =…