Term

/term/list

Lists term in SMA Universe data.

CURL Request Example

curl --compressed --data
    "api_key=***3c1397f109dd7d62515b49b8b74e9a263c***"
    "https://api4.socialmarketanalytics.com/api/term/list?child=false&project_id=33&topic_id=146" 

Response Examples

{
  "response": {
    "tokendetails": {
      "api_token": "b1530a6c4e1845ebc9f89d9a3b6aa6b8",
      "function": "term",
      "request_quota_remaining": "275",
      "expires": "2016-01-14 07:25:05"
    },
    "term_params": {
      "child": "false",
      "project_id": "33",
      "topic_id": "146",
      "received": "2016-01-14 07:23:01",
      "completed": "2016-01-14 07:23:01"
    },
    "data": [
      {
        "term_id": "28",
        "name": "Aplha bravo charlie",
        "description": ""
      },
      {
        "term_id": "18",
        "name": "LGS School",
        "description": "LGS time, This sample description"
      },
      {
        "term_id": "37",
        "name": "Sports Revised",
        "description": "Sports description edited"
      }
    ]
  }
}

Detail version of error.

{
  "response": {
    "tokendetails": {
      "api_token": "b1530a6c4e1845ebc9f89d9a3b6aa6b8",
      "function": "term",
      "request_quota_remaining": "272",
      "expires": "2016-01-14 07:25:05"
    },
    "term_params": {
      "child": "false",
      "project_id": "33",
      "topic_id": "146",
      "received": "2016-01-14 07:23:01",
      "completed": "2016-01-14 07:23:01"
    },
    "error": {
      "error_code": 2515,
      "error_message": "provided child value is not allowed.",
      "description": "provided child value is not allowed."
    }
  }
}

Short version of error.

{
  "response": {
    "error": {
      "error_code": 1011,
      "error_message": "API key is missing",
      "description": "An API key is required to access service."
    }
  }
}

Parameters

Parameters Required Description
key string API level Parameter required

Key must be sent using POST method. Key parameter is required to call the API.

child string optional

API term list parameter with possible values true & false. It's default value is false & with this value it returns short set of data information & with true value it returns complete set of data information.

Project Id Integer optional

Project id is optional parameter and is used to narrow down the list.

Topic Id Integer optional

Topic id is optional parameter and is used to narrow down the list.

Return Value
JSON Array Response JSON array shall contain error (optional), API token details, term parameters and resultant data.
response Array
tokendetails array Provide the information about API internal handshaking mechanism.
api_token string Token for internal handshaking.
function string API function.
request_quota_remaining integer Number of requests left for the current token.
expires datetime Date & time at which, token shall expire.
term_params array Provide the function parameters.
child string API list term function parameter.
received string Date & time when request is received.
completed string Date & time when request is completed.
Data array Provide the information about data.
term_idstring Term Id
name string Term Name
description string Term description.
error array Provide the information about error.
error_codestring Error code number.
error_message string Error message.
description string Detailed error message.

/term/create

Creates term in SMA Universe data.

CURL Request Example

curl --compressed --data
    "api_key=***3c1397f109dd7d62515b49b8b74e9a263c***"
    "https://api4.socialmarketanalytics.com/api/term/create?topic_id=145&name=Sports&description=Test" 

Response Examples

{
  "response": {
    "tokendetails": {
      "api_token": "b1530a6c4e1845ebc9f89d9a3b6aa6b8",
      "function": "term",
      "request_quota_remaining": "275",
      "expires": "2016-01-14 07:25:05"
    },
    "term_params": {
      "topic_id" : "145",
      "name": "Sports",
      "description": "Sports are good for healthy life.",
      "received": "2016-01-14 07:23:01",
      "completed": "2016-01-14 07:23:01"
    },
    "success": {
      "success_code": "2503",
      "success_message": "Term is successfully created.",
      "description": "Term is successfully created.",
      "term_id": "70"
    }
  }
}

Detail version of error.

{
  "response": {
    "tokendetails": {
      "api_token": "b1530a6c4e1845ebc9f89d9a3b6aa6b8",
      "function": "term",
      "request_quota_remaining": "272",
      "expires": "2016-01-14 07:25:05"
    },
    "term_params": {
      "topic_id" : "145",
      "name": "Sports",
      "description": "Sports are good for healthy life.",
      "received": "2016-01-14 07:23:01",
      "completed": "2016-01-14 07:23:01"
    },
    "error": {
      "error_code": 2315,
      "error_message": "term name already exists for this user.",
      "description": "term name already exists for this user."
    }
  }
}

Short version of error.

{
  "response": {
    "error": {
      "error_code": 1011,
      "error_message": "API key is missing",
      "description": "An API key is required to access service."
    }
  }
}

Parameters

Parameters Required Description
key string API level Parameter required

Key must be sent using POST method. Key parameter is required to call the API.

Topic Id Integer required

Topic id is required to create term. Term can't be created without topic.

Name string required

Alpha numeric with space values are accepted for name. API shall return error special characters are part of it

Description string optional

Description parameter is alpha numeric with spaces. API shall return error special characters are part of it.

Return Value
JSON Array Response JSON array shall contain error (optional), API token details, term parameters and resultant data.
response Array
tokendetails array Provide the information about API internal handshaking mechanism.
api_token string Token for internal handshaking.
function string API function.
request_quota_remaining integer Number of requests left for the current token.
expires datetime Date & time at which, token shall expire.
term_params array Provide the function parameters.
name string API create term function parameter.
descriptionstring API create term function parameter.
received string Date & time when request is received.
completed string Date & time when request is completed.
success array Provide the information about success.
success_codestring Success code number.
success_message string Success message.
description string Detailed success message.
term_id integer Last created Term Id.
error array Provide the information about error.
error_codestring Error code number.
error_message string Error message.
description string Detailed error message.

/term/delete

Deletes term in SMA Universe data.

CURL Request Example

curl --compressed --data
    "api_key=***3c1397f109dd7d62515b49b8b74e9a263c***"
    "https://api4.socialmarketanalytics.com/api/term/delete?term_id=33" 

Response Examples

{
  "response": {
    "tokendetails": {
      "api_token": "b1530a6c4e1845ebc9f89d9a3b6aa6b8",
      "function": "term",
      "request_quota_remaining": "275",
      "expires": "2016-01-14 07:25:05"
    },
    "term_params": {
      "term_id": "33",
      "received": "2016-01-14 07:23:01",
      "completed": "2016-01-14 07:23:01"
    },
    "success": {
      "success_code": "2503",
      "success_message": "Term is successfully deleted.",
      "description": "Term is successfully deleted."
    }
  }
}

Detail version of error.

{
  "response": {
    "tokendetails": {
      "api_token": "b1530a6c4e1845ebc9f89d9a3b6aa6b8",
      "function": "term",
      "request_quota_remaining": "272",
      "expires": "2016-01-14 07:25:05"
    },
    "term_params": {
      "term_id": "33",
      "received": "2016-01-14 07:23:01",
      "completed": "2016-01-14 07:23:01"
    },
    "error": {
      "error_code": 2315,
      "error_message": "term already deleted.",
      "description": "term already deleted."
    }
  }
}

Short version of error.

{
  "response": {
    "error": {
      "error_code": 1011,
      "error_message": "API key is missing",
      "description": "An API key is required to access service."
    }
  }
}

Parameters

Parameters Required Description
key string API level Parameter required

Key must be sent using POST method. Key parameter is required to call the API.

Term Id Integer required

Term id is required to delete the term. API shall return error if term id is missing or empty.

Return Value
JSON Array Response JSON array shall contain error (optional), API token details, term parameters and resultant data.
response Array
tokendetails array Provide the information about API internal handshaking mechanism.
api_token string Token for internal handshaking.
function string API function.
request_quota_remaining integer Number of requests left for the current token.
expires datetime Date & time at which, token shall expire.
term_params array Provide the function parameters.
term_id string API delete term function parameter.
received string Date & time when request is received.
completed string Date & time when request is completed.
success array Provide the information about success.
success_codestring Success code number.
success_message string Success message.
description string Detailed success message.
error array Provide the information about error.
error_codestring Error code number.
error_message string Error message.
description string Detailed error message.

Success

Success Code Success Message
2303 Project is successfully created.
2304 Project is successfully updated.
2305 Project is successfully deleted.
2318 Projects are successfully listed.
2403 Topic is successfully created.
2404 Topic is successfully updated.
2405 Topic is successfully deleted.
2419 Topics are successfully listed.
2503 Term(s) successfully created.
2504 Term is successfully updated.
2505 Term(s) successfully deleted.
2518 Terms are successfully listed.
2529 Topic advance attributes saved successfully.

Errors

Error Code Error Message
1000 Authentication error
1001 Forbidden
1002 Your API access is suspended
1003 Secure connection required. Please use https to connect
1004 Must use POST to send API key & function
1005 Your API seat access is suspended
1011 API key is missing
1012 Invalid API key
1013 Expired API token
1014 Invalid API token
1015 Invalid API token
1017 Your project access is suspended
1050 Gone. API endpoint is not available
1051 Invalid API Key parameter
1052 Invalid parameters detected
1101 Request limit exceeded
1106 Term creation limit reached.
1110 Exceeded number of clients
2100 Syntax error
2101 Unknown parameter
2119 Invalid format
3000 Internal Error
3001 Service Unavailable. Api is down or being upgraded
3002 Server capacity exceeded
3003 Database server is down. We expect to be back shortly
3103 Gateway timeout. Please try again
2300 Method not allowed.
2301 Unauthorized user.
2302 Project id is required
2306 Project could not be created
2307 Project could not be updated
2308 Project could not be deleted
2309 Project name is required is required parameter.
2310 Project name size is not valid.
2311 Project name is not valid.
2312 Project description is not valid.
2313 Project creation limit reached.
2314 Project is already deleted or project is not assioated with your account.
2315 Project already exists for your account.
2316 Project already deleted.
2317 Project description size is not valid.
2400 Unauthorized user.
2401 Topic id is required parameter.
2402 Project id is required for topic
2406 Topic could not be created
2407 Topic could not be updated
2408 Topic could not be deleted
2409 Topic name is required parameter.
2410 Topic name size is not valid.
2411 Topic name is not valid.
2412 Topic description is not valid.
2413 Topic creation limit reached.
2414 Invalid topic id.
2415 Topic already exists for your account.
2416 Topic already deleted.
2417 Topic description size is not valid.
2418 Invalid parent_id.
2420 Topic name is required.
2500 Unauthorized user.
2501 Topic id is required parameter.
2502 Term name is required parameter.
2506 Term(s) could not be created
2507 Term could not be updated
2508 Term(s) could not be deleted
2510 Term name size is not valid.
2511 Term name is not valid.
2512 Term description is not valid.
2513 Term description exceeds the size limit.
2514 Invalid topic id.
2515 Term name already exists your account.
2516 Term already deleted.
2519 Term id is required for this action.
2520 Invalid term operator.
2521 Term operator is required parameter.
2522 Invalid parameters to create term/terms.
2523 Invalid parameters
2524 Term(s) already assigned.
2525 Invalid Term(s) id.
2526 Required parameters are missing.
2527 Internal Error.
2528 Reached to maximum word limit