Model on 'child' of REST model?

  • 1
  • Question
  • Updated 3 years ago
  • Answered
I have a REST model that is returning fields like this:
[{
  "id": 54321,
  "firstName": "Bob",
  "lastName": "McTest",
  "phone": "",
  "email": "bob.mctest@example.com",
  "date": "June 17, 2013",
  "time": "10:15am",
  "endTime": "11:15am",
  "dateCreated": "July 2, 2013",
  "datetime": "2013-07-02T10:15:00-0700",
  "price": "10.00",
  "paid": "no",
  "amountPaid": "0.00",
  "type": "Regular Visit",
  "appointmentTypeID": 1,
  "duration": "60",
  "calendar": "My Calendar",
  "calendarID": 27238,
  "certificate": null,
  "confirmationPage": "https://acuityscheduling.com/schedule.php?owner=11145481&id[]=1220aa9f41091c50c0cc659385cfa1d0&action=appt",
  "formsText": "...",
  "notes": "Notes",
  "timezone": "America/New_York",
  "forms": [
    {
      "id": 1,
      "name": "Example Intake Form",
      "values": [
        {
          "value": "yes",
          "name": "Is this your first visit?",
          "fieldID": 1,
          "id": 21502993
        },
        {
          "value": "Ninja",
          "name": "What is your goal for this appointment?",
          "fieldID": 2,
          "id": 21502994
        }
      ]
    }
  ]
}

Is there any way that I can create a model on the 'forms' data, so that I could put it in a drawer on a table of the parent data?
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb

Posted 3 years ago

  • 1
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
Ah, I just found the 'path to contents' option. Done!
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
Sweet! 
Photo of Mordechai

Mordechai

  • 968 Points 500 badge 2x thumb
Matt, what authentication method are you using with your REST model?

Rob, other than the tutorials is there any form of detailed documentation as to how to pass data from the authentication to the REST endpoint? what each field does on a custom authentication provider? Do you have any idea when the "ModelServiceAuthProvider" is going to become available?
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
Basic http
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,006 Points 20k badge 2x thumb
Mordechai - what version of Skuid are you running.  We've done some substantial work on the Authentication Provider functionality.  Can you give us some more detail on what you are looking for? 
Photo of Mordechai

Mordechai

  • 968 Points 500 badge 2x thumb
Rob, I'm using version 7.34.

At the core what I'm trying to do is connect to my own REST API with custom authentication. Ideally I would like to use a custom apex auth provider "ModelServiceAuthProvider" but that does not seem to be available as a global interface.

My second option as a result is to create a custom REST Adapter in javascript that would override the default REST adapter provided by skuid. but I need it to make a call to my apex in order to authenticate and return an authentication code. in order to do this I would need to know what the url is that it's trying to authenticate. it would also help to have a list of fields that can be passed into the authentication request, though I guess if I'm creating the method I can choose what to pass in.

In general it would help to have a list of all fields that are available to be passed in to model service calls.

Thank you
(Edited)