Software Archive
Read-only legacy content
17061 Discussions

PLEASE HELP. My web service won't work!

Sade_P_
Beginner
539 Views

I'm an individual working on a personal project. It is a mobile app. I'm using the Intel XDK so I can write the app in javascript and use Parse for the backend (I know that parse is discontinuing it's service in one year. I still want to use it while I can). 
Anyway, I'm having a really hard time setting up a web service inside Intel XDK so I can send and retrieve objects from parse. I have watched a fairly good tutorial on envato.com, but am still not getting it. 
The last few people I hired to help only started trying to figure it out while they were in front of me. That doesn't work and they couldn't help me. I need you to have done this particular task before. 
I am using the Parse.rest api from inside Intel.

Another thing, the Brackets code editor which has some confusing quirks I can't figure out. 

For instance, though I've included the jquery library on my html page, in my j.s file I will try an Ajax call and get an error in js hint saying the '$' undefined. 
The error will only go away if I do something like var $; 
But that doesn't make any sense does it? 

I've attached a picture of the error I'm getting when I try the parse web service using the "Try It" button in the web services section. 

I am willing to pay someone to work with me remotely on these issues. 

 I would also like some help with implementing facebook login because I am also stuck on that. 

my email is Sade.Pilot@gmail.com

0 Kudos
7 Replies
Amrita_C_Intel
Employee
539 Views

Hello,

What issues are you facing with facebook login?

0 Kudos
Chris_P_Intel
Employee
539 Views

So you are writing your own parse web service?

Could you post the .js and .json files for that?

0 Kudos
Sade_P_
Beginner
539 Views

This is APICONFIG.JSON

 
{
  "parse": {
    "name": "Parse API",
    "description": "Backend",
    "dashboardUrl": "https://parse.com",
    "auth": "x1********vf4Dq2kJIwdDO*****KjQMFN",
    "signature": "ep**********tLEUKPIX*****mTUj7o7Bep"
  }
}
 
 
This is PARSE.JSON
 
{
"endpoints": [
  {
    "name": "Parse methods",
    "dashboardUrl": "http://https://parse.com/docs/rest",
    "methods": [
        {
        "MethodName": "articles",
        "Synopsis": "Grabs articles from parse",
        "parameters": [
          {
            "Name": "ID",
            "Required": "N",
            "Default": "",
            "Type": "string",
            "Description": "Article ID"            
          }
          
        ]
      }
      
    ]
  }
]
}
 
 
This is PARSE.JS
 
(function (credentials) {
//var $;
    var exports = {};
    var baseUrl = 'https://api.parse.com/1/classes/article/';
    
    exports.articles = function (params) {
    params = params || {};
    var artID = '';
    if (params.ID) {
        artID = params.ID;
    }
    var url = baseUrl + artID;
    return $.ajax({
        url: url,
        headers: {
        'X-Parse-Application-Id' : credentials.apiKey,
        'X-Parse-REST-API-Key' : credentials.apiSecret
        }
    });
    };
    
  
    return exports;
 
})(); 
0 Kudos
Chris_P_Intel
Employee
539 Views

The expert on these is on vacation this week. But I think I can guess.

 

In APIConfig.json, the correct value for "auth" is "key".  

And the correct value for "signature" is "apiSecret"

These would have been the original values.

Then, when you use the service, you enter your API keys into the services browser in the XDK. 

 

Good luck,

Chris

0 Kudos
Chris_P_Intel
Employee
539 Views

If the $ is the one undefined, it means your document isn't including jQuery.  Add that and you should be set.

0 Kudos
Sade_P_
Beginner
539 Views

I've already added Jquery though, in the script tag in the head section of the html page. 

0 Kudos
Sade_P_
Beginner
539 Views

It doesn't even make a difference if I move the script tag to the body. 

Thanks for your help by the way. 

You said the expert was on vacation. When will they be back?

Do they have a direct place I can message them that you can give me? 

0 Kudos
Reply