Faq

    Get FAQs

    Gets the list of FAQ items available.

    Request

    • Method: GET
    • Version: v3, this API call supports additional sort and filter mechanisms as well as retrieving only a sub-set of fields

      Note: In order to access the v3 API endpoints please make sure you have enabled the new rendering engine.

    • Server: https://[app key here]-[site_ID here]-apps.worldsecuresystems.com. Take a look at the Authorize your API calls document for more info on how this URL is formed.
      • Note: When building apps always use relative request URLs. Do not use the "full" URL above because you might have problems running your app on a different site as the site_ID parameter will be different.
    • Path: /webresources/api/v3/sites/current/faqs/[faqId]
      • Alternatively, use siteID instead of 'current'
    • Authorization header: This should contain the authorization token. Here is how to obtain the token.

    Response

    The details for the specified customer ID in JSON format.

    • id - the id of the faq item(integer)
    • siteId - the id of the site(integer)
    • roleId - id of the role responsible(integer)
    • question - question body(string)
    • answer - answer body(string)
    • internalNotes admin-only visible notes(string)
    • templateId - template assigned to faq(integer)
    • weight - weight value(integer)
    • createBy - admin user id(integer)
    • createDate - date of faq item creation(datetime)
    • latUpdateBy - admin user that performed latest update(integer)
    • lastUpdateDate - most recent update date(datetime)
    • releaseDate release date(datetime)
    • expiryDate - date of item expiry(datetime)
    • enabled - active state, true or false(boolean)
    • deleted deleted state, true or false(boolean)
    • displayable display state, true or false(boolean)
    • reIndex trigger reindex, true or false(boolean)

    The response is paginated, you can return only a few of the customer's fields. Take a look at the API V3: sorting and filtering for additional switches you can use.

    You can output additional fields to those listed above as default, see the API v3 Discovery APP for additional details.

    Accepts and returns JSON as Content-Type.


    Request:

    GET /webresources/api/v3/sites/current/anniversaries HTTPS/1.1
    Authorization: 14f87f21c5ea4830a06a6314a8aad82b45bc61dc08f24a0fb55599cea83ca811
    Connection: keep-alive
    Content-Type: application/json
    

    Response:

    {
       "items": [
        {
          "id": 44767,
          "siteId": 1211552,
          "roleId": -1,
          "question": "How many years have you been in business",
          "answer": "You can now publish a comprehensive FAQ (Frequently Asked Questions) knowledgebase that allows your customers to find answers to questions about your products and services and much more.",
          "internalNotes": "",
          "templateId": 0,
          "weight": null,
          "createBy": 267621,
          "createDate": "2013-11-25T09:13:03.45",
          "lastUpdateBy": 267621,
          "lastUpdateDate": "2013-11-25T09:13:03.45",
          "releaseDate": "2011-05-29T10:00:00",
          "expiryDate": "9998-12-31T15:00:00",
          "enabled": true,
          "deleted": false,
          "faqIdShadow": null,
          "displayable": true,
          "reIndex": false
        },
        {
          "id": 44768,
          "siteId": 1211552,
          "roleId": -1,
          "question": "I have faulty products, who should I contact?",
          "answer": "You can now publish a comprehensive FAQ (Frequently Asked Questions) knowledgebase that allows your customers to find answers to questions about your products and services and much more.",
          "internalNotes": "",
          "templateId": 0,
          "weight": null,
          "createBy": 267621,
          "createDate": "2013-11-25T09:13:03.45",
          "lastUpdateBy": 267621,
          "lastUpdateDate": "2013-11-25T09:13:03.45",
          "releaseDate": "2011-05-29T10:00:00",
          "expiryDate": "9998-12-31T15:00:00",
          "enabled": true,
          "deleted": false,
          "faqIdShadow": null,
          "displayable": true,
          "reIndex": false
        }
     ],
      "totalItemsCount": 2,
      "skip": 0,
      "limit": 10
    }

    Sample code

    List all the faq items on the site

    var access_token = BCAPI.Helper.Site.getAccessToken();
    var request = $.ajax({
    url: "/webresources/api/v3/sites/current/faqs",
    type: "GET", connection: "keep-alive", contentType: "application/json", headers: { "Authorization": $.cookie('access_token') } }); request.done(function (msg) { console.log(msg); }) request.fail(function (jqXHR) { console.log("Request failed."); console.log("Error code: " + jqXHR.status); console.log("Error text: " + jqXHR.statusText); console.log("Response text: " + jqXHR.responseText); })

    Create a new FAQ item

    Using this method you can add an FAQ item to your site.

    Request

    • Method: POST
    • Version: v3
    • Server: https://[app key here]-[site_ID here]-apps.worldsecuresystems.com. Take a look at the Authorize your API calls document for more info on how this URL is formed.
      • Note: When building apps always use relative request URLs. Do not use the "full" URL above because you might have problems running your app on a different site as the site_ID parameter will be different.
    • Path: /webresources/api/v3/sites/current/faqs
      • Alternatively, use siteID instead of 'current'
    • Authorization header: This should contain the authorization token. Here is how to obtain the token.

    Parameters

    • id - the id of the faq item(integer)
    • siteId - the id of the site(integer)
    • roleId - id of the role responsible(integer)
    • question - question body(string)
    • answer - answer body(string)
    • internalNotes admin-only visible notes(string)
    • templateId - template assigned to faq(integer)
    • weight - weight value(integer)
    • createBy - admin user id(integer)
    • createDate - date of faq item creation(datetime)
    • latUpdateBy - admin user that performed latest update(integer)
    • lastUpdateDate - most recent update date(datetime)
    • releaseDate release date(datetime)
    • expiryDate - date of item expiry(datetime)
    • enabled - active state, true or false(boolean)
    • deleted deleted state, true or false(boolean)
    • displayable display state, true or false(boolean)
    • reIndex trigger reindex, true or false(boolean)

    Response

    Returns an empty body if successful or a detailed error message.

    Accepts and returns JSON as Content-Type.


    Request:

    POST /webresources/api/v3/sites/current/faqs HTTPS/1.1
    Authorization: 14f87f21c5ea4830a06a6314a8aad82b45bc61dc08f24a0fb55599cea83ca811
    Connection: keep-alive
    Content-Type: application/json
    
    
    {
        "roleId": -1,
        "question": "How many years have you been in business",
        "answer": "You can now publish a comprehensive FAQ (Frequently Asked Questions) knowledgebase that allows your customers to find answers to questions about your products and services and much more.",
        "internalNotes": "",
        "templateId": 0,
        "weight": null,
        "createBy": 267621,
        "createDate": "2013-11-25T09:13:03.45",
        "lastUpdateBy": 267621,
        "lastUpdateDate": "2013-11-25T09:13:03.45",
        "releaseDate": "2011-05-29T10:00:00",
        "expiryDate": "9998-12-31T15:00:00",
        "enabled": true,
        "deleted": false,
        "faqIdShadow": null,
        "displayable": true,
        "reIndex": false
    }

    Response:

    
    HTTP/1.1 201 CREATED
    Location: /webresources/api/v3/sites/current/faqs
    Content-Type: application/json; charset=utf-8
    Content-Length: length

    Sample code

    var access_token = BCAPI.Helper.Site.getAccessToken();
    var request = $.ajax({
    url: "/webresources/api/v3/sites/current/faqs",
    data:JSON.stringify({"roleId":-1,"question":"How many years have you been in business","answer":"You can now publish a comprehensive FAQ (Frequently Asked Questions) knowledgebase that allows your customers to find answers to questions about your products and services and much more.","internalNotes":"","templateId":0,"weight":null,"createBy":267621,"createDate":"2013-11-25T09:13:03.45","lastUpdateBy":267621,"lastUpdateDate":"2013-11-25T09:13:03.45","releaseDate":"2011-05-29T10:00:00","expiryDate":"9998-12-31T15:00:00","enabled":true,"deleted":false,"faqIdShadow":null,"displayable":true,"reIndex":false}), type: "POST", contentType: "application/json", headers: { "Authorization": BCAPI.Helper.Site.getAccessToken() } }); request.done(function(data) { console.log(data); }) request.fail(function(jqXHR) { console.log("Request failed."); console.log("Error code: " + jqXHR.status); console.log("Error text: " + jqXHR.statusText); console.log("Response text: " + jqXHR.responseText); })

    Edit an anniversary resource

    Using this method you can edit an anniversary resource.

    Request

    • Method: PUT
    • Version: v3
    • Server: https://[app key here]-[site_ID here]-apps.worldsecuresystems.com. Take a look at the Authorize your API calls document for more info on how this URL is formed.
      • Note: When building apps always use relative request URLs. Do not use the "full" URL above because you might have problems running your app on a different site as the site_ID parameter will be different.
    • Path: /webresources/api/v3/sites/current/faqs/[faqId]
      • Alternatively, use siteID instead of 'current'
    • Authorization header: This should contain the authorization token. Here is how to obtain the token.

    Parameters

    • id - the id of the faq item(integer)
    • siteId - the id of the site(integer)
    • roleId - id of the role responsible(integer)
    • question - question body(string)
    • answer - answer body(string)
    • internalNotes admin-only visible notes(string)
    • templateId - template assigned to faq(integer)
    • weight - weight value(integer)
    • createBy - admin user id(integer)
    • createDate - date of faq item creation(datetime)
    • latUpdateBy - admin user that performed latest update(integer)
    • lastUpdateDate - most recent update date(datetime)
    • releaseDate release date(datetime)
    • expiryDate - date of item expiry(datetime)
    • enabled - active state, true or false(boolean)
    • deleted deleted state, true or false(boolean)
    • displayable display state, true or false(boolean)
    • reIndex trigger reindex, true or false(boolean)

    Response

    Returns an empty body if successful or a detailed error message.

    Accepts and returns JSON as Content-Type.


    Request:

    PUT /webresources/api/v3/sites/current/faqs/[faqId] HTTPS/1.1
    Authorization: 14f87f21c5ea4830a06a6314a8aad82b45bc61dc08f24a0fb55599cea83ca811
    Connection: keep-alive
    Content-Type: application/json
    
    
    {
        "id": 54216,
        "siteId": 1211552,
        "roleId": -1,
        "question": "TEST business"
    }

    Response:

    
    HTTP/1.1 204 NO CONTENT
    Location: /webresources/api/v3/sites/current/faqs/[faqId]
    Content-Type: application/json; charset=utf-8
    Content-Length: length

    Sample code

    var access_token = BCAPI.Helper.Site.getAccessToken();
    var request = $.ajax({
    url: "/webresources/api/v3/sites/current/faqs/54216",
    data:JSON.stringify({"id":54216,"siteId":1211552,"roleId":-1,"question":"TEST business"}),
    type: "PUT", contentType: "application/json", headers: { "Authorization": BCAPI.Helper.Site.getAccessToken() } }); request.done(function(data) { console.log(data); }) request.fail(function(jqXHR) { console.log("Request failed."); console.log("Error code: " + jqXHR.status); console.log("Error text: " + jqXHR.statusText); console.log("Response text: " + jqXHR.responseText); })

    Delete an FAQ item

    Delete a Frequently Asked Question.

    Request

    • Method: DELETE
    • Version: v3
    • Server: https://[app key here]-[site_ID here]-apps.worldsecuresystems.com. Take a look at the Authorize your API calls document for more info on how this URL is formed.
      • Note: When building apps always use relative request URLs. Do not use the "full" URL above because you might have problems running your app on a different site as the site_ID parameter will be different.
    • Path: /webresources/api/v3/sites/current/faqs/[faqId]
      • Alternatively, use siteID instead of 'current'
    • Authorization header: This should contain the authorization token. Here is how to obtain the token.

    Response

    Returns an empty body if successful or a detailed error message.


    Request:

    DELETE /webresources/api/v3/sites/current/faqs/[faqId] HTTPS/1.1
    Authorization: 14f87f21c5ea4830a06a6314a8aad82b45bc61dc08f24a0fb55599cea83ca811
    Connection: keep-alive
    Content-Type: application/json
    

    Response:

    
    HTTP/1.1 204 NO CONTENT
    Location: /webresources/api/v3/sites/current/faqs/[faqId]
    Content-Type: application/json; charset=utf-8
    Content-Length: length

    Sample code

    var access_token = BCAPI.Helper.Site.getAccessToken();
    var request = $.ajax({
        url: "/webresources/api/v3/sites/current/faqs/44767",
        type: "DELETE",
    contentType: "application/json", headers: { "Authorization": $.cookie('access_token') } }); request.done(function(data) { console.log(data); }) request.fail(function(jqXHR) { console.log("Request failed."); console.log("Error code: " + jqXHR.status); console.log("Error text: " + jqXHR.statusText); console.log("Response text: " + jqXHR.responseText); })