Topic

/topic/list

It list topic in SMA Universe data.

CURL Request Example

curl --compressed --data
    "api_key=***3c1397f109dd7d62515b49b8b74e9a263c***"
    "https://api4.socialmarketanalytics.com/api/topic/list?child=false" 

Response Examples

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

Detail version of error.

{
  "response": {
    "tokendetails": {
      "api_token": "b1530a6c4e1845ebc9f89d9a3b6aa6b8",
      "function": "topic",
      "request_quota_remaining": "272",
      "expires": "2016-01-14 07:25:05"
    },
    "topic_params": {
      "child": "false",
      "received": "2016-01-14 07:23:01",
      "completed": "2016-01-14 07:23:01"
    },
    "error": {
      "error_code": 2315,
      "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 topic list parameter with possible values true & false. It's default value is false & with this value it returns topics data & with true value it returns topics or terms data.

Return Value
JSON Array Response JSON array shall contain error (optional), API token details, topic 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.
topic_params array Provide the function parameters.
child string API list topic 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.
topic_idstring Topic Id
name string Topic Name
description string Topic description.
error array Provide the information about error.
error_codestring Error code number.
error_message string Error message.
description string Detailed error message.

/topic/create

It creates topic in SMA Universe data.

CURL Request Example

curl --compressed --data
    "api_key=***3c1397f109dd7d62515b49b8b74e9a263c***"
    "https://api4.socialmarketanalytics.com/api/topic/create?parent_id=10&project_id=33&name=topicname&description=topicdescription" 

Response Examples

{
  "response": {
    "tokendetails": {
      "api_token": "0b40efec0e60bd44db80770fa667b40d",
      "function": "topic",
      "request_quota_remaining": 179,
      "expires": "2016-01-19 07:15:39"
    },
    "topic_params": {
      "parent_id": "145",
      "project_id": "33",
      "name": "Developers Gala",
      "description": "Developers Gala will help developers",
      "received": "2016-01-19 07:00:40",
      "completed": "2016-01-19 07:00:40"
    },
    "success": {
      "success_code": "2403",
      "success_message": "Topic is successfully created.",
      "description": "Topic is successfully created.",
      "topic_id": "70"
    }
  }
}

Detail version of error.

{
  "response": {
    "tokendetails": {
      "api_token": "0b40efec0e60bd44db80770fa667b40d",
      "function": "topic",
      "request_quota_remaining": 178,
      "expires": "2016-01-19 07:15:39"
    },
    "topic_params": {
      "parent_id": "145",
      "project_id": "",
      "name": "Developers Gala",
      "description": "Developers Gala will help developers",
      "received": "2016-01-19 07:02:15",
      "completed": "2016-01-19 07:02:15"
    },
    "error": {
      "error_code": 2402,
      "error_message": "Project id is required for topic",
      "description": "Project id is required for topic."
    }
  }
}

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.

Project Id Integer required

Project is integer value and is required to create topic.

Parent Id Integer optional

Parent id is integer value and it is used to set parent of 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, topic 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.
topic_params array Provide the function parameters.
name string API create topic function parameter.
descriptionstring API create topic 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.
topic_id integer Last created Topic Id.
error array Provide the information about error.
error_codestring Error code number.
error_message string Error message.
description string Detailed error message.

/topic/edit

It edits topic in SMA Universe data.

CURL Request Example

curl --compressed --data
    "api_key=***3c1397f109dd7d62515b49b8b74e9a263c***"
    "https://api4.socialmarketanalytics.com/api/topic/edit?parent_id=45&topic_id=33&name=topicname&description=topicdescription" 

Response Examples

{
  "response": {
    "tokendetails": {
      "api_token": "b1530a6c4e1845ebc9f89d9a3b6aa6b8",
      "function": "topic",
      "request_quota_remaining": "275",
      "expires": "2016-01-14 07:25:05"
    },
    "topic_params": {
      "parent_id": "20",
      "topic_id": "33",
      "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": "2403",
      "success_message": "Topic is successfully updated.",
      "description": "Topic is successfully updated."
    }
  }
}

Detail version of error.

{
  "response": {
    "tokendetails": {
      "api_token": "b1530a6c4e1845ebc9f89d9a3b6aa6b8",
      "function": "topic",
      "request_quota_remaining": "272",
      "expires": "2016-01-14 07:25:05"
    },
    "topic_params": {
      "parent_id": "20",
      "topic_id": "33",
      "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": "topic name already exists for this user.",
      "description": "topic 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.

Parent Id Integer optional

Parent id is optional and used to set parent of a topic.

Topic Id Integer required

Topic Id is required to edit the topic. API shall return error if topic id is missing or empty.

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, topic 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.
topic_params array Provide the function parameters.
topic_id string API edit topic function parameter.
name string API edit topic function parameter.
descriptionstring API edit topic 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.

/topic/delete

It delete topic in SMA Universe data.

CURL Request Example

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

Response Examples

{
  "response": {
    "tokendetails": {
      "api_token": "b1530a6c4e1845ebc9f89d9a3b6aa6b8",
      "function": "topic",
      "request_quota_remaining": "275",
      "expires": "2016-01-14 07:25:05"
    },
    "topic_params": {
      "topic_id": "33",
      "received": "2016-01-14 07:23:01",
      "completed": "2016-01-14 07:23:01"
    },
    "success": {
      "success_code": "2403",
      "success_message": "Topic is successfully deleted.",
      "description": "Topic is successfully deleted."
    }
  }
}

Detail version of error.

{
  "response": {
    "tokendetails": {
      "api_token": "b1530a6c4e1845ebc9f89d9a3b6aa6b8",
      "function": "topic",
      "request_quota_remaining": "272",
      "expires": "2016-01-14 07:25:05"
    },
    "topic_params": {
      "topic_id": "33",
      "received": "2016-01-14 07:23:01",
      "completed": "2016-01-14 07:23:01"
    },
    "error": {
      "error_code": 2415,
      "error_message": "topic already deleted.",
      "description": "topic 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.

Topic Id Interger required

topic Id is required to delete the topic. API shall return error if topic id is missing or empty.

Return Value
JSON Array Response JSON array shall contain error (optional), API token details, topic 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.
topic_params array Provide the function parameters.
topic_id string API delete topic 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.
2429 Topic intersection is successfully created.
2435 Sub-Topics are successfully listed.
2436 No sub-topics are found against given topic

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
1105 Topic 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.
2421 Topics creation in a project limit reached.
2422 Sub-topics creation limit reached.
2423 Intersect topic cant't be edited.
2424 Child topics are not allowed for topic intersection.
2425 Invalid project id.
2426 Invalid topic intersection parameters.
2427 Topic type intersect can't be used for further intersection.
2428 Intersection topics are not associated to same/active project.
2430 Topic intersection could not be created