Key Information

Register
Submit
The challenge is finished.

Challenge Overview

Project Overview

We have launched a new Fun Challenge series to help our members learn new skills/technologies while getting used to the Topcoder platform.  In this challenge, we will learn how to return JSON data from a Salesforce account.

Important :
This is a fun and learning challenge. No prizes will be awarded for completing the challenge.

Business Requirements

"Fun&Learn" company wants to develop a survey solution. FunAtLearn has identified Salesforce.com as their desired platform to implement the solution. We will help them build the survey application, across a series of challenges. In this month's challenge, we will write some code to return survey object's data as JSON. The JSON data can be consumed by any other external app (such as mobile).

Help Documentation & Tutorials

  1. https://developer.salesforce.com/page/Get_Started_With_Apex_Code
  2. https://developer.salesforce.com/trailhead/apex_database/apex_database_intro
  3. https://developer.salesforce.com/page/Creating_REST_APIs_using_Apex_REST
  4. https://developer.salesforce.com/page/An_Introduction_to_Force.com_Sites
  5. https://developer.salesforce.com/blogs/developer-relations/2012/02/quick-tip-public-restful-web-services-on-force-com-sites.html

Technical Requirements

You need a Salesforce.com Developer account to complete this challenge. You can sign up a free account here
A survey is a collection of Questions. A question can be part of multiple surveys. To keep things simple, we will assume all questions are of Free Text.

In Previous challenges, we built the object schema. If you haven't participated in previous challenges, please use the package to install the objects.

This Challenge Requirements

  1. Create two objects, Survey and Question. 
  2. Create a junction object Survey Questions.
  3. Write a REST API in Salesforce using Apex that responds to Get Requests and returns Survey Data As JSON.
  4. The API returns all survey along with related questions if a survey ID is passed.
  5. Expose the API via a Force.com site so that it can be called externally without authentication
  6. Verify the service works by invoking the service via any REST API Testing tool (e.g. PostMan)

Sample Response 

A sample response is attached with the challenge. Salesforce can auto-generate this response, by providing the right query



Final Submission Guidelines

Please provide URL of the Force.com Site along the REST API Url

Things to take care

  1. The Site Url for the Apex class will be only accessible via Https
  2. Please remember to activate the site 
  3. Remember to grant permissions to Object and Apex Class for the Force.com Site User
Important :
This is a fun and learning challenge. No prizes will be awarded for completing the challenge.

ELIGIBLE EVENTS:

2016 TopCoder(R) Open

REVIEW STYLE:

Final Review:

Community Review Board

Approval:

User Sign-Off

SHARE:

ID: 30050834