Quantcast
Channel: DreamFactory Forum - Latest posts
Viewing all 5025 articles
Browse latest View live

Send Email with attachments

$
0
0

@drewpearce - is there a way with DF2 to send emails with attachments?
If not, is it in the pipeline?

Thanks!


PHP scripting to POST to external MySQL for new registrations

$
0
0

Hi All,

I Need Knowledge about to Get the table record in Dreamfactory PHP custom scripting service.

My PHP Code in My local

$final_url = 'http://127.0.0.1:8080/api/v2/​user​?​id​=​12​5';

curl_setopt($ch, CURLOPT_URL, $final_url);
curl_setopt($ch, CURLOPT_USERPWD, ​'admin@gmail.com' . ":" . ​'password'​);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Accept: application/json','X-DreamFactory-Api-Key: "api_key' ));

$result = curl_exec($ch);​

​In Dreamfacotry I create one Custom script service in Admin console. In that
how cah i get the user=125 records in PHP code​(Dreamfactory).

Please help me?

Mobile facebook/google authorizations

$
0
0

for facebook you need to call on the server side after getting the access token from the native sdk on mobile (in this case facebook sdk):
https://graph.facebook.com/debug_token?input_token="+request.params.token+"&access_token=request.params.acces_token

-> https://developers.facebook.com/docs/facebook-login/access-tokens/debugging-and-error-handling

You receive a json here stating if your token is valid or not. If it's valid you continue with registering your user. I have no ideea how to create a shadow user if google+ and facebook or a manual account exists with the same email.

On google + you verify the token sent by your app to the server side like :
https://www.googleapis.com/oauth2/v3/tokeninfo?id_token="+request.params.token

But at the moment I can't call a service that has a script that will verify these tokens because I don't have a session token for dreamfactory. You are not logged in before you need to use this validation.

@aislam

Thank you.

Recent problem with Mailgun service

$
0
0

Hi Users
i've notice since this morning a pb with the mailgun service (Dreamfactory 2.0.1 from bitnami on a local VM)

note that he had to work fine so far.

i've an error 500 with "message": "cURL error 60: SSL certificate problem: unable to get local issuer certificate",

any of you using mailgun have this issue?

edit (try with Dreamfactory 2.1 from bitnami : same problem / any problem on mailgun side?)

thanks
jb

Mobile facebook/google authorizations

$
0
0

@nvasilescu, are you trying to implement OAuth using DreamFactory server side scripting? Have you followed the instructions on the two links I gave you above?

DreamFactory will automatically create the shadow user for your OAuth user when successfully logged in using OAuth. No need to register the user.

Also you can expose any service in DreamFactory using the API_KEY via an app. You need to create a role first that has desired access to your service. Then create an app in DreamFactory and assign this role to this app. Use this app's API_KEY when you call you service and it will work without requiring session token.

Mobile facebook/google authorizations

$
0
0

I have found the tutorial for guest user (http://wiki.dreamfactory.com/DreamFactory/Tutorials/Setting_up_guest_access) . Implementing now.

Oauth is not helping on mobile because you sign in trough the facebook sdk on that certain native platform. There's no redirect link involved as it will oblige you to open a webview in a mobile app to login with facebook while having facebook application installed. The good way is:

1) getting facebook token from calling facebook sdk
2) send the token to your backend and validate it trough a http get. If it's valid register the user. Here is where I should be able to create a shadow user if the user already exists but with a different login provider by manually specifying that. Which I didn't found a way of doing that at the moment.

Manual Installation Issue and nginx configuration

$
0
0

Getting the following error after installation.

2016/03/03 13:21:44 [error] 8276#0: *5 FastCGI sent in stderr: "PHP message: REST Exception #404 > Could not find a service for user" while reading response header from upstream, client: 172.26.10.15, server: dreamfactory.dev, request: "GET /api/v2/system/environment HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "dreamfactory.dev", referrer: "http://dreamfactory.dev/dreamfactory/dist/index.html"

Verified nginx running, and reachable.

Here is the top portion of the phpinfo()

PHP Version 5.5.9-1ubuntu4.14

System Linux B2BWebDev 3.19.0-25-generic #26~14.04.1-Ubuntu SMP Fri Jul 24 21:16:20 UTC 2015 x86_64
Build Date Oct 28 2015 01:37:05
Server API FPM/FastCGI
Virtual Directory Support disabled
Configuration File (php.ini) Path /etc/php5/fpm
Loaded Configuration File /etc/php5/fpm/php.ini

Followed these instruction to configure nginx. http://wiki.dreamfactory.com/DreamFactory/Installation/Linux/Apt#Nginx

Here is my virtual host config.

server {
listen 80;
#listen [::]:80;

root /var/www/dreamfactory/public;
index index.php index.html index.htm;

server_name dreamfactory.dev;

location / {
    try_files $uri $uri/ /index.php?$args;
}

error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
    root /usr/share/nginx/html;
}

location ~ \.php$ {
    try_files $uri =404;
    fastcgi_split_path_info ^(.+\.php)(/.+)$;
    fastcgi_pass unix:/var/run/php5-fpm.sock;
    fastcgi_index index.php;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    include fastcgi_params;
}

}

Rest call fails from android but works from browser

$
0
0

I have set up a public custom script service. I followed the tutorial from http://wiki.dreamfactory.com/DreamFactory/Tutorials/Setting_up_guest_access .

If I use https://addons.mozilla.org/en-US/firefox/addon/restclient/ and simulate a post request to http://192.168.56.1:8080/api/v2/auth_confirm which is my localhost everything works. I get back a script error response :
{
"error":
{
"context": null,
"message": "Undefined index: loginType",
"code": 500,

The same call(post, with header containing X-DreamFactory-Api-Key which I checked 20 times made from android (Everything else on the app that needs a session token from android works ok) fails :

POST /api/v2/auth_confirm HTTP/1.1

Accept application/json
X-DreamFactory-Api-Key 1dcc1606f2cd2b84c6a5132be3d3e74cffcce0603157f92c41xxx
Content-Type application/json
Content-Length 250
User-Agent Dalvik/2.1.0 (Linux; U; Android 5.1; Google Nexus 5 - 5.1.0 - API 22 - 1080x1920 Build/LMY47D)
Host 192.168.56.1:8080
Connection Keep-Alive
Accept-Encoding gzip

{
"error": {
"context": null,
"message": "Invalid token: Wrong number of segments",
"code": 401,


S3 using PHP Platform API

$
0
0

@Mike_Harvey I am working on getting some additional feedback from engineers for you. They were able to run the scripts successfully. I hope to get a working set up soon to share with you. Thanks for hanging in there, I'll try to get some feedback for you shortly.

S3 using PHP Platform API

Rest call fails from android but works from browser

$
0
0

Well there seems to be a problem in the following param :

The browser rest call sends in the header : Content-type : text/html
The android sends : Content-type : application/json; charset=UTF-8

The public rest service doesn't work with content-type : application/json but the rest endpoints like user/session work and the ones that need X-DreamFactory-Session-Token work with this content-type

Can someone confirm or explain please ?

@aislam @toddappleton

Thank you.

Custom Script XML reponse tags

$
0
0

Hi

I create a custom xml script , for process post requests.

use

Accept: text/xml
Content-Type: text/xml
and develop version of dreamfactory (production version has bug "Invalid XML Payload Supplied")

this is how my script response looks :

<?xml version="1.0" ?>

its to possible remove the ... tags in the xml response ?

Regards

IOS-SDK, semantic issue on compile

$
0
0

I am getting 36 compilation errors. Whats the problem here?
I am using ios-sdk Release 2.0.3 on iOS ver 10.7 having xcode 4.2

Create database schema based on swagger definition?

$
0
0

I don't have an answer - I just want to second this question. It seems like with all the weight DreamFactory has put behind swagger support, there would be a way to import a swagger spec and, as noted, "automagically" do a lot of this work. So far all I've been able to do is import the spec to display the documentation.

Making a http request and reading json response from custom php script

$
0
0

I have been searching all day for how to make a http request to a certain link. The tutorial for scripting are few and not helping in this matter.

1) I have a public service(user doesn't need to be logged in) that I call from a mobile application with 2 params using POST.
2) I read the params and I need to call a link that is formed using the params received.
3) I need to read the json from the http request and read a certain value and return as a response.

Thank you


Calling a stored proc with the same database connection/session

$
0
0

We have a pretty tight security architecture implementing row-level-security enforced at the database level. When trying to use DreamFactory we are needing to call a stored procedure that handles setting a few values in the session_context info that only has the scope of a single established PDO connection to the database. It seemed like this could be handled in the pre-processing server side scripts making another API call via PHP script, but that is establishing a new and separate connection to the database, then that connection drops before it continues with the original request. I'm trying to determine if we can reference the "current" connection to the database (that is active at the time the pre-process script is running it seems) to make that stored procedure call. Or I see that SQLite is setup in a way to call init scripts on connection, being able to use that against our database would accomplish the same thing. Using DF 2.1 with an Azure SQL Database. Any help or thoughts would be appreciated.

How to talk with external nosql with service custom script

$
0
0

I tried to use node custom script tutorial as a guide to test external nosql api that I setup in the service, but I gotten the following error

error": {
"context": null,
"message": "Bad request. No token or api key provided.",
"code": 400,
"trace": [

The code is as follows....
taken from and modify from -> http://wiki.dreamfactory.com/DreamFactory/Tutorials/Node_API_example

var request = require('request');

var options = {
// Get all records from todo table.
// This table can be easily created in admin console from Schema-->Upload JSON.
url: 'http://xyz008.com/api/v2/db/_table/ext_nosql',
// Use same auth as user calling this script.
headers: {
'x-dreamfactory-api-key': '2190dsfa0vf23r9203vjwerwer23r'
}
};

request(options, function (error, response, body) {
if (!error && response.statusCode == 200) {
event.response.content = body;
} else {
event.response.status_code = response.statusCode;
event.response.content = body;
}
});

DF > Where will this app live

$
0
0

Greetings!

Planning for single and multi page applications. Got following queries/concerns towards feasibility of DF. Any guide, post or replies related, would be helpful.

  1. Developed single page app using files within \javascript-sdk-master\add_javascript. Now what are the ways to deploy it? Any descriptive docs towards DF > App > 'Where will this app live'? Tried with two options:
    • On Web Server, got NO console to deploy files/*.zip. With Packages > App (schema + service) > Export, throws error
    • On File Storage, permission restricted error.
  2. DF, how well suited for multi-pages web applications?

  3. Any example to have services based on existing RESTful api within DF or external?

Thanking for the same!

Configuration of an OAuth service accessing a DB with Google/FB account

$
0
0

Hi,

I have read the wiki links as well as the discussions here in the forum. But i am still unable to configure Df 2.1.0 in such a way, that a user can for example access a db table or is logged in in DF.

I have setup a Google developers account and the same for FB. There I get a clientId and a clientsecret and have to set the redirectUri (which I set to something like h ttp://myurl/.?service=google).

I have also set up a role for accessing ALL and a service with OAuth Google setting clientId + clientsecret + redirectUri (=h ttp://myurl/?service=google)

If I surf in browser to http://myurl/?service=google I am redirected to Google login, accept it and Ia forwarded to DF login screen. I am not logged in. If I try it with cUrl, I get a redirect to Google, I open the url in a browser accept it, check in developer tools of the browser for the "code" param and create a new POST message to h ttp://myurl/api/v2/user/session?oauth_callback=true&code=[MY-COPIED_CODE_GOES_HERE]. Then I get an error stating that "Login request is missing requiered email."

What am I doing wrong here? I would have expected, that I am logged in, or at least see some tokens.

Best,
Sven

Manual Installation Issue and nginx configuration

$
0
0

I'm getting the same error when running php artisan serve.

Laravel development server started on http://0.0.0.0:8000/
[Mon Mar  7 10:11:38 2016] 172.26.10.15:40740 [200]: /dreamfactory/dist/index.html
[Mon Mar  7 10:11:38 2016] 172.26.10.15:40741 [200]: /dreamfactory/dist/styles/styles.07300592.css
[Mon Mar  7 10:11:38 2016] 172.26.10.15:40742 [200]: /dreamfactory/dist/scripts/vendor.8baef916.js
[Mon Mar  7 10:11:38 2016] 172.26.10.15:40746 [200]: /dreamfactory/dist/vendor/ace/ace.js
[Mon Mar  7 10:11:39 2016] 172.26.10.15:40744 [200]: /dreamfactory/dist/vendor/ace/mode-javascript.js
[Mon Mar  7 10:11:39 2016] 172.26.10.15:40743 [200]: /dreamfactory/dist/scripts/app.fb07cdba.js
[Mon Mar  7 10:11:40 2016] 172.26.10.15:40747 [200]: /dreamfactory/dist/vendor/ace/ace.js
[Mon Mar  7 10:11:40 2016] 172.26.10.15:40748 [200]: /dreamfactory/dist/vendor/ace/mode-javascript.js
[Mon Mar  7 10:11:41 2016] REST Exception #404 > Could not find a service for user
Viewing all 5025 articles
Browse latest View live