Rest Api Vs Sdk

Discussion in 'Education & Personal Growth' started by SuiDhaaga, Sep 26, 2021.

  1. SuiDhaaga

    SuiDhaaga Platinum IL'ite

    Messages:
    1,398
    Likes Received:
    1,038
    Trophy Points:
    283
    Gender:
    Female
    There must be some software developers here :)

    I'm studying for a certification that uses C# or Python to implement a solution.

    It should how to use REST API (i.e. make HTTP request, get JSON response) and SDK (install the service and call it)

    They say REST API simply allow you to call the service, whereas SDK allows you to customize the service. When I trace the code, I cannot wrap this around my head because

    1. REST API is more lines of code
    2. SDK seems streamlined

    The Instructors could not provide satisfactory explanation (they say get minimum passing in cert exam, and you are good to go)

    This is driving me bonkers. Google doesn't help either :-(
     
    Loading...

  2. Thoughtful

    Thoughtful Gold IL'ite

    Messages:
    179
    Likes Received:
    306
    Trophy Points:
    125
    Gender:
    Male
    I followed until the above. Did not follow the below:

    If there is any link which explains what you are doing, someone could help.
     
  3. SuiDhaaga

    SuiDhaaga Platinum IL'ite

    Messages:
    1,398
    Likes Received:
    1,038
    Trophy Points:
    283
    Gender:
    Female
    Ok I shall search for link
     
  4. SuiDhaaga

    SuiDhaaga Platinum IL'ite

    Messages:
    1,398
    Likes Received:
    1,038
    Trophy Points:
    283
    Gender:
    Female
    Here is link to code in Python that uses REST API, AI-102-AIEngineer/rest-client.py at master · MicrosoftLearning/AI-102-AIEngineer

    Here is link to code in Python that uses SDK, AI-102-AIEngineer/sdk-client.py at master · MicrosoftLearning/AI-102-AIEngineer


    Big difference is in how GetLanguage() is implemented

    When using REST API, GetLanguage() does following
    1. # Construct the JSON request body (a collection of documents, each with an ID and text)
    2. # Let's take a look at the JSON we'll send to the service
    3. # Make an HTTP request to the REST interface
    4. # Add the authentication key to the request header
    5. # Use the Text Analytics language API
    6. # Send the request
    7. # If the call was successful, get the response

    When using SDK, GetLanguage() does following
    1. # Create client using endpoint and key
    2. # Call the service to get the detected language
     
  5. Tubinbataye

    Tubinbataye Gold IL'ite

    Messages:
    139
    Likes Received:
    150
    Trophy Points:
    100
    Gender:
    Female
    There is a popular eg for SDK and API
    SDK is like a house with furnitures,telephone line,appliances,etc.API is something that allows communication via the telephone line in and out of the house.
    SDK is a tool to build app and api is like an interface for app communications.
     
    SuiDhaaga likes this.
  6. SuiDhaaga

    SuiDhaaga Platinum IL'ite

    Messages:
    1,398
    Likes Received:
    1,038
    Trophy Points:
    283
    Gender:
    Female


    It seems I do more coding to use the telephone line than I do to import SDK packages. Maybe I haven't used both methods enough :)
     
  7. Tubinbataye

    Tubinbataye Gold IL'ite

    Messages:
    139
    Likes Received:
    150
    Trophy Points:
    100
    Gender:
    Female
    Best wishes :)
     
    SuiDhaaga likes this.

Share This Page