What are Slapbots?

The Slapbot API is an ever-growing library of humor and heart. Containing hundreds of professionally written phrases and jokes that you can put to use any way you please. The Slap Jokes, Hairline Jokes, and Tongue Twisters are a blast, while the phrases of appreciation and love are heart-meltingly sweet. Each month, the slap bot will grow, adding more new original and unique content written by American and British comedians.

About the Slap.bot API

Protocol: The transport is HTTP. The Slap.bot tries to conform to REST principles.

API Endpoint: The endpoint for the current API version is http://conflictapi.com/v1. All URLs mentioned below are relative to the endpoint. The endpoint address may change in future versions of the API.

Response Format: The data returned by the API is encoded as JSONContent-Type: application/json and XML Content-Type: application/xml. The character encoding isUTF-8. Future versions of the API may introduce other formats which will be selectable through the use of Accept and Accept-Charset headers. In the current version these headers are ignored. The Default response format is JSON.

JSONP: The API calls listed below also support JSONPContent-Type: text/javascript as an alternative encoding. If you pass a URL parameter named callback to the end point, the returned value will be wrapped in a function call where the function name is the value of the callback parameter. For example &callback=YourFunctionNameHere.

Compression: The API supports compressing response data. This can be selected through the use of the Accept-Encoding header. If your using this api outside of the the US-East region you will benefit from using Accept-Encoding:gzip.

Redirect Handling: API calls may return temporary redirects (302) which the clients should follow. In general, the clients should expect to receive any of the standard HTTP status code and handle them according to the HTTP spec.

Developer Requirements

1-Authentication

In order to call the API, you need to register as a developer at our developer site and accept the terms of use. You will then be issued an application ID and a key. You must either pass these with each API call n HTTP headers : app_id:app-id and app_key:app-key or include them as URL parameters:app_id=app-id&app_key=app-key.

If your id and key are invalid, or if you exceed your API rate limit, the server will respond with the HTTP status code 409.

2-Plans and Rate Limits

You must choose a rate limit plan when you sign up for the API. If you’d like a higher rate limit than is offered by any of the plans, please contact us at support@slap.bot.

3-Standard Response Codes

The API uses standard HTTP status codes to indicate success or failure of API calls (Consult the documentation for your programming language to learn how the read the status code of an HTTP call)

HTTP CodeMessageMeaningResponse body
200OKSuccess!A JSON response (see below.)
201CreatedA new resource was successfully created.A JSON response containing the new resource's data.
400Bad RequestYou've made an error in your request (such as passing a string for a parameter that expects a number).An error message
403ForbiddenYou've exceeded the rate limits for your account, or the data you're trying to access is private.An error message
404Not FoundThe requested resource could not be found, or the URI doesn't correspond to any known command.An error message
500Server ErrorAn internal error on our side. If this problem persists, submit a bug report in the bug section of our forums.An error message
503Service UnavailableThe API is down for scheduled maintenance; please try again later (this should be rare!)An error message

The X-Error-Detail HTTP header will contain a detailed description of many errors.

Tip: What's the difference between a 404 Not Found and a 200 OK with empty results? If you're searching for a specific record, say listing #27, and it doesn't exist, that's a 404 Not Found. The record wasn't found; it doesn't exist; it probably never did. However, if you're searching for a set of records and no listings match your search, that's a 200 OK. There's nothing wrong with your request, but it doesn't match anything, and your result set is empty.

3- Standard Response Codes

All API methods take one or more parameters, either as query parameters of the URL itself, or as PUT parameters. The documentation fo r each method references these standard types:

Param TypeMeaning
stringAny string (up to 255 characters). Can include both number and characters
intA whole number value.
API Reference

Using the /SLAP endpoint

This endpoint allows performing GET requests to retrieve Slap descriptions.

The base url for the SLAP GET is http://conflictapi.com/v1/api/SLAP?_app_id=app-id&_app_key=app-key&your_search_parameters

Get Slap API Semantics

General Notes Regarding These Parameters

Default Values: Parameters marked as optional will be defaulted if not supplied.

When a parameter is submitted more than once, only the first parameter and its values will be considered. Other values will be ignored.

Case sensitive: Parameters are not case sensitive unless specified.

Some of the parameters will need to support passing multiple values; in these cases, we comma separated values

Search Metadata Dictionaries We keep dictionaries of the possible values of our search parameters which are defined in the section "Parameters".

  1. The API may return a redirect HTTP status code (302) which you should follow.
  2. Again, don’t forget to URL-encode!

Parameters

q

Should be the search phrase generic search. With use space to separate words (url-encoded as either + or %20). Where the values provided may be found in the slap Slaps.

  • This parameter is validated by Data Type, only Strings are allowed, max length 1024 characters.
  • Example: To search for slaps containing the words "grilled cheese" append &q=grilled+cheese or &q=grilled%20cheese

MaxRecords

Specifying a MaxRecords against the MaxRecords[] parameter will increase the number of rows returned by the Call to the value presented. Where the values can be any positive number less than or equal to 50. The default value is 1. The Parameter can NOT be specified more than once.

  • Validation:Data Type Validation. Positive number 50 or less
    • Please Note: the API will automatically convert a Negative number to 1
  • Example:To return 10 slap, append &MaxRecords=10

Sortby

Specifying a Sortby against the Sortby [] parameter will sort the description by the field provided in descending order.

  • Validation: Data Type Validation. String only, max length 128 characters and Content Validation for values in the Search Metadata Dictionary
  • This parameter must be set equal to a searchValue in the Search Metadata Dictionary. To access the metadata dictionary for Sortby searchValues, use the following end point:http://conflictapi.com/v1/api/Metadatasearch?app_id=YOUR_APP_ID&app_key=Your_APP_key&lookup=sortBy
  • Example: To search for Slaps sorted by best Star ratings, append &Sortby=rating

requirePictures

Setting this to "true" means to only return slaps with images or Gifs

  • Validation: Data Type Validation. Bit only, max length 1 characters of 1 or 0.
  • No content validation needed.
  • Example: To search for slaps which have pictures, append &requirePictures=true

allowedGenres

Specifying a Genre against the allowedGenres parameter means that all search results must include slaps with the specified Genre(s) and will exclude any slaps that do not contain the specified Genre(s). This parameter must be set equal to a searchValue in the Search Metadata Dictionary. The Genre parameter can be repeated more than once to specify more than one Genre.

  • Validation: Data Type Validation. String only, max length 1024 characters and Content Validation for values in the Search Metadata Dictionary
  • This parameter must be set equal to a searchValue in the ConflictAPI Metadata Dictionary. To access the metadata dictionary for allowedGenre searchValues, use the following end point: http://conflictapi.com/v1/api/Metadata/allowedGenre
  • Example: To search for Slaps which include only R-rated Genres append &allowedGenres=R-Rated
  • Multiple Criteria Example: To search for slaps which include both R-rated and PG-Rated in commas between each value : allowedGenres=R-rated,PG-Rated
  • What are Genres: All slap descriptions are labeled with one genres of Humor. A literary genre is a popular categories of literary composition. Genres may be determined by literary technique, tone or content.
  • Examples of Genres: (for the full list of acceptable Genres, use the following endpoint: http://conflictapi.com/v1/api/Metadatasearch?app_id=YOUR_APP_ID&app_key=Your_APP_key&
    lookup=allowedGenres
    )
    FantasyModernDetectiveHorror
    SuperHeroHumorScience FictionWestern

allowedCollections

Specifying a Collection against the allowedCollections parameter means that all search results must include Slap Slaps with the specified Collection (s) and will exclude any slap descriptions that do not contain the specified Collection (s). This parameter must be set equal to a searchValue in the Search Metadata Dictionary. The allowedCollections parameter can be repeated more than once to specify more than one Collections.

  • Validation: Data Type Validation. String only, max length 1024 characters and Content Validation for values in the Search Metadata Dictionary
  • This parameter must be set equal to a searchValue in the ConflictAPI Metadata Dictionary. To access the metadata dictionary for allowedCollections searchValues, use the following end point: http://conflictapi.com/v1/api/Metadatasearch?app_id=YOUR_APP_ID&app_key=Your_APP_key&
    lookup=allowedCollections
  • Example: To search for slap Descriptions which are a part of the Jungles collection append &allowedCollections=NSFW
  • Multiple Criteria Example: To search for slaps descriptions which include both Not Safe For Work and Safe For Work append &allowedCollections=NSFW&allowedCollections=SFW
  • What are Collections: Collections are subcategories of the Product Category. Nearly all slap Descriptions are grouped into one subcategory. However, not all Slaps are within a collection, in these cases, the collection will be listed as "none"
  • For the full list of acceptable Collections, use the following endpoint: http://conflictapi.com/v1/api/Metadatasearch?app_id=YOUR_APP_ID&app_key=Your_APP_key&
    lookup=allowedCollections

allowedSeverity

Specifying a Severity against the allowedSeverity parameter means that all search results must include slaps with the specified Severity(s) and will exclude any slap Descriptions that do not contain the specified Severity(s). This parameter must be set equal to a searchValue in the Search Metadata Dictionary. The Severity parameter can be repeated more than once to specify more than one Severity.

  • Validation: Data Type Validation. String only, max length 1024 characters and Content Validation for values in the Search Metadata Dictionary
  • This parameter must be set equal to a searchValue in the Search Metadata Dictionary. To access the metadata dictionary for allowedSeverity searchValues, use the following end point: http://conflictapi.com/v1/api/Metadatasearch?app_id=YOUR_APP_ID&app_key=Your_APP_key&
    lookup=allowedSeverityy
  • Example: To search for slap descriptions which include only R-rated, Severitys append &allowedSeverity=R
  • Multiple Criteria Example: To search for Slaps which include both R-rated and PG-Rated append &allowedSeverity=R,PG
  • What is Severity: Severity is subcategory of the Collections Category. Nearly all Slaps are grouped into one or more Severity.
  • Examples of Severity: (for the full list of acceptable Severity, use the following endpoint: http://conflictapi.com/v1/api/Metadatasearch?app_id=YOUR_APP_ID&app_key=Your_APP_key&
    lookup=allowedSeverity
    )
    PGPG-13
    RNC-17

allowedRating

Specifying a Rating against the allowedRating parameter means that all search results must have a rating greater than or equal to the specified Rating. This parameter must be set equal to a search Value in the Search Metadata Dictionary. The Rating parameter can NOT repeated more than once.

  • Validation: Data Type Validation. Number only, between 1 and 5.
  • Example: To search for slap Descriptions which have Ratings of 3 or greater append &allowedRating=3
  • The allowedRating parameter can NOT repeated more than once.

Id

is a number which uniquely identifies a description. This parameter allows you to store and retrieve specific Slaps. The ID parameter can be repeated more than once.

  • Validation: Data Type Validation. Number only.
  • Example: To search for Slaps with the id of 2431 append &id=2431
  • UIR example: http://conflictapi.com/v1/api/Slaps?app_id=YOUR_ID&app_key=YOUR_APP_KEY&id=2431
  • Example: To search for Slaps with ids, 2431, 2428, 2429 append &id=2431,2428,2429
  • UIR example: http://conflictapi.com/v1/api/Slaps?app_id=YOUR_ID&app_key=YOUR_APP_KEY&id=2431,2428,2429

Attributes returned

  • matches : An array of the matching Slaps. This is a window into the entire result set controlled by the maxResult and start parameters. Note that the data structure describing each Description is different that the data structure returned by the Get Description API. Each object in matches has the following data:
  • Each object in matches has the following data:
    • id : The reference id for this Slap Description that can be used to Uniquely identify the slap description. For example, the ID can be used in GET API call for the full Description details from the Get Description API Call. id is Always present in response.
    • rating : The average public rating score for a Description.
    • ImageUrl : A link to an image which can be used with the slap description
    • Source : The display name of the source
    • ActionWord : Action word is the key word or phrase that is at the center of the description.
    • Description : the narrative of the Slap. THIS IS WHAT THE USERS WANTS TO SEE
    • audiofile : if audio is available for the description a link will be presented here
    • productImageMED : Link to high level product image of Medium size.
    • productImageLG : Link to high level product image of large size.
    • contentImageSML : Link to image specific to the content. Image will be of small size.
    • contentImageMED : Link to image specific to the content. Image will be of Medium size.
    • contentImageLG : Link to image specific to the content. Image will be of Large size.
    • contentImageCard : link to card Background if available
    • isAd : Indicates if the content is considered a sponsored ad.
    • productid : the id of the product associated with the product.
    • buyLink : Link to site or location to purchase the source of the content
    • packID : the unique identifying number of the package associated to the content.
    • packageName : the unique name of the package associated to the content.

With HTTP Headers
curl -H 'app_id: X' -H 'app_key: Y' -X 
GET "http://conflictapi.com/v1/api/SLAP?q=Low+Jaw"
                           
                       


With query parameters
curl -X 
GET "http://conflictapi.com/v1/api/SLAP?app_id=X&app_key=Y&q=Low+Jaw"
                           
                       
With HTTP Headers
require 'rest-client'
require 'json'
 
params = {
  :params => {
    :app_id => 'X', 
    :app_key => 'Y'
  }
} 

response = RestClient.get 'http://conflictapi.com/v1/api/SLAP?q=Low+Jaw' params
JSON.parse(response)
                           
                       


With query parameters
require 'rest-client'
require 'json'

response = RestClient.get 'http://conflictapi.com/v1/api/SLAP?app_id=X&app_key=Y&q=Low+Jaw'
JSON.parse(response)
                           
                       
With HTTP Headers
import requests
headers = {'app_id': 'X', 'app_key':'Y' }
r = requests.get(
  'http://conflictapi.com/v1/api/SLAP?q=Low+Jaw', 
  headers=headers)
  #line breaks and indentation are for readability only.
r.json()
                           
                       


With query parameters
import requests
r = requests.get(
  'http://conflictapi.com/v1/api/SLAP?app_id=X&app_key=Y&q=Low+Jaw')
  #line breaks and indentation are for readability only.
r.json()
                           
                       
With HTTP Headers
$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 
    "http://conflictapi.com/v1/api/SLAP?q=Low+Jaw",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => array(
    'app_id': 'X', 
    'app_key':'Y'
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);
$json = json_decode($response, true);
                           
                       


With query parameters
$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 
    "http://conflictapi.com/v1/api/SLAP?app_id=X&app_key=Y&q=Low+Jaw",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);
$json = json_decode($response, true);
                           
                       
With HTTP Headers
String jsonResponse = null;    
try {
  URL object = new URL("http://conflictapi.com/v1/api/SLAP?q=Low+Jaw");

  HttpURLConnection connection = (HttpURLConnection) object
          .openConnection();
  
  connection.setReadTimeout(60 * 1000);
  connection.setConnectTimeout(60 * 1000);

  connection.setRequestProperty("app_id", "X");
  connection.setRequestProperty("app_key", "Y");
  int responseCode = connection.getResponseCode();            

  if (responseCode == 200) {
      InputStream inputStr = connection.getInputStream();
      String encoding = connection.getContentEncoding() == null ? "UTF-8"
              : connection.getContentEncoding();
      jsonResponse = IOUtils.toString(inputStr, encoding); 
  }
} catch (Exception e) {
  e.printStackTrace();
}    
                           
                       


With query parameters
String jsonResponse = null;    
try {
  URL object = new URL(
    "http://conflictapi.com/v1/api/SLAP?app_id=X&app_key=Y&q=Low+Jaw");

  HttpURLConnection connection = (HttpURLConnection) object
          .openConnection();
  
  connection.setReadTimeout(60 * 1000);
  connection.setConnectTimeout(60 * 1000);
  
  int responseCode = connection.getResponseCode();            

  if (responseCode == 200) {
      InputStream inputStr = connection.getInputStream();
      String encoding = connection.getContentEncoding() == null ? "UTF-8"
              : connection.getContentEncoding();
      jsonResponse = IOUtils.toString(inputStr, encoding); 
  }
} catch (Exception e) {
  e.printStackTrace();
}
                           
                       
With HTTP Headers
var request = require('request');

var options = {
  url: 'http://conflictapi.com/v1/api/SLAP?q=Low+Jaw',
  headers: {
    'app_id': 'X', 
    'app_key':'Y'
  }
};

function callback(error, response, body) {
  if (!error && response.statusCode == 200) {
    var info = JSON.parse(body);
    console.log(info.stargazers_count + " Stars");
    console.log(info.forks_count + " Forks");
  }
}

request(options, callback);
                           
                       


With query parameters
var request = require('request');

var options = {
  url: 'http://conflictapi.com/v1/api/SLAP?app_id=X&app_key=Y&q=Low+Jaw',
};

function callback(error, response, body) {
  if (!error && response.statusCode == 200) {
    var info = JSON.parse(body);
    console.log(info.stargazers_count + " Stars");
    console.log(info.forks_count + " Forks");
  }
}

request(options, callback);
                           
                       
With HTTP Headers
using (WebClient wc = new WebClient())
{
  wc.Headers.Add("app_id","your app id");
  wc.Headers.Add("app_key","your app key");
  var json = wc.
    DownloadString("http://conflictapi.com/v1/api/SLAP?q=Low+Jaw");
}
                           
                       


With query parameters
using (WebClient wc = new WebClient())
{
  var json = wc.
    DownloadString("http://conflictapi.com/v1/api/SLAP?app_id=X&app_key=Y&q=Low+Jaw");
}
                           
                       

Using the /Twister endpoint

This endpoint allows performing GET requests to get Tongue Twisters

The base url for Tongue Twisters is http://conflictapi.com/v1/api/Twister?_app_id=app-id&_app_key=app-key&your_search_parameters

To help us improve our content, we ask for developers to use the following metrics calls within their applications.

General Notes Regarding These Parameters

  • Default Values : Parameters marked as optional will be defaulted if not supplied.
  • First Parameter is always used : When a parameter is submitted more than once, only the first parameter and its values will be considered.
  • Case Sensitive : Parameters are not case sensitive unless specified.
  • Multiple Values : Some of the parameters will need to support passing multiple values; in these cases, please use comma separated values
  • Search Metadata Dictionaries : We keep dictionaries of the possible values of our search parameters which are defined in the section “Parameters”.
  • Redirect : The API may return a redirect HTTP status code (302) which you should follow

Parameters

q

Should be the search phrase generic search. With use space to separate words (url-encoded as either + or %20). Where the values provided may be found in the Tongue Twisters Descriptions

  • This parameter is validated by Data Type, only Strings are allowed, max length 1024 characters.
  • Example: To search for Tongue Twisters containing the words “Race Horse” append &q= Race+ Horse or q=Race%20 Horse
  • URI example:http://conflictapi.com/v1/api/Twister?_app_id=YOUR_ID&_app_key=YOUR_APP_KEY&q=Race+Horse

MaxRecords

Specifying a MaxRecords against the MaxRecords parameter will limit the number of rows returned by the Call to the value presented. Where the values can be any positive number less than or equal to 50. The default value is 1. The Parameter can NOT be specified more than once.

  • Validation:Data Type Validation. Positive number, 50 or less.
    • Please Note: the API will automatically convert a Negative number to 1
  • Example:To return 10 slap, append &MaxRecords=10

SortBy

Specifying a Sortby against the Sortby parameter will sort the description by the field provided in descending order.

  • Validation: Data Type Validation. String only, max length 128 characters and Content Validation for values in the Search Metadata Dictionary
  • This parameter must be set equal to a searchValue in the Search Metadata Dictionary. To access the metadata dictionary for Sortby searchValues, use the following end point: http://conflictapi.com/v1/api/Metadata/Sortby
  • Example: To search for Tongue Twisters sorted by best Star ratings, append &Sortby=rating

requirePictures

Setting this to “true” means to only return Tongue Twisters with images or Gifs links

  • Validation: Data Type Validation. Boolean only, max length 1 characters of 1 or 0.
  • Example: To search for Tongue Twisters which have pictures, append &requirePictures=true

allowedGenres

Specifying a Genre against the allowedGenres parameter means that all search results must include Tongue Twisters with the specified Genre(s) and will exclude any Tongue Twisters that do not contain the specified Genre(s). This parameter must be set equal to a searchValue in the Search Metadata Dictionary. The Genre parameter can be repeated more than once to specify more than one Genre.

  • Validation: Data Type Validation. String only, max length 1024 characters and Content Validation for values in the Search Metadata Dictionary
  • This parameter must be set equal to a searchValue in the ConflictAPI Metadata Dictionary. To access the metadata dictionary for allowedGenre searchValues, use the following end point: http://conflictapi.com/v1/api/Metadata/allowedGenre
  • Example: To search for Tongue Twisters which include only Humor Genres append &allowedGenres=Humor
  • Multiple Criteria Example: To search for Tongue Twisters which include both Humor and Horror in commas between each value : allowedGenres=Humor,Twisters
  • What are Genres: All Tongue Twisters descriptions are labeled with one genres of Humor. A literary genre is a popular categories of literary composition. Genres may be determined by literary technique, tone or content.
  • Examples of Genres: (for the full list of acceptable Genres, use the following endpoint: http://conflictapi.com/v1/api/Metadata/allowedGenres)
    FantasyModernDetectiveHorror
    SuperHeroHumorScience FictionWestern

allowedCollections

Specifying a Collection against the allowedCollections parameter means that all search results must include Tongue Twisters with the specified Collection (s) and will exclude any Tongue Twisters descriptions that do not contain the specified Collection (s). This parameter must be set equal to a searchValue in the Search Metadata Dictionary. The allowedCollections parameter can be repeated more than once to specify more than one Collections.

  • Validation: Data Type Validation. String only, max length 1024 characters and Content Validation for values in the Search Metadata Dictionary
  • This parameter must be set equal to a searchValue in the ConflictAPI Metadata Dictionary. To access the metadata dictionary for allowedCollections searchValues, use the following end point: http://conflictapi.com/v1/api/Metadata/allowedCollections
  • Example: To search for Tongue Twisters descriptions which are a part of the Not Safe For Work collection append &allowedCollections=NSFW
  • Multiple Criteria Example: To search for Tongue Twisters which include both Not safe for work and safe for work append &allowedCollections=NSFW&allowedCollections=SFW
  • What are Collections: Collections are subcategories of the Product Category. Nearly all Tongue Twisters descriptions are grouped into one subcategory. However, not all Tongue Twisters are within a collection, in these cases, the collection will be listed as "none"
  • For the full list of acceptable Collections, use the following endpoint: http://conflictapi.com/v1/api/Metadata/allowedCollections

allowedSeverity

Specifying a Severity against the allowedSeverity parameter means that all search results must include Tongue Twisters with the specified Severity(s) and will exclude any Tongue Twisters Descriptions that do not contain the specified Severity(s). This parameter must be set equal to a searchValue in the Search Metadata Dictionary. The Severity parameter can be repeated more than once to specify more than one Severity.

  • Validation: Data Type Validation. String only, max length 1024 characters and Content Validation for values in the Search Metadata Dictionary
  • This parameter must be set equal to a searchValue in the Search Metadata Dictionary. To access the metadata dictionary for allowedSeverity searchValues, use the following end point: http://conflictapi.com/v1/api/Metadata/allowedSeverity
  • Example: To search for Tongue Twisters which include only R-rated, Severity append &allowedSeverity=R
  • Multiple Criteria Example: To search for Tongue Twisters which include both R-rated and PG-Rated append &allowedSeverity=R,PG
  • What is Severity: Severity is subcategory of the Collections Category. Nearly all Tongue Twisters are grouped into one or more Severity.
  • Examples of Severity: (for the full list of acceptable Severity, use the following endpoint: http://conflictapi.com/v1/api/Metadata/allowedSeverity)
    PGPG-13
    RNC-17

allowedRating

Specifying a Rating against the allowedRating parameter means that all search results must have a rating greater than or equal to the specified Rating. This parameter must be set equal to a search Value in the Search Metadata Dictionary. The Rating parameter can NOT repeated more than once.

  • Validation: Data Type Validation. Number only, between 1 and 5.
  • Example: To search for slap Descriptions which have Ratings of 3 or greater append &allowedRating=3
  • The allowedRating parameter can NOT repeated more than once.

Id

is a number which uniquely identifies a description. This parameter allows you to store and retrieve specific Slaps. The ID parameter can be repeated more than once.

  • Validation: Data Type Validation. Number only.
  • Example: To search for Slaps with the id of 2432 append &id=2432
  • Example: To search for Slaps with ids 2432,2434,2433 append &id=2432,2434,2433

Returned attributes

  • id : The reference id for this Tongue Twisters that can be used to Uniquely identify the Tongue Twisters. For example, the ID can be used in GET API call for the full Description details from the Get Description API Call. id is Always present in response.
  • rating : The average public rating score for a Description.
  • ImageUrl : A link to an image which can be used with the Tongue Twister
  • Source : The display name of the source
  • ActionWord : Action word is the key word or phrase
  • Description : The narrative of the Tongue Twisters. THIS IS WHAT THE USERS WANTS TO SEE!
  • audiofile : if audio is available for the description a link will be presented here
  • productImageMED : Link to high level product image of Medium size.
  • productImageLG : Link to high level product image of large size.
  • contentImageSML : Link to image specific to the content. Image will be of small size.
  • contentImageMED : Link to image specific to the content. Image will be of Medium size.
  • contentImageLG : Link to image specific to the content. Image will be of Large size.
  • contentImageCard : link to card Background if available
  • isAd : Indicates if the content is considered a sponsored ad.
  • productid : the id of the product associated with the product.
  • buyLink : Link to site or location to purchase the source of the content
  • packID : the unique identifying number of the package associated to the content.
  • packageName : the unique name of the package associated to the content.

With HTTP Headers
curl -H 'app_id: X' -H 'app_key: Y' -X 
GET "http://conflictapi.com/v1/api/Twister?id=1,3&MaxRecords=40"
                                         
                       


With query parameters
curl -X 
GET "http://conflictapi.com/v1/api/Twister?app_id=X&app_key=Y&id=1,3&MaxRecords=40"
                                         
                       
With HTTP Headers
require 'rest-client'
require 'json'
 
params = {
  :params => {
    :app_id => 'X', 
    :app_key => 'Y'
  }
} 

response = RestClient.get 'http://conflictapi.com/v1/api/Twister?id=1,3&MaxRecords=40' params
JSON.parse(response)
                                         
                       


With query parameters
require 'rest-client'
require 'json'

response = RestClient.get 'http://conflictapi.com/v1/api/Twister?app_id=X&app_key=Y&id=1,3&MaxRecords=40'
JSON.parse(response)
                                         
                       
With HTTP Headers
import requests
headers = {'app_id': 'X', 'app_key':'Y' }
r = requests.get(
  'http://conflictapi.com/v1/api/Twister?id=1,3&MaxRecords=40', 
  headers=headers)
  #line breaks and indentation are for readability only.
r.json()
                                         
                       


With query parameters
import requests
r = requests.get(
  'http://conflictapi.com/v1/api/Twister?app_id=X&app_key=Y&id=1,3&MaxRecords=40')
  #line breaks and indentation are for readability only.
r.json()
                                         
                       
With HTTP Headers
$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 
    "http://conflictapi.com/v1/api/Twister?id=1,3&MaxRecords=40",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => array(
    'app_id': 'X', 
    'app_key':'Y'
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);
$json = json_decode($response, true);
                                         
                       


With query parameters
$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 
    "http://conflictapi.com/v1/api/Twister?app_id=X&app_key=Y&id=1,3&MaxRecords=40",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);
$json = json_decode($response, true);
                                         
                       
With HTTP Headers
String jsonResponse = null;    
try {
  URL object = new URL("http://conflictapi.com/v1/api/Twister?id=1,3&MaxRecords=40");

  HttpURLConnection connection = (HttpURLConnection) object
          .openConnection();
  
  connection.setReadTimeout(60 * 1000);
  connection.setConnectTimeout(60 * 1000);

  connection.setRequestProperty("app_id", "X");
  connection.setRequestProperty("app_key", "Y");
  int responseCode = connection.getResponseCode();            

  if (responseCode == 200) {
      InputStream inputStr = connection.getInputStream();
      String encoding = connection.getContentEncoding() == null ? "UTF-8"
              : connection.getContentEncoding();
      jsonResponse = IOUtils.toString(inputStr, encoding); 
  }
} catch (Exception e) {
  e.printStackTrace();
}
                                         
                       


With query parameters
String jsonResponse = null;    
try {
  URL object = new URL(
    "http://conflictapi.com/v1/api/Twister?app_id=X&app_key=Y&id=1,3&MaxRecords=40");

  HttpURLConnection connection = (HttpURLConnection) object
          .openConnection();
  
  connection.setReadTimeout(60 * 1000);
  connection.setConnectTimeout(60 * 1000);
  
  int responseCode = connection.getResponseCode();            

  if (responseCode == 200) {
      InputStream inputStr = connection.getInputStream();
      String encoding = connection.getContentEncoding() == null ? "UTF-8"
              : connection.getContentEncoding();
      jsonResponse = IOUtils.toString(inputStr, encoding); 
  }
} catch (Exception e) {
  e.printStackTrace();
} 
                                         
                       
With HTTP Headers
var request = require('request');

var options = {
  url: 'http://conflictapi.com/v1/api/Twister?id=1,3&MaxRecords=40',
  headers: {
    'app_id': 'X', 
    'app_key':'Y'
  }
};

function callback(error, response, body) {
  if (!error && response.statusCode == 200) {
    var info = JSON.parse(body);
    console.log(info.stargazers_count + " Stars");
    console.log(info.forks_count + " Forks");
  }
}

request(options, callback);
                                         
                       


With query parameters
var request = require('request');

var options = {
  url: 'http://conflictapi.com/v1/api/Twister?app_id=X&app_key=Y&id=1,3&MaxRecords=40',
};

function callback(error, response, body) {
  if (!error && response.statusCode == 200) {
    var info = JSON.parse(body);
    console.log(info.stargazers_count + " Stars");
    console.log(info.forks_count + " Forks");
  }
}

request(options, callback);
                                         
                       
With HTTP Headers
using (WebClient wc = new WebClient())
{
  wc.Headers.Add("app_id","your app id");
  wc.Headers.Add("app_key","your app key");
  var json = wc.
    DownloadString("http://conflictapi.com/v1/api/Twister?id=1,3&MaxRecords=40");
}
                                         
                       


With query parameters
using (WebClient wc = new WebClient())
{
  var json = wc.
    DownloadString("http://conflictapi.com/v1/api/Twister?app_id=X&app_key=Y&id=1,3&MaxRecords=40");
}
                                         
                       

Using the /Hairline endpoint

This endpoint allows performing GET requests to get Hairline Insults

The base url for Hairline Insults is http://conflictapi.com/v1/api/Hairline?_app_id=app-id&_app_key=app-key&your_search_parameters

To help us improve our content, we ask for developers to use the following metrics calls within their applications.

General Notes Regarding These Parameters

  • Default Values : Parameters marked as optional will be defaulted if not supplied.
  • First Parameter is always used : When a parameter is submitted more than once, only the first parameter and its values will be considered.
  • Case Sensitive : Parameters are not case sensitive unless specified.
  • Multiple Values : Some of the parameters will need to support passing multiple values; in these cases, please use comma separated values
  • Search Metadata Dictionaries : We keep dictionaries of the possible values of our search parameters which are defined in the section “Parameters”.
  • Redirect : The API may return a redirect HTTP status code (302) which you should follow

Parameters

q

Should be the search phrase generic search. With use space to separate words (url-encoded as either + or %20). Where the values provided may be found in the Hairline Insults Descriptions

  • This parameter is validated by Data Type, only Strings are allowed, max length 1024 characters.
  • Example: To search for Hairline Insults containing the words “Race Horse” append &q= Race+ Horse or q=Race%20 Horse
  • URI example:http://conflictapi.com/v1/api/Hairline?_app_id=YOUR_ID&_app_key=YOUR_APP_KEY&q=Race+Horse

MaxRecords

Specifying a MaxRecords against the MaxRecords parameter will limit the number of rows returned by the Call to the value presented. Where the values can be any positive number less than or equal to 50. The default value is 1. The Parameter can NOT be specified more than once.

  • Validation:Data Type Validation. Positive number, 50 or less.
    • Please Note: the API will automatically convert a Negative number to 1
  • Example:To return 10 slap, append &MaxRecords=10

SortBy

Specifying a Sortby against the Sortby parameter will sort the description by the field provided in descending order.

  • Validation: Data Type Validation. String only, max length 128 characters and Content Validation for values in the Search Metadata Dictionary
  • This parameter must be set equal to a searchValue in the Search Metadata Dictionary. To access the metadata dictionary for Sortby searchValues, use the following end point: http://conflictapi.com/v1/api/Metadata/Sortby
  • Example: To search for Hairline Insults sorted by best Star ratings, append &Sortby=rating

requirePictures

Setting this to “true” means to only return Hairline Insults with images or Gifs links

  • Validation: Data Type Validation. Boolean only, max length 1 characters of 1 or 0.
  • Example: To search for Hairline Insults which have pictures, append &requirePictures=true

allowedGenres

Specifying a Genre against the allowedGenres parameter means that all search results must include Hairline Insults with the specified Genre(s) and will exclude any Hairline Insults that do not contain the specified Genre(s). This parameter must be set equal to a searchValue in the Search Metadata Dictionary. The Genre parameter can be repeated more than once to specify more than one Genre.

  • Validation: Data Type Validation. String only, max length 1024 characters and Content Validation for values in the Search Metadata Dictionary
  • This parameter must be set equal to a searchValue in the ConflictAPI Metadata Dictionary. To access the metadata dictionary for allowedGenre searchValues, use the following end point: http://conflictapi.com/v1/api/Metadata/allowedGenre
  • Example: To search for Hairline Insults which include only Humor Genres append &allowedGenres=Humor
  • Multiple Criteria Example: To search for Hairline Insults which include both Humor and Horror in commas between each value : allowedGenres=Humor,Hairline Insults
  • What are Genres: All Hairline Insults descriptions are labeled with one genres of Humor. A literary genre is a popular categories of literary composition. Genres may be determined by literary technique, tone or content.
  • Examples of Genres: (for the full list of acceptable Genres, use the following endpoint: http://conflictapi.com/v1/api/Metadata/allowedGenres)
    FantasyModernDetectiveHorror
    SuperHeroHumorScience FictionWestern

allowedCollections

Specifying a Collection against the allowedCollections parameter means that all search results must include Hairline Insults with the specified Collection (s) and will exclude any Hairline Insults descriptions that do not contain the specified Collection (s). This parameter must be set equal to a searchValue in the Search Metadata Dictionary. The allowedCollections parameter can be repeated more than once to specify more than one Collections.

  • Validation: Data Type Validation. String only, max length 1024 characters and Content Validation for values in the Search Metadata Dictionary
  • This parameter must be set equal to a searchValue in the ConflictAPI Metadata Dictionary. To access the metadata dictionary for allowedCollections searchValues, use the following end point: http://conflictapi.com/v1/api/Metadata/allowedCollections
  • Example: To search for Hairline Insults descriptions which are a part of the Not Safe For Work collection append &allowedCollections=NSFW
  • Multiple Criteria Example: To search for Hairline Insults which include both Not safe for work and safe for work append &allowedCollections=NSFW&allowedCollections=SFW
  • What are Collections: Collections are subcategories of the Product Category. Nearly all Hairline Insults descriptions are grouped into one subcategory. However, not all Hairline Insults are within a collection, in these cases, the collection will be listed as "none"
  • For the full list of acceptable Collections, use the following endpoint: http://conflictapi.com/v1/api/Metadata/allowedCollections

allowedSeverity

Specifying a Severity against the allowedSeverity parameter means that all search results must include Hairline Insults with the specified Severity(s) and will exclude any Hairline Insults Descriptions that do not contain the specified Severity(s). This parameter must be set equal to a searchValue in the Search Metadata Dictionary. The Severity parameter can be repeated more than once to specify more than one Severity.

  • Validation: Data Type Validation. String only, max length 1024 characters and Content Validation for values in the Search Metadata Dictionary
  • This parameter must be set equal to a searchValue in the Search Metadata Dictionary. To access the metadata dictionary for allowedSeverity searchValues, use the following end point: http://conflictapi.com/v1/api/Metadata/allowedSeverity
  • Example: To search for Hairline Insults which include only R-rated, Severity append &allowedSeverity=R
  • Multiple Criteria Example: To search for Hairline Insults which include both R-rated and PG-Rated append &allowedSeverity=R,PG
  • What is Severity: Severity is subcategory of the Collections Category. Nearly all Hairline Insults are grouped into one or more Severity.
  • Examples of Severity: (for the full list of acceptable Severity, use the following endpoint: http://conflictapi.com/v1/api/Metadata/allowedSeverity)
    PGPG-13
    RNC-17

allowedRating

Specifying a Rating against the allowedRating parameter means that all search results must have a rating greater than or equal to the specified Rating. This parameter must be set equal to a search Value in the Search Metadata Dictionary. The Rating parameter can NOT repeated more than once.

  • Validation: Data Type Validation. Number only, between 1 and 5.
  • Example: To search for slap Descriptions which have Ratings of 3 or greater append &allowedRating=3
  • The allowedRating parameter can NOT repeated more than once.

Id

is a number which uniquely identifies a description. This parameter allows you to store and retrieve specific Slaps. The ID parameter can be repeated more than once.

  • Validation: Data Type Validation. Number only.
  • Example: To search for Slaps with the id of 333 append &id=333
  • Example: To search for Slaps with ids, 333,111,444 append &id=333&id=111&id=444

Returned attributes

  • id : The reference id for this Hairline Insults that can be used to Uniquely identify the Hairline Insults. For example, the ID can be used in GET API call for the full Description details from the Get Description API Call. id is Always present in response.
  • rating : The average public rating score for a Description.
  • ImageUrl : A link to an image which can be used with the Tongue Hairline
  • Source : The display name of the source
  • ActionWord : Action word is the key word or phrase
  • Description : The narrative of the Hairline Insults. THIS IS WHAT THE USERS WANTS TO SEE!
  • audiofile : if audio is available for the description a link will be presented here
  • productImageMED : Link to high level product image of Medium size.
  • productImageLG : Link to high level product image of large size.
  • contentImageSML : Link to image specific to the content. Image will be of small size.
  • contentImageMED : Link to image specific to the content. Image will be of Medium size.
  • contentImageLG : Link to image specific to the content. Image will be of Large size.
  • contentImageCard : link to card Background if available
  • isAd : Indicates if the content is considered a sponsored ad.
  • productid : the id of the product associated with the product.
  • buyLink : Link to site or location to purchase the source of the content
  • packID : the unique identifying number of the package associated to the content.
  • packageName : the unique name of the package associated to the content.

With HTTP Headers
curl -H 'app_id: X' -H 'app_key: Y' -X 
GET "http://conflictapi.com/v1/api/Hairline?id=1,3&MaxRecords=40"
                                         
                       


With query parameters
curl -X 
GET "http://conflictapi.com/v1/api/Hairline?app_id=X&app_key=Y&id=1,3&MaxRecords=40"
                                         
                       
With HTTP Headers
require 'rest-client'
require 'json'
 
params = {
  :params => {
    :app_id => 'X', 
    :app_key => 'Y'
  }
} 

response = RestClient.get 'http://conflictapi.com/v1/api/Hairline?id=1,3&MaxRecords=40' params
JSON.parse(response)
                                         
                       


With query parameters
require 'rest-client'
require 'json'

response = RestClient.get 'http://conflictapi.com/v1/api/Hairline?app_id=X&app_key=Y&id=1,3&MaxRecords=40'
JSON.parse(response)
                                         
                       
With HTTP Headers
import requests
headers = {'app_id': 'X', 'app_key':'Y' }
r = requests.get(
  'http://conflictapi.com/v1/api/Hairline?id=1,3&MaxRecords=40', 
  headers=headers)
  #line breaks and indentation are for readability only.
r.json()
                                         
                       


With query parameters
import requests
r = requests.get(
  'http://conflictapi.com/v1/api/Hairline?app_id=X&app_key=Y&id=1,3&MaxRecords=40')
  #line breaks and indentation are for readability only.
r.json()
                                         
                       
With HTTP Headers
$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 
    "http://conflictapi.com/v1/api/Hairline?id=1,3&MaxRecords=40",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => array(
    'app_id': 'X', 
    'app_key':'Y'
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);
$json = json_decode($response, true);
                                         
                       


With query parameters
$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 
    "http://conflictapi.com/v1/api/Hairline?app_id=X&app_key=Y&id=1,3&MaxRecords=40",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);
$json = json_decode($response, true);
                                         
                       
With HTTP Headers
String jsonResponse = null;    
try {
  URL object = new URL("http://conflictapi.com/v1/api/Hairline?id=1,3&MaxRecords=40");

  HttpURLConnection connection = (HttpURLConnection) object
          .openConnection();
  
  connection.setReadTimeout(60 * 1000);
  connection.setConnectTimeout(60 * 1000);

  connection.setRequestProperty("app_id", "X");
  connection.setRequestProperty("app_key", "Y");
  int responseCode = connection.getResponseCode();            

  if (responseCode == 200) {
      InputStream inputStr = connection.getInputStream();
      String encoding = connection.getContentEncoding() == null ? "UTF-8"
              : connection.getContentEncoding();
      jsonResponse = IOUtils.toString(inputStr, encoding); 
  }
} catch (Exception e) {
  e.printStackTrace();
}
                                         
                       


With query parameters
String jsonResponse = null;    
try {
  URL object = new URL(
    "http://conflictapi.com/v1/api/Hairline?app_id=X&app_key=Y&id=1,3&MaxRecords=40");

  HttpURLConnection connection = (HttpURLConnection) object
          .openConnection();
  
  connection.setReadTimeout(60 * 1000);
  connection.setConnectTimeout(60 * 1000);
  
  int responseCode = connection.getResponseCode();            

  if (responseCode == 200) {
      InputStream inputStr = connection.getInputStream();
      String encoding = connection.getContentEncoding() == null ? "UTF-8"
              : connection.getContentEncoding();
      jsonResponse = IOUtils.toString(inputStr, encoding); 
  }
} catch (Exception e) {
  e.printStackTrace();
}
                                         
                       
With HTTP Headers
var request = require('request');

var options = {
  url: 'http://conflictapi.com/v1/api/Hairline?id=1,3&MaxRecords=40',
  headers: {
    'app_id': 'X', 
    'app_key':'Y'
  }
};

function callback(error, response, body) {
  if (!error && response.statusCode == 200) {
    var info = JSON.parse(body);
    console.log(info.stargazers_count + " Stars");
    console.log(info.forks_count + " Forks");
  }
}

request(options, callback);
                                         
                       


With query parameters
var request = require('request');

var options = {
  url: 'http://conflictapi.com/v1/api/Hairline?app_id=X&app_key=Y&id=1,3&MaxRecords=40',
};

function callback(error, response, body) {
  if (!error && response.statusCode == 200) {
    var info = JSON.parse(body);
    console.log(info.stargazers_count + " Stars");
    console.log(info.forks_count + " Forks");
  }
}

request(options, callback);
                                         
                       
With HTTP Headers
using (WebClient wc = new WebClient())
{
  wc.Headers.Add("app_id","your app id");
  wc.Headers.Add("app_key","your app key");
  var json = wc.
    DownloadString("http://conflictapi.com/v1/api/Hairline?id=1,3&MaxRecords=40");
}
                                         
                       


With query parameters
using (WebClient wc = new WebClient())
{
  var json = wc.
    DownloadString("http://conflictapi.com/v1/api/Hairline?app_id=X&app_key=Y&id=1,3&MaxRecords=40");
}
                                         
                       

Using the /Love endpoint

This endpoint allows performing GET requests to retrieve Love Descriptions

The base url for Love Descriptions is http://conflictapi.com/v1/api/Love?_app_id=app-id&_app_key=app-key&your_search_parameters

To help us improve our content, we ask for developers to use the following metrics calls within their applications.

General Notes Regarding These Parameters

  • Default Values : Parameters marked as optional will be defaulted if not supplied.
  • First Parameter is always used : When a parameter is submitted more than once, only the first parameter and its values will be considered.
  • Case Sensitive : Parameters are not case sensitive unless specified.
  • Multiple Values : Some of the parameters will need to support passing multiple values; in these cases, please use comma separated values
  • Search Metadata Dictionaries : We keep dictionaries of the possible values of our search parameters which are defined in the section “Parameters”.
  • Redirect : The API may return a redirect HTTP status code (302) which you should follow

Parameters

q

Should be the search phrase generic search. With use space to separate words (url-encoded as either + or %20). Where the values provided may be found in the Love Descriptions Descriptions

  • This parameter is validated by Data Type, only Strings are allowed, max length 1024 characters.
  • Example: To search for Love Descriptions containing the words “Race Horse” append &q= Race+ Horse or q=Race%20 Horse
  • URI example:http://conflictapi.com/v1/api/Love?_app_id=YOUR_ID&_app_key=YOUR_APP_KEY&q=Race+Horse

MaxRecords

Specifying a MaxRecords against the MaxRecords parameter will limit the number of rows returned by the Call to the value presented. Where the values can be any positive number less than or equal to 50. The default value is 1. The Parameter can NOT be specified more than once.

  • Validation:Data Type Validation. Positive number, 50 or less.
    • Please Note: the API will automatically convert a Negative number to 1
  • Example:To return 10 slap, append &MaxRecords=10

SortBy

Specifying a Sortby against the Sortby parameter will sort the description by the field provided in descending order.

  • Validation: Data Type Validation. String only, max length 128 characters and Content Validation for values in the Search Metadata Dictionary
  • This parameter must be set equal to a searchValue in the Search Metadata Dictionary. To access the metadata dictionary for Sortby searchValues, use the following end point: http://conflictapi.com/v1/api/Metadata/Sortby
  • Example: To search for Love Descriptions sorted by best Star ratings, append &Sortby=rating

requirePictures

Setting this to “true” means to only return Love Descriptions with images or Gifs links

  • Validation: Data Type Validation. Boolean only, max length 1 characters of 1 or 0.
  • Example: To search for Love Descriptions which have pictures, append &requirePictures=true

allowedGenres

Specifying a Genre against the allowedGenres parameter means that all search results must include Love Descriptions with the specified Genre(s) and will exclude any Love Descriptions that do not contain the specified Genre(s). This parameter must be set equal to a searchValue in the Search Metadata Dictionary. The Genre parameter can be repeated more than once to specify more than one Genre.

  • Validation: Data Type Validation. String only, max length 1024 characters and Content Validation for values in the Search Metadata Dictionary
  • This parameter must be set equal to a searchValue in the ConflictAPI Metadata Dictionary. To access the metadata dictionary for allowedGenre searchValues, use the following end point: http://conflictapi.com/v1/api/Metadata/allowedGenre
  • Example: To search for Love Descriptions which include only Humor Genres append &allowedGenres=Humor
  • Multiple Criteria Example: To search for Love Descriptions which include both Humor and Horror in commas between each value : allowedGenres=Humor,Loves
  • What are Genres: All Love Descriptions descriptions are labeled with one genres of Humor. A literary genre is a popular categories of literary composition. Genres may be determined by literary technique, tone or content.
  • Examples of Genres: (for the full list of acceptable Genres, use the following endpoint: http://conflictapi.com/v1/api/Metadata/allowedGenres)
    FantasyModernDetectiveHorror
    SuperHeroHumorScience FictionWestern

allowedCollections

Specifying a Collection against the allowedCollections parameter means that all search results must include Love Descriptions with the specified Collection (s) and will exclude any Love Descriptions descriptions that do not contain the specified Collection (s). This parameter must be set equal to a searchValue in the Search Metadata Dictionary. The allowedCollections parameter can be repeated more than once to specify more than one Collections.

  • Validation: Data Type Validation. String only, max length 1024 characters and Content Validation for values in the Search Metadata Dictionary
  • This parameter must be set equal to a searchValue in the ConflictAPI Metadata Dictionary. To access the metadata dictionary for allowedCollections searchValues, use the following end point: http://conflictapi.com/v1/api/Metadata/allowedCollections
  • Example: To search for Love Descriptions descriptions which are a part of the Not Safe For Work collection append &allowedCollections=NSFW
  • Multiple Criteria Example: To search for Love Descriptions which include both Not safe for work and safe for work append &allowedCollections=NSFW&allowedCollections=SFW
  • What are Collections: Collections are subcategories of the Product Category. Nearly all Love Descriptions descriptions are grouped into one subcategory. However, not all Love Descriptions are within a collection, in these cases, the collection will be listed as "none"
  • For the full list of acceptable Collections, use the following endpoint: http://conflictapi.com/v1/api/Metadata/allowedCollections

allowedSeverity

Specifying a Severity against the allowedSeverity parameter means that all search results must include Love Descriptions with the specified Severity(s) and will exclude any Love Descriptions Descriptions that do not contain the specified Severity(s). This parameter must be set equal to a searchValue in the Search Metadata Dictionary. The Severity parameter can be repeated more than once to specify more than one Severity.

  • Validation: Data Type Validation. String only, max length 1024 characters and Content Validation for values in the Search Metadata Dictionary
  • This parameter must be set equal to a searchValue in the Search Metadata Dictionary. To access the metadata dictionary for allowedSeverity searchValues, use the following end point: http://conflictapi.com/v1/api/Metadata/allowedSeverity
  • Example: To search for Love Descriptions which include only R-rated, Severity append &allowedSeverity=R
  • Multiple Criteria Example: To search for Love Descriptions which include both R-rated and PG-Rated append &allowedSeverity=R,PG
  • What is Severity: Severity is subcategory of the Collections Category. Nearly all Love Descriptions are grouped into one or more Severity.
  • Examples of Severity: (for the full list of acceptable Severity, use the following endpoint: http://conflictapi.com/v1/api/Metadata/allowedSeverity)
    PGPG-13
    RNC-17

allowedRating

Specifying a Rating against the allowedRating parameter means that all search results must have a rating greater than or equal to the specified Rating. This parameter must be set equal to a search Value in the Search Metadata Dictionary. The Rating parameter can NOT repeated more than once.

  • Validation: Data Type Validation. Number only, between 1 and 5.
  • Example: To search for slap Descriptions which have Ratings of 3 or greater append &allowedRating=3
  • The allowedRating parameter can NOT repeated more than once.

Id

is a number which uniquely identifies a description. This parameter allows you to store and retrieve specific Slaps. The ID parameter can be repeated more than once.

  • Validation: Data Type Validation. Number only.
  • Example: To search for Slaps with the id of 22442 append &id=22442
  • Example: To search for Slaps with ids, 22442,2443,2442 append &id=22442,2443,2442

Returned attributes

  • id : The reference id for this Love Descriptions that can be used to Uniquely identify the Love Descriptions. For example, the ID can be used in GET API call for the full Description details from the Get Description API Call. id is Always present in response.
  • rating : The average public rating score for a Description.
  • ImageUrl : A link to an image which can be used with the Tongue Love
  • Source : The display name of the source
  • ActionWord : Action word is the key word or phrase
  • Description : The narrative of the Love Descriptions. THIS IS WHAT THE USERS WANTS TO SEE!
  • audiofile : if audio is available for the description a link will be presented here
  • productImageMED : Link to high level product image of Medium size.
  • productImageLG : Link to high level product image of large size.
  • contentImageSML : Link to image specific to the content. Image will be of small size.
  • contentImageMED : Link to image specific to the content. Image will be of Medium size.
  • contentImageLG : Link to image specific to the content. Image will be of Large size.
  • contentImageCard : link to card Background if available
  • isAd : Indicates if the content is considered a sponsored ad.
  • productid : the id of the product associated with the product.
  • buyLink : Link to site or location to purchase the source of the content
  • packID : the unique identifying number of the package associated to the content.
  • packageName : the unique name of the package associated to the content.

With HTTP Headers
curl -H 'app_id: X' -H 'app_key: Y' -X 
GET "http://conflictapi.com/v1/api/Love?id=1,3&MaxRecords=40"
                                         
                       


With query parameters
curl -X 
GET "http://conflictapi.com/v1/api/Love?app_id=X&app_key=Y&id=1,3&MaxRecords=40"
                                         
                       
With HTTP Headers
require 'rest-client'
require 'json'
 
params = {
  :params => {
    :app_id => 'X', 
    :app_key => 'Y'
  }
} 

response = RestClient.get 'http://conflictapi.com/v1/api/Love?id=1,3&MaxRecords=40' params
JSON.parse(response)
                                         
                       


With query parameters
require 'rest-client'
require 'json'

response = RestClient.get 'http://conflictapi.com/v1/api/Love?app_id=X&app_key=Y&id=1,3&MaxRecords=40'
JSON.parse(response)
                                         
                       
With HTTP Headers
import requests
headers = {'app_id': 'X', 'app_key':'Y' }
r = requests.get(
  'http://conflictapi.com/v1/api/Love?id=1,3&MaxRecords=40', 
  headers=headers)
  #line breaks and indentation are for readability only.
r.json()
                                         
                       


With query parameters
import requests
r = requests.get(
  'http://conflictapi.com/v1/api/Love?app_id=X&app_key=Y&id=1,3&MaxRecords=40')
  #line breaks and indentation are for readability only.
r.json()
                                         
                       
With HTTP Headers
$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 
    "http://conflictapi.com/v1/api/Love?id=1,3&MaxRecords=40",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => array(
    'app_id': 'X', 
    'app_key':'Y'
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);
$json = json_decode($response, true);
                                         
                       


With query parameters
$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 
    "http://conflictapi.com/v1/api/Love?app_id=X&app_key=Y&id=1,3&MaxRecords=40",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);
$json = json_decode($response, true);
                                         
                       
With HTTP Headers
String jsonResponse = null;    
try {
  URL object = new URL("http://conflictapi.com/v1/api/Love?id=1,3&MaxRecords=40");

  HttpURLConnection connection = (HttpURLConnection) object
          .openConnection();
  
  connection.setReadTimeout(60 * 1000);
  connection.setConnectTimeout(60 * 1000);

  connection.setRequestProperty("app_id", "X");
  connection.setRequestProperty("app_key", "Y");
  int responseCode = connection.getResponseCode();            

  if (responseCode == 200) {
      InputStream inputStr = connection.getInputStream();
      String encoding = connection.getContentEncoding() == null ? "UTF-8"
              : connection.getContentEncoding();
      jsonResponse = IOUtils.toString(inputStr, encoding); 
  }
} catch (Exception e) {
  e.printStackTrace();
}
                                         
                       


With query parameters
String jsonResponse = null;    
try {
  URL object = new URL(
    "http://conflictapi.com/v1/api/Love?app_id=X&app_key=Y&id=1,3&MaxRecords=40");

  HttpURLConnection connection = (HttpURLConnection) object
          .openConnection();
  
  connection.setReadTimeout(60 * 1000);
  connection.setConnectTimeout(60 * 1000);
  
  int responseCode = connection.getResponseCode();            

  if (responseCode == 200) {
      InputStream inputStr = connection.getInputStream();
      String encoding = connection.getContentEncoding() == null ? "UTF-8"
              : connection.getContentEncoding();
      jsonResponse = IOUtils.toString(inputStr, encoding); 
  }
} catch (Exception e) {
  e.printStackTrace();
}
                                         
                       
With HTTP Headers
var request = require('request');

var options = {
  url: 'http://conflictapi.com/v1/api/Love?id=1,3&MaxRecords=40',
  headers: {
    'app_id': 'X', 
    'app_key':'Y'
  }
};

function callback(error, response, body) {
  if (!error && response.statusCode == 200) {
    var info = JSON.parse(body);
    console.log(info.stargazers_count + " Stars");
    console.log(info.forks_count + " Forks");
  }
}

request(options, callback);
                                         
                       


With query parameters
var request = require('request');

var options = {
  url: 'http://conflictapi.com/v1/api/Love?app_id=X&app_key=Y&id=1,3&MaxRecords=40',
};

function callback(error, response, body) {
  if (!error && response.statusCode == 200) {
    var info = JSON.parse(body);
    console.log(info.stargazers_count + " Stars");
    console.log(info.forks_count + " Forks");
  }
}

request(options, callback);
                                         
                       
With HTTP Headers
using (WebClient wc = new WebClient())
{
  wc.Headers.Add("app_id","your app id");
  wc.Headers.Add("app_key","your app key");
  var json = wc.
    DownloadString("http://conflictapi.com/v1/api/Love?id=1,3&MaxRecords=40");
}
                                         
                       


With query parameters
using (WebClient wc = new WebClient())
{
  var json = wc.
    DownloadString("http://conflictapi.com/v1/api/Love?app_id=X&app_key=Y&id=1,3&MaxRecords=40");
}
                                         
                       

Using the /Appreciate endpoint

This endpoint allows performing GET requests to retieve Appreciate Descriptions

The base url for Appreciate Descriptions is http://conflictapi.com/v1/api/Appreciate?_app_id=app-id&_app_key=app-key&your_search_parameters

To help us improve our content, we ask for developers to use the following metrics calls within their applications.

General Notes Regarding These Parameters

  • Default Values : Parameters marked as optional will be defaulted if not supplied.
  • First Parameter is always used : When a parameter is submitted more than once, only the first parameter and its values will be considered.
  • Case Sensitive : Parameters are not case sensitive unless specified.
  • Multiple Values : Some of the parameters will need to support passing multiple values; in these cases, please use comma separated values
  • Search Metadata Dictionaries : We keep dictionaries of the possible values of our search parameters which are defined in the section “Parameters”.
  • Redirect : The API may return a redirect HTTP status code (302) which you should follow

Parameters

q

Should be the search phrase generic search. With use space to separate words (url-encoded as either + or %20). Where the values provided may be found in the Appreciate Descriptions Descriptions

  • This parameter is validated by Data Type, only Strings are allowed, max length 1024 characters.
  • Example: To search for Appreciate Descriptions containing the words "Race Horse" append &q=Race+Horse or q=Race%20Horse
  • URI example:http://conflictapi.com/v1/api/Appreciate?_app_id=YOUR_ID&_app_key=YOUR_APP_KEY&q=Race+Horse

MaxRecords

Specifying a MaxRecords against the MaxRecords parameter will limit the number of rows returned by the Call to the value presented. Where the values can be any positive number less than or equal to 50. The default value is 1. The Parameter can NOT be specified more than once.

  • Validation:Data Type Validation. Positive number, 50 or less.
    • Please Note: the API will automatically convert a Negative number to 1
  • Example:To return 10 slap, append &MaxRecords=10

SortBy

Specifying a Sortby against the Sortby parameter will sort the description by the field provided in descending order.

  • Validation: Data Type Validation. String only, max length 128 characters and Content Validation for values in the Search Metadata Dictionary
  • This parameter must be set equal to a searchValue in the Search Metadata Dictionary. To access the metadata dictionary for Sortby searchValues, use the following end point: http://conflictapi.com/v1/api/Metadata/Sortby
  • Example: To search for Appreciate Descriptions sorted by best Star ratings, append &Sortby=rating

requirePictures

Setting this to “true” means to only return Appreciate Descriptions with images or Gifs links

  • Validation: Data Type Validation. Boolean only, max length 1 characters of 1 or 0.
  • Example: To search for Appreciate Descriptions which have pictures, append &requirePictures=true

allowedGenres

Specifying a Genre against the allowedGenres parameter means that all search results must include Appreciate Descriptions with the specified Genre(s) and will exclude any Appreciate Descriptions that do not contain the specified Genre(s). This parameter must be set equal to a searchValue in the Search Metadata Dictionary. The Genre parameter can be repeated more than once to specify more than one Genre.

  • Validation: Data Type Validation. String only, max length 1024 characters and Content Validation for values in the Search Metadata Dictionary
  • This parameter must be set equal to a searchValue in the ConflictAPI Metadata Dictionary. To access the metadata dictionary for allowedGenre searchValues, use the following end point: http://conflictapi.com/v1/api/Metadata/allowedGenre
  • Example: To search for Appreciate Descriptions which include only Humor Genres append &allowedGenres=Humor
  • Multiple Criteria Example: To search for Appreciate Descriptions which include both Humor and Horror in commas between each value : allowedGenres=Humor,Appreciates
  • What are Genres: All Appreciate Descriptions descriptions are labeled with one genres of Humor. A literary genre is a popular categories of literary composition. Genres may be determined by literary technique, tone or content.
  • Examples of Genres: (for the full list of acceptable Genres, use the following endpoint: http://conflictapi.com/v1/api/Metadata/allowedGenres)
    FantasyModernDetectiveHorror
    SuperHeroHumorScience FictionWestern

allowedCollections

Specifying a Collection against the allowedCollections parameter means that all search results must include Appreciate Descriptions with the specified Collection (s) and will exclude any Appreciate Descriptions descriptions that do not contain the specified Collection (s). This parameter must be set equal to a searchValue in the Search Metadata Dictionary. The allowedCollections parameter can be repeated more than once to specify more than one Collections.

  • Validation: Data Type Validation. String only, max length 1024 characters and Content Validation for values in the Search Metadata Dictionary
  • This parameter must be set equal to a searchValue in the ConflictAPI Metadata Dictionary. To access the metadata dictionary for allowedCollections searchValues, use the following end point: http://conflictapi.com/v1/api/Metadata/allowedCollections
  • Example: To search for Appreciate Descriptions descriptions which are a part of the Not Safe For Work collection append &allowedCollections=NSFW
  • Multiple Criteria Example: To search for Appreciate Descriptions which include both Not safe for work and safe for work append &allowedCollections=NSFW&allowedCollections=SFW
  • What are Collections: Collections are subcategories of the Product Category. Nearly all Appreciate Descriptions descriptions are grouped into one subcategory. However, not all Appreciate Descriptions are within a collection, in these cases, the collection will be listed as "none"
  • For the full list of acceptable Collections, use the following endpoint: http://conflictapi.com/v1/api/Metadata/allowedCollections

allowedSeverity

Specifying a Severity against the allowedSeverity parameter means that all search results must include Appreciate Descriptions with the specified Severity(s) and will exclude any Appreciate Descriptions Descriptions that do not contain the specified Severity(s). This parameter must be set equal to a searchValue in the Search Metadata Dictionary. The Severity parameter can be repeated more than once to specify more than one Severity.

  • Validation: Data Type Validation. String only, max length 1024 characters and Content Validation for values in the Search Metadata Dictionary
  • This parameter must be set equal to a searchValue in the Search Metadata Dictionary. To access the metadata dictionary for allowedSeverity searchValues, use the following end point: http://conflictapi.com/v1/api/Metadata/allowedSeverity
  • Example: To search for Appreciate Descriptions which include only R-rated, Severity append &allowedSeverity=R
  • Multiple Criteria Example: To search for Appreciate Descriptions which include both R-rated and PG-Rated append &allowedSeverity=R,PG
  • What is Severity: Similar to the U.S. (MPAA) film rating system Severity is used to rate a the content's suitability for certain audiences based on its language.
  • Examples of Severity: (for the full list of acceptable Severity, use the following endpoint: http://conflictapi.com/v1/api/Metadata/allowedSeverity)
    PGPG-13
    RNC-17

allowedRating

Specifying a Rating against the allowedRating parameter means that all search results must have a rating greater than or equal to the specified Rating. This parameter must be set equal to a search Value in the Search Metadata Dictionary. The Rating parameter can NOT repeated more than once.

  • Validation: Data Type Validation. Number only, between 1 and 5.
  • Example: To search for slap Descriptions which have Ratings of 3 or greater append &allowedRating=3
  • The allowedRating parameter can NOT repeated more than once.

Id

is a number which uniquely identifies a description. This parameter allows you to store and retrieve specific Slaps. The ID parameter can be repeated more than once.

  • Validation: Data Type Validation. Number only.
  • Example: To search for Slaps with the id of 2449 append &id=2449
  • Example: To search for Slaps with ids, 2449,2448,2447 append &id=2449&id=2448&id=2447

Returned attributes

  • id : The reference id for this Appreciate Descriptions that can be used to Uniquely identify the Appreciate Descriptions. For example, the ID can be used in GET API call for the full Description details from the Get Description API Call. id is Always present in response.
  • rating : The average public rating score for a Description.
  • ImageUrl : A link to an image which can be used with the Tongue Appreciate
  • Source : The display name of the source
  • ActionWord : Action word is the key word or phrase
  • Description : The narrative of the Appreciate Descriptions. THIS IS WHAT THE USERS WANTS TO SEE!
  • audiofile : if audio is available for the description a link will be presented here
  • productImageMED : Link to high level product image of Medium size.
  • productImageLG : Link to high level product image of large size.
  • contentImageSML : Link to image specific to the content. Image will be of small size.
  • contentImageMED : Link to image specific to the content. Image will be of Medium size.
  • contentImageLG : Link to image specific to the content. Image will be of Large size.
  • contentImageCard : link to card Background if available
  • isAd : Indicates if the content is considered a sponsored ad.
  • productid : the id of the product associated with the product.
  • buyLink : Link to site or location to purchase the source of the content
  • packID : the unique identifying number of the package associated to the content.
  • packageName : the unique name of the package associated to the content.

With HTTP Headers
curl -H 'app_id: X' -H 'app_key: Y' -X 
GET "http://conflictapi.com/v1/api/Appreciate?id=1,3&MaxRecords=40"
                                         
                       


With query parameters
curl -X 
GET "http://conflictapi.com/v1/api/Appreciate?app_id=X&app_key=Y&id=1,3&MaxRecords=40"
                                         
                       
With HTTP Headers
require 'rest-client'
require 'json'
 
params = {
  :params => {
    :app_id => 'X', 
    :app_key => 'Y'
  }
} 

response = RestClient.get 'http://conflictapi.com/v1/api/Appreciate?id=1,3&MaxRecords=40' params
JSON.parse(response)
                                         
                       


With query parameters
require 'rest-client'
require 'json'

response = RestClient.get 'http://conflictapi.com/v1/api/Appreciate?app_id=X&app_key=Y&id=1,3&MaxRecords=40'
JSON.parse(response)
                                         
                       
With HTTP Headers
import requests
headers = {'app_id': 'X', 'app_key':'Y' }
r = requests.get(
  'http://conflictapi.com/v1/api/Appreciate?id=1,3&MaxRecords=40', 
  headers=headers)
  #line breaks and indentation are for readability only.
r.json()
                                         
                       


With query parameters
import requests
r = requests.get(
  'http://conflictapi.com/v1/api/Appreciate?app_id=X&app_key=Y&id=1,3&MaxRecords=40')
  #line breaks and indentation are for readability only.
r.json()
                                         
                       
With HTTP Headers
$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 
    "http://conflictapi.com/v1/api/Appreciate?id=1,3&MaxRecords=40",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => array(
    'app_id': 'X', 
    'app_key':'Y'
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);
$json = json_decode($response, true);
                                         
                       


With query parameters
$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 
    "http://conflictapi.com/v1/api/Appreciate?app_id=X&app_key=Y&id=1,3&MaxRecords=40",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);
$json = json_decode($response, true);
                                         
                       
With HTTP Headers
String jsonResponse = null;    
try {
  URL object = new URL("http://conflictapi.com/v1/api/Appreciate?id=1,3&MaxRecords=40");

  HttpURLConnection connection = (HttpURLConnection) object
          .openConnection();
  
  connection.setReadTimeout(60 * 1000);
  connection.setConnectTimeout(60 * 1000);

  connection.setRequestProperty("app_id", "X");
  connection.setRequestProperty("app_key", "Y");
  int responseCode = connection.getResponseCode();            

  if (responseCode == 200) {
      InputStream inputStr = connection.getInputStream();
      String encoding = connection.getContentEncoding() == null ? "UTF-8"
              : connection.getContentEncoding();
      jsonResponse = IOUtils.toString(inputStr, encoding); 
  }
} catch (Exception e) {
  e.printStackTrace();
} 
                                         
                       


With query parameters
String jsonResponse = null;    
try {
  URL object = new URL(
    "http://conflictapi.com/v1/api/Appreciate?app_id=X&app_key=Y&id=1,3&MaxRecords=40");

  HttpURLConnection connection = (HttpURLConnection) object
          .openConnection();
  
  connection.setReadTimeout(60 * 1000);
  connection.setConnectTimeout(60 * 1000);
  
  int responseCode = connection.getResponseCode();            

  if (responseCode == 200) {
      InputStream inputStr = connection.getInputStream();
      String encoding = connection.getContentEncoding() == null ? "UTF-8"
              : connection.getContentEncoding();
      jsonResponse = IOUtils.toString(inputStr, encoding); 
  }
} catch (Exception e) {
  e.printStackTrace();
} 
                                         
                       
With HTTP Headers
var request = require('request');

var options = {
  url: 'http://conflictapi.com/v1/api/Appreciate?id=1,3&MaxRecords=40',
  headers: {
    'app_id': 'X', 
    'app_key':'Y'
  }
};

function callback(error, response, body) {
  if (!error && response.statusCode == 200) {
    var info = JSON.parse(body);
    console.log(info.stargazers_count + " Stars");
    console.log(info.forks_count + " Forks");
  }
}

request(options, callback);
                                         
                       


With query parameters
var request = require('request');

var options = {
  url: 'http://conflictapi.com/v1/api/Appreciate?app_id=X&app_key=Y&id=1,3&MaxRecords=40',
};

function callback(error, response, body) {
  if (!error && response.statusCode == 200) {
    var info = JSON.parse(body);
    console.log(info.stargazers_count + " Stars");
    console.log(info.forks_count + " Forks");
  }
}

request(options, callback);
                                         
                       
With HTTP Headers
using (WebClient wc = new WebClient())
{
  wc.Headers.Add("app_id","your app id");
  wc.Headers.Add("app_key","your app key");
  var json = wc.
    DownloadString("http://conflictapi.com/v1/api/Appreciate?id=1,3&MaxRecords=40");
}
                                         
                       


With query parameters
using (WebClient wc = new WebClient())
{
  var json = wc.
    DownloadString("http://conflictapi.com/v1/api/Appreciate?app_id=X&app_key=Y&id=1,3&MaxRecords=40");
}
                                         
                       

/MetaData endpoint documentation

We keep dictionaries of the possible values of our search parameters which are defined in the section "Parameters". Each parameter documented in the "Parameters" section contains a link to the corresponding metadata dictionary.

The base url for the MetaData GET is http://conflictapi.com/v1/api/MetaData

Parameters

Parameter

Please Note: The parameter you want to get information on, goes after /Metadata in the URI. This is different than appending the &parmeter as other api calls. Please See the example below:

  • This parameter is REQUIRED
  • Validation: Data Type Validation. String only, max length 1024 characters
  • Example: To search for safe values under the allowed packages parameter /v1/api/Metadata/allowedPublishers
  • Example: http://conflictapi.com/v1/api/Metadata/allowedPublishers?appid=YOUR_ID&_appkey=YOURAPP_KEY&allowedPackages=
    'Slapbot,CombatDescriptionCards'

Returned attributes

  • Metadata : A comma separated list of Values safe to use as criteria.
    • Example: "Conflict Games, MN-Games"

With HTTP Headers
curl -H 'app_id: X' -H 'app_key: Y' -X 
GET "http://conflictapi.com/v1/api/Metadata/allowedPublishers"
                                         
                       


With query parameters
curl -X 
GET "http://conflictapi.com/v1/api/Metadata/allowedPublishers?app_id=X&app_key=Y"
                                         
                       
With HTTP Headers
require 'rest-client'
require 'json'
 
params = {
  :params => {
    :app_id => 'X', 
    :app_key => 'Y'
  }
} 

response = RestClient.get "http://conflictapi.com/v1/api/Metadata/allowedPublishers" params
JSON.parse(response)
                                         
                       


With query parameters
require 'rest-client'
require 'json'

response = RestClient.get "http://conflictapi.com/v1/api/Metadata/allowedPublishers?app_id=X&app_key=Y"
JSON.parse(response)
                                         
                       
With HTTP Headers
import requests
headers = {'app_id': 'X', 'app_key':'Y' }
r = requests.get(
  'http://conflictapi.com/v1/api/Metadata/allowedPublishers', 
  headers=headers)
  #line breaks and indentation are for readability only.
r.json()
                                         
                       


With query parameters
import requests
r = requests.get(
  "http://conflictapi.com/v1/api/Metadata/allowedPublishers?app_id=X&app_key=Y")
  #line breaks and indentation are for readability only.
r.json()
                                         
                       
With HTTP Headers
$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 
    "http://conflictapi.com/v1/api/Metadata/allowedPublishers",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => array(
    'app_id': 'X', 
    'app_key':'Y'
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);
$json = json_decode($response, true);
                                         
                       


With query parameters
$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 
    "http://conflictapi.com/v1/api/Metadata/allowedPublishers?app_id=X&app_key=Y",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);
$json = json_decode($response, true);
                                         
                       
With HTTP Headers
String jsonResponse = null;    
try {
  URL object = new URL("http://conflictapi.com/v1/api/Metadata/allowedPublishers");

  HttpURLConnection connection = (HttpURLConnection) object
          .openConnection();
  
  connection.setReadTimeout(60 * 1000);
  connection.setConnectTimeout(60 * 1000);

  connection.setRequestProperty("app_id", "X");
  connection.setRequestProperty("app_key", "Y");
  int responseCode = connection.getResponseCode();            

  if (responseCode == 200) {
      InputStream inputStr = connection.getInputStream();
      String encoding = connection.getContentEncoding() == null ? "UTF-8"
              : connection.getContentEncoding();
      jsonResponse = IOUtils.toString(inputStr, encoding); 
  }
} catch (Exception e) {
  e.printStackTrace();
}
                                         
                       


With query parameters
String jsonResponse = null;    
try {
  URL object = new URL(
    "http://conflictapi.com/v1/api/Metadata/allowedPublishers?app_id=X&app_key=Y");

  HttpURLConnection connection = (HttpURLConnection) object
          .openConnection();
  
  connection.setReadTimeout(60 * 1000);
  connection.setConnectTimeout(60 * 1000);
  
  int responseCode = connection.getResponseCode();            

  if (responseCode == 200) {
      InputStream inputStr = connection.getInputStream();
      String encoding = connection.getContentEncoding() == null ? "UTF-8"
              : connection.getContentEncoding();
      jsonResponse = IOUtils.toString(inputStr, encoding); 
  }
} catch (Exception e) {
  e.printStackTrace();
} 
                                         
                       
With HTTP Headers
var request = require('request');

var options = {
  url: "http://conflictapi.com/v1/api/Metadata/allowedPublishers",
  headers: {
    'app_id': 'X', 
    'app_key':'Y'
  }
};

function callback(error, response, body) {
  if (!error && response.statusCode == 200) {
    var info = JSON.parse(body);
    console.log(info.stargazers_count + " Stars");
    console.log(info.forks_count + " Forks");
  }
}

request(options, callback);
                                         
                       


With query parameters
var request = require('request');

var options = {
  url: "http://conflictapi.com/v1/api/Metadata/allowedPublishers?app_id=X&app_key=Y",
};

function callback(error, response, body) {
  if (!error && response.statusCode == 200) {
    var info = JSON.parse(body);
    console.log(info.stargazers_count + " Stars");
    console.log(info.forks_count + " Forks");
  }
}

request(options, callback);
                                         
                       
With HTTP Headers
using (WebClient wc = new WebClient())
{
  wc.Headers.Add("app_id","your app id");
  wc.Headers.Add("app_key","your app key");
  var json = wc.
    DownloadString("http://conflictapi.com/v1/api/Metadata/allowedPublishers");
}
                                         
                       


With query parameters
using (WebClient wc = new WebClient())
{
  var json = wc.
    DownloadString("http://conflictapi.com/v1/api/Metadata/allowedPublishers?app_id=X&app_key=Y");
}
                                         
                       

/TAGS endpoint documentation

The tags end point provides hashtags that are linked to Phrases. For example, the following hashtags are linked to slap descriptions.

#JustBecauseSlap#PottyMouthSlap#SexySlap#SlapFight

What's a hashtag?

A hashtag is a keyword or phrase preceded by the hash symbol (#). It can be used during texting or post to make the content of the post more discoverable, readable and funny to the recipient or folks conducting a search.

Parameters

allowedPackages

Specifying values against the allowedPackages parameter means that all search results must include tags linked to specified Package(s) and will exclude any tags that are not linked to the specified Package (s). The values provided when using this parameter must be equal to a value in the Search Metadata Dictionary. The allowedPackages parameter can be repeated more than once to specify more than one inclusive Package. This is done with the use of comma separated values.

  • THIS PARAMETER IS REQUIRED
  • Validation: Data Type Validation. String only, max length 1024 characters and Content Validation for values in the Search Metadata Dictionary.
  • This parameter must be set equal to a searchValue in the ConflictAPI Metadata Dictionary. To access the metadata dictionary for allowedPackages search values, use the following end point: http://conflictapi.com/v1/api/Metadatasearch?app_id=YOUR_APP_ID&app_key=Your_APP_key&lookup=
    allowedPackages
  • Example: To search for tags which are a linked to the Slap.bot package append &allowedPackages=Slapbot
  • Multiple Criteria Example: To search for multiple packages which include both Slaps and Tonguetwisters append &allowedPackages='Slapbot,CombatDescriptionCards'
  • What are Packages: A Package is the highest category of products offered by the Conflict API. Everything offered by the ConflictAPI is firstly organized into a package. Examples of Packages: (for the full list of acceptable Packages, use the following endpoint: http://conflictapi.com/v1/api/Metadatasearch?app_id=YOUR_APP_ID&app_key=Your_APP_key&lookup=
    allowedPackages
    )

allowedProducts

Specifying values against the allowedProducts parameter means that all search results must include tags within the specified Product(s) and will exclude any descriptions that do not contain the specified Product(s). This parameter must be equal to a value in the Search Metadata Dictionary. The allowedProducts parameter can be repeated more than once to specify more than one inclusive Product. This is done with the use of comma separated values.

  • NOT Required
  • Validation: Data Type Validation. String only, max length 1024 characters and Content Validation for values in the Search Metadata Dictionary
  • This parameter must be set equal to a searchValue in the ConflictAPI Metadata Dictionary. To access the metadata dictionary for allowedProducts search values, use the following end point: http://conflictapi.com/v1/api/Metadatasearch?app_id=YOUR_APP_ID&app_key=Your_APP_key&lookup=
    allowedproducts
  • Example: To search for tags which are a linked to the Slaps product append &allowedProducts=Slaps
  • Multiple Criteria Example: To search for tags with multiple products such as Slaps and Tonguetwisters append &allowedProducts=Slapbot,Tonguetwisters
  • What are Products: A product is the second highest categorization offered by the Conflict API. Every product is first in a package Everything offered by the ConflictAPI is firstly organized into a package followed by product. Therefore, one package could have multiple products (but not the reverse).
  • Examples of Products: (for the full list of acceptable products, use the following endpoint: http://conflictapi.com/v1/api/Metadatasearch?app_id=YOUR_APP_ID&app_key=Your_APP_key&lookup=
    allowedproducts
    )
    LabyrinthIII IntentPainPiercing
    Character DistinctionsEnvironmentsExpressionsEvilEye
    SuperHeroHumorScience FictionWestern
    SlapTongueTwisterYoMamaInsults

allowedCollections

Specifying a Collection against the allowedCollections parameter means that all search results must include tags with the specified Collection(s) and will exclude any tags that do not contain the specified Collection(s).

  • In the Search Metadata Dictionary. The allowedCollections parameter can be repeated more than once to specify tags with more than one Collections.
  • Validation: Data Type Validation. String only, max length 1024 characters and Content Validation for values in the Search Metadata Dictionary
  • This parameter must be set equal to a searchValue in the ConflictAPI Metadata Dictionary. To access the metadata dictionary for allowedCollections searchValues, use the following end point: http://conflictapi.com/v1/api/Metadatasearch?app_id=YOUR_APP_ID&app_key=Your_APP_key&lookup=
    allowedCollections
  • Example: To search for tags which are a part of the Jungles collection append &allowedCollections=Jungles
  • Multiple Criteria Example: To search for tags which include both Power and Finesse append &allowedCollections=Power,Finesse
  • What are Collections: Collections are subcategories of the Product Category. Most tags are not within a collection, in these cases, the collection will be listed as "" (empty string)
  • Examples of Collection: (for the full list of acceptable Collections, use the following endpoint: http://conflictapi.com/v1/api/Metadatasearch?app_id=YOUR_APP_ID&app_key=Your_APP_key&lookup=
    allowedCollections
    )

allowedGenres

Specifying a Genre against the allowedGenre parameter means that all search results must include tags with the specified Genre(s) and will exclude any tags that do not contain the specified Genre(s). This parameter must be set equal to a searchValue in the Search Metadata Dictionary. The Genre parameter can be repeated more than once to specify more than one Genre. This is done with the use of comma separated values.

  • Validation: Data Type Validation. String only, max length 1024 characters and Content Validation for values in the Search Metadata Dictionary
  • This parameter must be set equal to a searchValue in the ConflictAPI Metadata Dictionary. To access the metadata dictionary for allowedGenre searchValues, use the following end point: http://conflictapi.com/v1/api/Metadatasearch?app_id=YOUR_APP_ID&app_key=Your_APP_key&lookup=
    allowedGenre
  • Example: To search for tags which include only R-rated Genres append &allowedGenres=R
  • Multiple Criteria Example: To search for tags which include both R-rated and PG-Rated in commas between each value : allowedGenre=R,PG
  • URI example : http://conflictapi.com/v1/api/slap?app_id=YOUR_ID&app_key=YOUR_APP_KEY&allowedPackages=
    slapbot&allowedGenres=Humor,Fantasy

MaxRecords

Specifying a MaxRecords against the MaxRecords parameter will limit the number of rows returned by the Call to the value presented. Where the values can be any positive number less than or equal to 50. The default value is 1. The Parameter can NOT be specified more than once.

  • Validation:Data Type Validation. Positive number 50 or less
    • Please Note: the API will automatically convert a Negative number to 1
  • Example:To return 10 tags, append &MaxRecords=10

q

performs and returns the results of a generic search. With use space to separate words (url-encoded as either + or %20). Where the values provided may be found in the Slap Descriptions.

  • This parameter is validated by Data Type, only Strings are allowed, max length 1024 characters.
  • Example: To search for slaps containing the words "grilled cheese" append &q=grilled+cheese or &q=grilled%20cheese

Id

Id is a number which uniquely identifies a description. This parameter allows you to store and retrieve tags specific to the content ID you specified. The ID parameter cannot be repeated more than once. When submitting this endpoint this is NOT the id of the returning tags, but the ID of the description which are looking for associating tags.

  • Validation: Data Type Validation. Number only.
  • Example: To search for tags linked to description id of 2428 append &id=2428
  • Multiple Criteria Example: To search for tags linked to specific Descriptions with ids of 2428 or 2429 send &id=2428,2429

Languages

Specifying a Language(s) against the Languages parameter means that all search Results must include tags with the specified Language(s) and will exclude any tags that do not contain the specified Language(s).The language parameter may accept a 2 character ISO-639-1 language code. The default is 'EN'.

PackId

Is a number which uniquely identifies a Package. This parameter allows you to store and retrieve tags specific to the PackID you specified. The packID parameter can be repeated more than once. Validation: Data Type Validation. Number only.

  • Example: To search for tags linked to a package 4 via Packid, simply add &packid=4 to the end point.
  • Multiple Criteria Example: To search for tags linked to specific package with ids of 3 or 4 send &packid=3,4
  • What are Packages: A Package is the highest category of products offered by the Conflict API. Everything offered by the ConflictAPI is firstly organized into a package. Examples of Packages: (for the full list of acceptable Packages, use the following endpoint: http://conflictapi.com/v1/api/Metadatasearch?app_id=YOUR_APP_ID&app_key=Your_APP_key&lookup=
    allowedPackages
    )

productId

is a number which uniquely identifies a product. This parameter allows you to store and retrieve specific tags linked to a product(s). The productId parameter can be repeated more than once.

  • Validation: Data Type Validation. Number only.
  • Example: To search for tags linked to productid of 4 append &productId=4
  • Multiple Criteria Example: To search for Descriptions with ids 13,23 and append &productidid=1,23

Attributes returned

  • TAGID : is specific to a Conflictapi. It is an integer value that represents the index of a Tag in the ConflictAPI
  • tags : hashtags or words associated with the description. Tag is the keyword

With HTTP Headers
curl -H 'app_id: X' -H 'app_key: Y' -X 
GET "http://conflictapi.com/v1/api/tags?id=1,3&activeOnly=false"
                                         
                       


With query parameters
curl -X 
GET "http://conflictapi.com/v1/api/tags?app_id=X&app_key=Y&id=1,3&activeOnly=false"
                                         
                       
With HTTP Headers
require 'rest-client'
require 'json'
 
params = {
  :params => {
    :app_id => 'X', 
    :app_key => 'Y'
  }
} 

response = RestClient.get 'http://conflictapi.com/v1/api/tags?id=1,3&activeOnly=false' params
JSON.parse(response)
                                         
                       


With query parameters
require 'rest-client'
require 'json'

response = RestClient.get 'http://conflictapi.com/v1/api/tags?app_id=X&app_key=Y&id=1,3&activeOnly=false'
JSON.parse(response)
                                         
                       
With HTTP Headers
import requests
headers = {'app_id': 'X', 'app_key':'Y' }
r = requests.get(
  'http://conflictapi.com/v1/api/tags?id=1,3&activeOnly=false', 
  headers=headers)
  #line breaks and indentation are for readability only.
r.json()
                                         
                       


With query parameters
import requests
r = requests.get(
  'http://conflictapi.com/v1/api/tags?app_id=X&app_key=Y&id=1,3&activeOnly=false')
  #line breaks and indentation are for readability only.
r.json()
                                         
                       
With HTTP Headers
$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 
    "http://conflictapi.com/v1/api/tags?id=1,3&activeOnly=false",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => array(
    'app_id': 'X', 
    'app_key':'Y'
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);
$json = json_decode($response, true);
                                         
                       


With query parameters
$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 
    "http://conflictapi.com/v1/api/tags?app_id=X&app_key=Y&id=1,3&activeOnly=false",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);
$json = json_decode($response, true);
                                         
                       
With HTTP Headers
String jsonResponse = null;    
try {
  URL object = new URL("http://conflictapi.com/v1/api/tags?id=1,3&activeOnly=false");

  HttpURLConnection connection = (HttpURLConnection) object
          .openConnection();
  
  connection.setReadTimeout(60 * 1000);
  connection.setConnectTimeout(60 * 1000);

  connection.setRequestProperty("app_id", "X");
  connection.setRequestProperty("app_key", "Y");
  int responseCode = connection.getResponseCode();            

  if (responseCode == 200) {
      InputStream inputStr = connection.getInputStream();
      String encoding = connection.getContentEncoding() == null ? "UTF-8"
              : connection.getContentEncoding();
      jsonResponse = IOUtils.toString(inputStr, encoding); 
  }
} catch (Exception e) {
  e.printStackTrace();
} 
                                         
                       


With query parameters
String jsonResponse = null;    
try {
  URL object = new URL(
    "http://conflictapi.com/v1/api/tags?app_id=X&app_key=Y&id=1,3&activeOnly=false");

  HttpURLConnection connection = (HttpURLConnection) object
          .openConnection();
  
  connection.setReadTimeout(60 * 1000);
  connection.setConnectTimeout(60 * 1000);
  
  int responseCode = connection.getResponseCode();            

  if (responseCode == 200) {
      InputStream inputStr = connection.getInputStream();
      String encoding = connection.getContentEncoding() == null ? "UTF-8"
              : connection.getContentEncoding();
      jsonResponse = IOUtils.toString(inputStr, encoding); 
  }
} catch (Exception e) {
  e.printStackTrace();
}  
                                         
                       
With HTTP Headers
var request = require('request');

var options = {
  url: 'http://conflictapi.com/v1/api/tags?id=1,3&activeOnly=false',
  headers: {
    'app_id': 'X', 
    'app_key':'Y'
  }
};

function callback(error, response, body) {
  if (!error && response.statusCode == 200) {
    var info = JSON.parse(body);
    console.log(info.stargazers_count + " Stars");
    console.log(info.forks_count + " Forks");
  }
}

request(options, callback);
                                         
                       


With query parameters
var request = require('request');

var options = {
  url: 'http://conflictapi.com/v1/api/tags?app_id=X&app_key=Y&id=1,3&activeOnly=false',
};

function callback(error, response, body) {
  if (!error && response.statusCode == 200) {
    var info = JSON.parse(body);
    console.log(info.stargazers_count + " Stars");
    console.log(info.forks_count + " Forks");
  }
}

request(options, callback);
                                         
                       
With HTTP Headers
using (WebClient wc = new WebClient())
{
  wc.Headers.Add("app_id","your app id");
  wc.Headers.Add("app_key","your app key");
  var json = wc.
    DownloadString("http://conflictapi.com/v1/api/tags?id=1,3&activeOnly=false");
}
                                         
                       


With query parameters
using (WebClient wc = new WebClient())
{
  var json = wc.
    DownloadString("http://conflictapi.com/v1/api/tags?app_id=X&app_key=Y&id=1,3&activeOnly=false");
}
                                         
                       

/ProductList endpoint documentation

Get a list of all API product names, images and product content sizes for this API.

The base url for the ProductList GET is http://conflictapi.com/v1/api/ProductList

Parameters

overReleaseDate

It is supplied in the following format "yyyy-mm-dd". Specifying a Date against the overReleaseDate parameter means that all search Results must have been released to the public greater than the specified date. Product release prior to the specified date will be excluded. Multiple values are not accepted .

  • Validation: Data Type Validation. Valid Date only specided in the following format "yyyy-mm-dd".
  • Example: To search for products released in append &overReleaseDate=2018-01-01

MaxRecords

Specifying a MaxRecords against the MaxRecords[] parameter will limit the number of rows returned by the Call to the value presented. Where the values can be any positive number less than or equal to 50. The default value is 1. The Parameter can NOT be specified more than once.

  • Validation:Data Type Validation. Positive number, 50 or less.
    • Please Note: the API will automatically convert a Negative number to 1
  • Example:To return 10 slap, append &MaxRecords=10

productId

is a number which uniquely identifies a product. This parameter allows you to store and retrieve specific tags linked to a product(s). The productId parameter can be repeated more than once.

  • Validation: Data Type Validation. Number only.
  • Example: To search for tags linked to productid of 4, append &productId=4
  • Multiple Criteria Example: To search for Descriptions with ids, 13,23 and append &productidid=1,23

allowedPublishers

Specifying Publishers against the allowedPublishers parameter means that all search results will exclude any product where the publisher is not listed as the owner of that product. This parameter must be set equal to a searchValue in the Search Metadata Dictionary. The allowedPublishers parameter can be repeated more than once to specify more than one allowed Publisher.

  • Validation: Data Type Validation. String only, max length 1024 characters and Content Validation for values in the Search Metadata Dictionary
  • This parameter must be set equal to a searchValue in the ConflictAPI Metadata Dictionary. To access the metadata dictionary for allowedPublishers search Values, use the following end point : http://conflictapi.com/v1/api/Metadata/allowedPublishers
  • Example: To search for products which include those from Conflict Games, append &allowedPublishers=Conflict%20Games
  • Multiple Criteria Example: To search for products from Conflict games and MN-Games append &allowedPublishers=Conflict%20Games&allowedPublishers=MN-Games
  • What are Publishers?: publishers are the person or company which owns the rights to the content and has licensed or granted use of the content. How to get a list of Publishers: For the full list of acceptable Publishers names, use the following endpoint: http://conflictapi.com/v1/api/Metadata/allowedPublishers

allowedPackages

Specifying values against the allowedPackages parameter means that all search results must include tags linked to specified Package(s) and will exclude any tags that are not linked to the specified Package (s). The values provided when using this parameter must be equal to a value in the Search Metadata Dictionary. The allowedPackages parameter can be repeated more than once to specify more than one inclusive Package. This is done with the use of comma separated values.

  • THIS PARAMETER IS REQUIRED
  • Validation: Data Type Validation. String only, max length 1024 characters and Content Validation for values in the Search Metadata Dictionary.
  • This parameter must be set equal to a searchValue in the ConflictAPI Metadata Dictionary. To access the metadata dictionary for allowedPackages search values, use the following end point: http://conflictapi.com/v1/api/Metadata/allowedPackages
  • Example: To search for tags which are a linked to the Slap.bot package append &allowedPackages=Slapbot
  • Multiple Criteria Example: To search for multiple packages which include both Slaps and Tonguetwisters append &allowedPackages='Slapbot,CombatDescriptionCards'
  • What are Packages: A Package is the highest category of products offered by the Conflict API. Everything offered by the ConflictAPI is firstly organized into a package. Examples of Packages: (for the full list of acceptable Packages, use the following endpoint: http://conflictapi.com/v1/api/Metadata/allowedPackages)

Returned attributes

  • prodID : is a number which uniquely identifies a product. This parameter allows you to store and retrieve specific tags linked to a product(s).
  • productName : Used by a manufacturer or merchant to identify its products distinctively from others.

With HTTP Headers
curl -H 'app_id: X' -H 'app_key: Y' -X 
GET "http://conflictapi.com/v1/api/ProductList?allowedPackages='Slapbot,CombatDescriptionCards'"
                                         
                       


With query parameters
curl -X 
GET "http://conflictapi.com/v1/api/ProductList?app_id=X&app_key=Y&allowedPackages='Slapbot,CombatDescriptionCards'"
                                         
                       
With HTTP Headers
require 'rest-client'
require 'json'
 
params = {
  :params => {
    :app_id => 'X', 
    :app_key => 'Y'
  }
} 

response = RestClient.get "http://conflictapi.com/v1/api/ProductList?allowedPackages='Slapbot,CombatDescriptionCards'" params
JSON.parse(response)
                                         
                       


With query parameters
require 'rest-client'
require 'json'

response = RestClient.get "http://conflictapi.com/v1/api/ProductList?app_id=X&app_key=Y&allowedPackages='Slapbot,CombatDescriptionCards'"
JSON.parse(response)
                                         
                       
With HTTP Headers
import requests
headers = {'app_id': 'X', 'app_key':'Y' }
r = requests.get(
  'http://conflictapi.com/v1/api/ProductList?allowedPackages='Slapbot,CombatDescriptionCards'', 
  headers=headers)
  #line breaks and indentation are for readability only.
r.json()
                                         
                       


With query parameters
import requests
r = requests.get(
  "http://conflictapi.com/v1/api/ProductList?app_id=X&app_key=Y&allowedPackages='Slapbot,CombatDescriptionCards'")
  #line breaks and indentation are for readability only.
r.json()
                                         
                       
With HTTP Headers
$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 
    "http://conflictapi.com/v1/api/ProductList?allowedPackages='Slapbot,CombatDescriptionCards'",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => array(
    'app_id': 'X', 
    'app_key':'Y'
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);
$json = json_decode($response, true);
                                         
                       


With query parameters
$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 
    "http://conflictapi.com/v1/api/ProductList?app_id=X&app_key=Y&allowedPackages='Slapbot,CombatDescriptionCards'",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);
$json = json_decode($response, true);
                                         
                       
With HTTP Headers
String jsonResponse = null;    
try {
  URL object = new URL("http://conflictapi.com/v1/api/ProductList?allowedPackages='Slapbot,CombatDescriptionCards'");

  HttpURLConnection connection = (HttpURLConnection) object
          .openConnection();
  
  connection.setReadTimeout(60 * 1000);
  connection.setConnectTimeout(60 * 1000);

  connection.setRequestProperty("app_id", "X");
  connection.setRequestProperty("app_key", "Y");
  int responseCode = connection.getResponseCode();            

  if (responseCode == 200) {
      InputStream inputStr = connection.getInputStream();
      String encoding = connection.getContentEncoding() == null ? "UTF-8"
              : connection.getContentEncoding();
      jsonResponse = IOUtils.toString(inputStr, encoding); 
  }
} catch (Exception e) {
  e.printStackTrace();
} 
                                         
                       


With query parameters
String jsonResponse = null;    
try {
  URL object = new URL(
    "http://conflictapi.com/v1/api/ProductList?app_id=X&app_key=Y&allowedPackages='Slapbot,CombatDescriptionCards'");

  HttpURLConnection connection = (HttpURLConnection) object
          .openConnection();
  
  connection.setReadTimeout(60 * 1000);
  connection.setConnectTimeout(60 * 1000);
  
  int responseCode = connection.getResponseCode();            

  if (responseCode == 200) {
      InputStream inputStr = connection.getInputStream();
      String encoding = connection.getContentEncoding() == null ? "UTF-8"
              : connection.getContentEncoding();
      jsonResponse = IOUtils.toString(inputStr, encoding); 
  }
} catch (Exception e) {
  e.printStackTrace();
} 
                                         
                       
With HTTP Headers
var request = require('request');

var options = {
  url: "http://conflictapi.com/v1/api/ProductList?allowedPackages='Slapbot,CombatDescriptionCards'",
  headers: {
    'app_id': 'X', 
    'app_key':'Y'
  }
};

function callback(error, response, body) {
  if (!error && response.statusCode == 200) {
    var info = JSON.parse(body);
    console.log(info.stargazers_count + " Stars");
    console.log(info.forks_count + " Forks");
  }
}

request(options, callback);
                                         
                       


With query parameters
var request = require('request');

var options = {
  url: "http://conflictapi.com/v1/api/ProductList?app_id=X&app_key=Y&allowedPackages='Slapbot,CombatDescriptionCards'",
};

function callback(error, response, body) {
  if (!error && response.statusCode == 200) {
    var info = JSON.parse(body);
    console.log(info.stargazers_count + " Stars");
    console.log(info.forks_count + " Forks");
  }
}

request(options, callback);
                                         
                       
With HTTP Headers
using (WebClient wc = new WebClient())
{
  wc.Headers.Add("app_id","your app id");
  wc.Headers.Add("app_key","your app key");
  var json = wc.
    DownloadString("http://conflictapi.com/v1/api/ProductList?allowedPackages='Slapbot,CombatDescriptionCards'");
}
                                         
                       


With query parameters
using (WebClient wc = new WebClient())
{
  var json = wc.
    DownloadString("http://conflictapi.com/v1/api/ProductList?app_id=X&app_key=Y&allowedPackages='Slapbot,CombatDescriptionCards'");
}
                                         
                       

/SetContentEdit endpoint documentation

Users may suggest changes to improve the content with in the API. These suggestions are reviewed periodically and credit is provided to the user. The ContentEdit is used to provide the details of a users suggestions

The base url for the SetContentEdit GET is http://conflictapi.com/v1/api/SetContentEdit

Parameters

NameDescriptionTypeAdditional information
contentida number which uniquely identifies a description.integerRequired
ContentEditis this string value of the offered suggestion.stringRequired
SessionIDany value that uniquely identifies in user sessionstring
UserIDUser keystring

contentid

is a number which uniquely identifies a description. This parameter is required to Identify which the description the suggestion pertains to. It is the same number/id you receive during Description GET calls such as (/slaps or /desc)

  • This parameter is REQUIRED.
  • The ID parameter cannot be repeated more than once.
  • Validation: Data Type Validation. Integer only
  • Example: To send suggestions for descriptions with the id of 111 append &id=111

ContentEdit

is this string value of the offered suggestion.

  • This parameter is REQUIRED
  • The ContentEdit parameter cannot be repeated more than once.
  • Validation: String only, max length 1024 characters, should not contain special characters
  • Example: To send suggestions for descriptions with the id of 111 and a suggested text of "You're Mamma is so fat, she jump up in the air and got stuck" &Contentid=5&contentedit=You%27re+Mamma+is+so+fat%2C+she+jumped+up+in+the+air+and+got+stuck
  • For example:
    {
    "id": 111,
    " contentedit ": "You're Mamma is so fat, she jump up in the air and got stuck",
    }

SessionID

is any value that uniquely identifies a user’s session

  • This parameter is NOT required
  • The SessionID parameter cannot be repeated more than once.
  • Validation: String only, max length 1024 characters
  • Example: To send suggestions for descriptions with the id of 111 append &SessionID=0fce6c05939c2a4d9f5c

UserID

Unique ID given to a user

  • This parameter is NOT required
  • The Userid parameter cannot be repeated more than once. Repeated Parameters will be ignored.
  • Validation: String only, max length 1024 characters
  • Example: To send suggestions for descriptions with the userid of 111 append &UserID=111

Returned attributes

values: "Success" or "Failure"

With HTTP Headers
curl -H 'app_id: X' -H 'app_key: Y' -X 
GET "http://conflictapi.com/v1/api/Suggest?contentedit=You%27re+Mamma+is+so+fat%2C+she+jumped+up+in+the+air+and+got+stuck&SessionID=0fce6c05939c2a4d9f5c"
                                       
                       


With query parameters
curl -X 
GET "http://conflictapi.com/v1/api/Suggest?app_id=X&app_key=Y&contentedit=You%27re+Mamma+is+so+fat%2C+she+jumped+up+in+the+air+and+got+stuck&SessionID=0fce6c05939c2a4d9f5c"
                                       
                       
With HTTP Headers
require 'rest-client'
require 'json'
 
params = {
  :params => {
    :app_id => 'X', 
    :app_key => 'Y'
  }
} 

response = RestClient.get "http://conflictapi.com/v1/api/Suggest?contentedit=You%27re+Mamma+is+so+fat%2C+she+jumped+up+in+the+air+and+got+stuck&SessionID=0fce6c05939c2a4d9f5c" params
JSON.parse(response)
                                       
                       


With query parameters
require 'rest-client'
require 'json'

response = RestClient.get "http://conflictapi.com/v1/api/Suggest?app_id=X&app_key=Y&contentedit=You%27re+Mamma+is+so+fat%2C+she+jumped+up+in+the+air+and+got+stuck&SessionID=0fce6c05939c2a4d9f5c"
JSON.parse(response)
                                       
                       
With HTTP Headers
import requests
headers = {'app_id': 'X', 'app_key':'Y' }
r = requests.get(
  'http://conflictapi.com/v1/api/Suggest?contentedit=You%27re+Mamma+is+so+fat%2C+she+jumped+up+in+the+air+and+got+stuck&SessionID=0fce6c05939c2a4d9f5c', 
  headers=headers)
  #line breaks and indentation are for readability only.
r.json()
                                       
                       


With query parameters
import requests
r = requests.get(
  "http://conflictapi.com/v1/api/Suggest?app_id=X&app_key=Y&contentedit=You%27re+Mamma+is+so+fat%2C+she+jumped+up+in+the+air+and+got+stuck&SessionID=0fce6c05939c2a4d9f5c")
  #line breaks and indentation are for readability only.
r.json()
                                       
                       
With HTTP Headers
$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 
    "http://conflictapi.com/v1/api/Suggest?contentedit=You%27re+Mamma+is+so+fat%2C+she+jumped+up+in+the+air+and+got+stuck&SessionID=0fce6c05939c2a4d9f5c",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => array(
    'app_id': 'X', 
    'app_key':'Y'
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);
$json = json_decode($response, true);
                                       
                       


With query parameters
$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 
    "http://conflictapi.com/v1/api/Suggest?app_id=X&app_key=Y&contentedit=You%27re+Mamma+is+so+fat%2C+she+jumped+up+in+the+air+and+got+stuck&SessionID=0fce6c05939c2a4d9f5c",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);
$json = json_decode($response, true);
                                       
                       
With HTTP Headers
String jsonResponse = null;    
try {
  URL object = new URL("http://conflictapi.com/v1/api/Suggest?contentedit=You%27re+Mamma+is+so+fat%2C+she+jumped+up+in+the+air+and+got+stuck&SessionID=0fce6c05939c2a4d9f5c");

  HttpURLConnection connection = (HttpURLConnection) object
          .openConnection();
  
  connection.setReadTimeout(60 * 1000);
  connection.setConnectTimeout(60 * 1000);

  connection.setRequestProperty("app_id", "X");
  connection.setRequestProperty("app_key", "Y");
  int responseCode = connection.getResponseCode();            

  if (responseCode == 200) {
      InputStream inputStr = connection.getInputStream();
      String encoding = connection.getContentEncoding() == null ? "UTF-8"
              : connection.getContentEncoding();
      jsonResponse = IOUtils.toString(inputStr, encoding); 
  }
} catch (Exception e) {
  e.printStackTrace();
} 
                                       
                       


With query parameters
String jsonResponse = null;    
try {
  URL object = new URL(
    "http://conflictapi.com/v1/api/Suggest?app_id=X&app_key=Y&contentedit=You%27re+Mamma+is+so+fat%2C+she+jumped+up+in+the+air+and+got+stuck&SessionID=0fce6c05939c2a4d9f5c");

  HttpURLConnection connection = (HttpURLConnection) object
          .openConnection();
  
  connection.setReadTimeout(60 * 1000);
  connection.setConnectTimeout(60 * 1000);
  
  int responseCode = connection.getResponseCode();            

  if (responseCode == 200) {
      InputStream inputStr = connection.getInputStream();
      String encoding = connection.getContentEncoding() == null ? "UTF-8"
              : connection.getContentEncoding();
      jsonResponse = IOUtils.toString(inputStr, encoding); 
  }
} catch (Exception e) {
  e.printStackTrace();
} 
                                       
                       
With HTTP Headers
var request = require('request');

var options = {
  url: "http://conflictapi.com/v1/api/Suggest?contentedit=You%27re+Mamma+is+so+fat%2C+she+jumped+up+in+the+air+and+got+stuck&SessionID=0fce6c05939c2a4d9f5c",
  headers: {
    'app_id': 'X', 
    'app_key':'Y'
  }
};

function callback(error, response, body) {
  if (!error && response.statusCode == 200) {
    var info = JSON.parse(body);
    console.log(info.stargazers_count + " Stars");
    console.log(info.forks_count + " Forks");
  }
}

request(options, callback);
                                       
                       


With query parameters
var request = require('request');

var options = {
  url: "http://conflictapi.com/v1/api/Suggest?app_id=X&app_key=Y&contentedit=You%27re+Mamma+is+so+fat%2C+she+jumped+up+in+the+air+and+got+stuck&SessionID=0fce6c05939c2a4d9f5c",
};

function callback(error, response, body) {
  if (!error && response.statusCode == 200) {
    var info = JSON.parse(body);
    console.log(info.stargazers_count + " Stars");
    console.log(info.forks_count + " Forks");
  }
}

request(options, callback);
                                       
                       
With HTTP Headers
using (WebClient wc = new WebClient())
{
  wc.Headers.Add("app_id","your app id");
  wc.Headers.Add("app_key","your app key");
  var json = wc.
    DownloadString("http://conflictapi.com/v1/api/Suggest?contentedit=You%27re+Mamma+is+so+fat%2C+she+jumped+up+in+the+air+and+got+stuck&SessionID=0fce6c05939c2a4d9f5c");
}
                                       
                       


With query parameters
using (WebClient wc = new WebClient())
{
  var json = wc.
    DownloadString("http://conflictapi.com/v1/api/Suggest?app_id=X&app_key=Y&contentedit=You%27re+Mamma+is+so+fat%2C+she+jumped+up+in+the+air+and+got+stuck&SessionID=0fce6c05939c2a4d9f5c");
}
                                       
                       

What are Metrics

Metrics is the method of measuring something. In this case, the usefulness of an API. Sometimes, metrics around content can be difficult to measure. We can easily measure if content was displayed based on the api calls. However, questions like the following are difficult to measure:

  1. was that content used
  2. was it considered valuable or enjoyed
  3. is it one of the users' favorites
To help us improve our content, we ask for developers to use the following metrics calls within their applications.

MetricsDis

indicates a description was displayed to the user and not just retrieve into cache or storage.

Parameters

Id

Id is a number which uniquely identifies a description. This parameter is required to Identify which the description the suggestion pertains to. It is the same number/id you receive during Description GET calls such as (/slaps or /Twister)

  • This parameter is REQUIRED
  • The ID parameter cannot be repeated more than once.
  • Validation: Data Type Validation. Integer only
  • Example: To send suggestions for descriptions with the id of 111 append &id=111

Metric

is the value which should be recorded for the measure. A positive value, such as 1, will indicate the description was explicitly liked. A negative value, such as -1, will indicate the description was explicitly disliked.

  • This parameter is REQUIRED
  • The Metric parameter cannot be repeated more than once.
  • Validation: Data Type Validation. Integer values only of 1 or -1

HTTP verb : PUT

/Metricslik

indicates a user explicitly indicated they liked or disliked a description

Parameters

Id

is a number which uniquely identifies a description. This parameter is required to Identify which the description the metric pertains to. It is the same number/id you receive during Description GET calls such as (/slaps or /desc)

  • This parameter is REQUIRED
  • The ID parameter cannot be repeated more than once.
  • Validation: Data Type Validation. Integer only

Metric

is the value which should be recorded for the measure. A positive value, such as 1, will indicate the description was explicitly liked. A negative value, such as -1, will indicate the description was explicitly disliked.

  • This parameter is REQUIRED.
  • The Metric parameter cannot be repeated more than once.
  • Validation: Data Type Validation. Integer values only of 1 or -1.

Session

is any value that uniquely identifies a user's session

  • This parameter is NOT required.
  • The Session parameter cannot be repeated more than once.
  • Validation: String only, max length 1024 characters.

Metricsuse

indicates a description was used or processed by the user

Parameters

Id

indicates a description was used or processed by the user is a number which uniquely identifies a description. This parameter is required to identify which of the descriptions the metric pertains to. It is the same number/id you receive during Description GET calls such as (/slaps or /desc)

  • This parameter is REQUIRED
  • The ID parameter cannot be repeated more than once.
  • Validation: Data Type Validation. Integer only.

Metric

is the value which should be recorded for the measure. A positive value, such as 1, will indicate the description was explicitly liked. A negative value, such as -1, will indicate the description was explicitly disliked.

  • This parameter is REQUIRED.
  • The Metric parameter cannot be repeated more than once.
  • Validation: Data Type Validation. Integer values only of 1 or -1.

Session

is any value that uniquely identifies a user's session.

  • This parameter is NOT required.
  • The Session parameter cannot be repeated more than once.
  • Validation: String only, max length 1024 characters.

MetricsFav

indicates a description was explicitly marked as a favorite by the user

Parameters

Id

is a number which uniquely identifies a description. This parameter is required to Identify which of the descriptions the metric pertains to. It is the same number/id you receive during Description GET calls such as (/slaps or /desc)

  • This parameter is REQUIRED.
  • The ID parameter cannot be repeated more than once.
  • Validation: Data Type Validation. Integer only.

Metric

is the value which should be recorded for the measure. A positive value, such as 1, will indicate the description was explicitly liked. A negative value, such as -1, will indicate the description was explicitly disliked.

  • This parameter is REQUIRED.
  • The Metric parameter cannot be repeated more than once.
  • Validation: Data Type Validation. Integer values only of 1 or -1.

Session

is any value that uniquely identifies a user’s session

  • This parameter is NOT required.
  • The Session parameter cannot be repeated more than once.
  • Validation: String only, max length 1024 characters.

With HTTP Headers
curl -X PUT -H app_id:X -H app_key:Y -d id:111 -d metric:1  
  "http://conflictapi.com/v1/api/metricslik"
                                       
                       
With HTTP Headers
require 'rest-client'
require 'json'
 
headers = {  
    :app_id => 'X', 
    :app_key => 'Y'  
} 

params = {
  :id => 111
  :metric => 1
}

response = RestClient.put "http://conflictapi.com/v1/api/metricslik", params.to_json, headers
JSON.parse(response)
                                       
                       
With HTTP Headers
import requests
headers = {'app_id': 'X', 'app_key':'Y' }
data = {'id':111, 'metric':1}
r = requests.put(
  'http://conflictapi.com/v1/api/metricslik', 
  data=data,  headers=headers)
  #line breaks and indentation are for readability only.
r.json()
                                       
                       
With HTTP Headers
$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 
    "http://conflictapi.com/v1/api/metricslik",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => "PUT"
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_HTTPHEADER => array(
    'app_id': 'X', 
    'app_key':'Y'
  ),
  CURLOPT_POSTFIELDS => http_build_query(
    array(
      'id': 111,
      'metric': 1
    )
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);
$json = json_decode($response, true);
                                       
                       
With HTTP Headers
String jsonResponse = null;    
try {
  URL object = new URL("http://conflictapi.com/v1/api/metricslik");

  String parameters = Json.createObjectBuilder()
      .add("id",111)
      .add("metric",1)
      .build().toString();

  HttpURLConnection connection = (HttpURLConnection) object
          .openConnection();
  
  connection.setRequestMethod("PUT");
  connect.setDoOutput(true);
  connection.setReadTimeout(60 * 1000);
  connection.setConnectTimeout(60 * 1000);
  connection.setFixedLengthStreamingMode(parameters.getBytes().length);
  connection.setRequestProperty("app_id", "X");
  connection.setRequestProperty("app_key", "Y");
  OutputStreamWriter out = new OutputStreamWriter(
    httpCon.getOutputStream());
  out.write(parameters.getBytes());
  out.close();

  int responseCode = connection.getResponseCode();            

  if (responseCode == 200) {
      InputStream inputStr = connection.getInputStream();
      String encoding = connection.getContentEncoding() == null ? "UTF-8"
              : connection.getContentEncoding();
      jsonResponse = IOUtils.toString(inputStr, encoding); 
  }
} catch (Exception e) {
  e.printStackTrace();
}
                                       
                       
With HTTP Headers
var request = require('request');

var options = {
  url: "http://conflictapi.com/v1/api/metricslik",
  headers: {
    'app_id': 'X', 
    'app_key':'Y'
  },
  method: 'PUT',
  json: {
    id: 111,
    metric: 1
  }
};

function callback(error, response, body) {
  if (!error && response.statusCode == 200) {
    var info = JSON.parse(body);
    console.log(info.stargazers_count + " Stars");
    console.log(info.forks_count + " Forks");
  }
}

request(options, callback);
                       
With HTTP Headers
using (var client = new HttpClient())   
{   
  var parameters = new { Id = 111, Metric = 1 };   
  client.DefaultRequestHeaders.Add("app_id","X");
  client.DefaultRequestHeaders.Add("app_key","Y");
  client.BaseAddress = new Uri("http://conflictapi.com/");   
  var response = client.PutAsJsonAsync("v1/api/metricslik", parameters).Result;    
}
                       

Server Response Codes

Http codeMessageMeaning
200OKSuccess!The request has succeeded
201 CreatedcreatedA new resource was successfully created.
400Bad RequestAn error messageYou've made an error in your request (such as passing a string for a parameter that  expects a number).
401 UNAUTHORIZEDUnauthorizedYou have not log in with a valid user ID and password.
403 ForbiddenAn error messageYou've exceeded the rate limits for your account, or the data you're trying to access is private.
404 Not FoundAn error messageThe requested resource could not be found, or the URI doesn't correspond to any known command.
500 InternalServer ErrorAn error messageAn internal error on our side. If this problem persists, submit a bug report in the bug section of our forums.
503 Service UnavailableAn error messageThe API is down for scheduled maintenance; please try again later (this should be rare!)
415 unsupported media typeAn error messageThe message comes when invalid content-type in request body.

Common Validations for Each Endpoint

  • The Request Body Parameters are mandatory to give except Logout Endpoint.
  • The valid content-type Header values are application/xml,application/json.

/Register endpoint documentation

The Endpoint creates a new user. It defines the Email, Password, ConfirmPassword, FullName, Username in the Body parameters.

Allowed HTTP Request

  • POST: Update Resource

List Resource

  • V1/Endpoint/Account/Register

Parameters

ParameterDescription
EmailUser is required to give unique Email Id
PasswordEnter password value
ConfirmPasswordRe-Enter the password given above.
FullNameEnter your full name
UserNameEnter a unique username

Parameter Validations

  • Email is a mandatory field.
  • Email should be a unique value.
  • Email cannot be an empty value.
  • Email must be entered in a proper Email format. For example:abcd@gmail.com
  • Password is a mandatory field.
  • Password cannot be an empty value.
  • Password needs to be unique for a particular Email.
  • The Password must be at least 6 characters long.
  • Passwords must have at least one non letter, digit character and special character
  • Valid Password Example: abcd@1234
  • Invalid Password Examples:
    1. Abcd
    2. Abcdef
    3. 123456
    4. @#$%
  • ConfirmPassword is a mandatory field.
  • ConfirmPassword should be similar to the Password value.
  • ConfirmPassword cannot be an empty value
  • FullName is an optional parameter.
  • FullName accepts String data type.
  • UserName is a mandatory field.
  • UserName should be a unique value.
  • UserName cannot be an empty value.
  • UserName accepts String data type

Request

Text/Json Format

URL: POST http://conflictEndpoint.azurewebsites.net/v1/Endpoint/
Account/Register

{ "Email": "abcd@gmail.com", "Password": "asdf@123", "ConfirmPassword": "asdf@123", "FullName": "Abcd", "UserName": "a123" }

Application/xml, text/xml format

URL: POST http://conflictEndpoint.azurewebsites.net/v1/Endpoint/
Account/Register

<RegisterBindingModel xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/ConflictGames.Models"> 
  <ConfirmPassword>sample string 3</ConfirmPassword>
  <Email>sample string 1</Email>
  <Password>sample string 2</Password>
  <FullName>sample string 1</FullName>
  <UserName>sample string 2</UserName>
</RegisterBindingModel>
  

Response Formats

  • Application/Json
  • Application/xml
  • Text/javascript

Returned Attributes

AttributeData typeDescription
Access_tokenStringIt is a unique value.This token is required as a bearer token header for ChangePassword and Logout endpoints.
Token_typeStringIt defines the type of token.The token type is ‘bearer token’.The other types of token are OAuth1.0,OAuth2.0,Digest Auth.
Expires_in
userNameStringIt is a unique user id.It is used in other endponts like Register,PasswoedRestToken and UpdatePassword.
.issuedDatetimeIt specified a time when token was created.
.expiresDatetimeIt specifies the duration after which the generated token will expire.The user has to call the Register/Login endpoint again to generate new token.

Response Sample

200 OK

{
  "access_token": "WsCxN6mH8EYpoDF5FSy3bcM_Wd-42CC1GVx7treWJSfV57ntdv
  iuTdKbk9OhldX14SmSFo_rPdfyzDluSZ3Bdwg07y49KVxeNpm8eKL0eNfKRcej_dxe5
  8gc-y8B3us5crq8zeN8C  nc2fpquyw5Vs-E3wCETtcVPKFYTCHTc65FVfk7wYpYV3P
  UWyj-HHFHAYw_x36-sEeTvUMoaXOBiezc1wwvZ29AQA  8KmEai-eFrZy_k21DT-5v8
  YzdqjBWnAhqxyWpgrZHvOhZdeviArXSfKtTsNWzsxORQhrQHoMoszKLALSWuVjM6aRa
  4Dq  7nXMK3SSXfDDmR7Y5zyRa4Xy4BExmKb6Zjf2OX9oxK0lQfXTnJdBJDvqJZgeMQ
  jTmERDT4sCK5q9iOKDMTahY1  jbsYLEAoCf3Znn0YWRJ5-TzKSc64u0Z9avew1wGEt
  iT2AW9nFacwC4-U4zJgf1Qj-qw",
  "token_type": "bearer",
  "expires_in": 7199,
  "userName": "sonamag78",
  ".issued": "Mon, 12 Feb 2018 07:28:21 GMT",
  ".expires": "Mon, 12 Feb 2018 09:28:21 GMT"
}
    

With HTTP Headers
curl -X POST  -d "Email": "abcd@gmail.com" -d  "Password": "asdf@123" -d  "ConfirmPassword": "asdf@123" -d  "FullName": "Abcd" -d  "UserName": "a123"  
  "http://conflictEndpoint.azurewebsites.net/v1/Endpoint/Account/Register"
                                       
                       
With HTTP Headers
require 'rest-client'
require 'json'

params = { 
  :Email => "abcd@gmail.com", 
  :Password => "asdf@123", 
  :ConfirmPassword => "asdf@123", 
  :FullName => "Abcd", 
  :UserName => "a123" 
}

response = RestClient.post "http://conflictEndpoint.azurewebsites.net/v1/Endpoint/Account/Register", params.to_json
JSON.parse(response)
                                       
                       
With HTTP Headers
import requests

data = { "Email": "abcd@gmail.com", "Password": "asdf@123", "ConfirmPassword": "asdf@123", "FullName": "Abcd", "UserName": "a123" }
r = requests.post(
  'http://conflictEndpoint.azurewebsites.net/v1/Endpoint/Account/Register', 
  data=data)
  #line breaks and indentation are for readability only.
r.json()
                                       
                       
With HTTP Headers
$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 
    "http://conflictEndpoint.azurewebsites.net/v1/Endpoint/Account/Register",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => "POST"
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_POSTFIELDS => http_build_query(
    array(
      'Email' : "abcd@gmail.com", 
      'Password' : "asdf@123", 
      'ConfirmPassword' : "asdf@123", 
      'FullName' : "Abcd", 
      'UserName' : "a123" 
    )
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);
$json = json_decode($response, true);
                                       
                       
With HTTP Headers
String jsonResponse = null;    
try {
  URL object = new URL("http://conflictEndpoint.azurewebsites.net/v1/Endpoint/Account/Register");

  String parameters = Json.createObjectBuilder()
      .add("Email","abcd@gmail.com")
      .add("Password","asdf@123")
      .add("ConfirmPassword","asdf@123")
      .add("FullName","Abcd")
      .add("UserName","a123")
      .build().toString();

  HttpURLConnection connection = (HttpURLConnection) object
          .openConnection();
  
  connection.setRequestMethod("POST");
  connect.setDoOutput(true);
  connection.setReadTimeout(60 * 1000);
  connection.setConnectTimeout(60 * 1000);
  connection.setFixedLengthStreamingMode(parameters.getBytes().length);
  OutputStreamWriter out = new OutputStreamWriter(
    httpCon.getOutputStream());
  out.write(parameters.getBytes());
  out.close();

  int responseCode = connection.getResponseCode();            

  if (responseCode == 200) {
      InputStream inputStr = connection.getInputStream();
      String encoding = connection.getContentEncoding() == null ? "UTF-8"
              : connection.getContentEncoding();
      jsonResponse = IOUtils.toString(inputStr, encoding); 
  }
} catch (Exception e) {
  e.printStackTrace();
} 
                                       
                       
With HTTP Headers
var request = require('request');

var options = {
  url: "http://conflictEndpoint.azurewebsites.net/v1/Endpoint/Account/Register",

  method: 'POST',
  json: {
    Email : "abcd@gmail.com", 
    Password : "asdf@123", 
    ConfirmPassword : "asdf@123", 
    FullName : "Abcd", 
    UserName : "a123"
  }
};

function callback(error, response, body) {
  if (!error && response.statusCode == 200) {
    var info = JSON.parse(body);
    console.log(info.stargazers_count + " Stars");
    console.log(info.forks_count + " Forks");
  }
}

request(options, callback);
                       
With HTTP Headers
using (var client = new HttpClient())   
{   
  var parameters = new { 
    Email = "abcd@gmail.com", 
    Password = "asdf@123", 
    ConfirmPassword = "asdf@123", 
    FullName = "Abcd", 
    UserName = "a123" 
  };   
  client.BaseAddress = new Uri("http://conflictEndpoint.azurewebsites.net/");   
  var response = client.PostAsJsonAsync("v1/Endpoint/Account/Register", parameters).Result;    
}
                       

/Login endpoint documentation

The Endpoint allows the user to log in by giving registered username and password in the Body parameters.

Allowed HTTP Request

  • POST: Update Resource

List Resource

  • V1/Endpoint/Account/Login

Parameters

ParameterDescription
UserNameEnter the registered username
PasswordEnter the password corresponding to the registered userName

Parameter Validations

  • UserName is a mandatory field
  • UserName should be the registered UserName.
  • UserName cannot be an empty value
  • Password is a mandatory field
  • Password must be 6-100 characters long
  • Password must contain at least one digit, character and special character in it.
  • Password should be the registered Password.
  • Password cannot be an empty value

Request

Text/Json Format

URL: POST http://conflictEndpoint.azurewebsites.net/v1/Endpoint/
Account/Login

{ "UserName": "sonamag78", "Password": "sonam@123" }

Application/xml, text/xml format

URL: POST http://conflictEndpoint.azurewebsites.net/v1/Endpoint/
Account/Login

<LoginBindingModel xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/ConflictGames.Models">
  <UserName>sample string 2</UserName>
  <Password>sample string 2</Password>
</LoginBindingModel>

Response Formats

  • Application/Json
  • Application/xml
  • Text/javascript

Returned Attributes

AttributeData typeDescription
Access_tokenStringIt is a unique value.This token is required as a bearer token header for ChangePassword and Logout endpoints.
Token_typeStringIt defines the type of token.The token type is ‘bearer token’.The other types of token are OAuth1.0,OAuth2.0,Digest Auth.
Expires_in
userNameStringIt is a unique user id.It is used in other endponts like Register,PasswoedRestToken and UpdatePassword.
.issuedDatetimeIt specified a time when token was created.
.expiresDatetimeIt specifies the duration after which the generated token will expire.The user has to call the Register/Login endpoint again to generate new token.

Response Sample

200 OK

{
  "access_token": "WsCxN6mH8EYpoDF5FSy3bcM_Wd-42CC1GVx7treWJSfV57ntdv
  iuTdKbk9OhldX14SmSFo_rPdfyzDluSZ3Bdwg07y49KVxeNpm8eKL0eNfKRcej_dxe5
  8gc-y8B3us5crq8zeN8C  nc2fpquyw5Vs-E3wCETtcVPKFYTCHTc65FVfk7wYpYV3P
  UWyj-HHFHAYw_x36-sEeTvUMoaXOBiezc1wwvZ29AQA  8KmEai-eFrZy_k21DT-5v8
  YzdqjBWnAhqxyWpgrZHvOhZdeviArXSfKtTsNWzsxORQhrQHoMoszKLALSWuVjM6aRa
  4Dq  7nXMK3SSXfDDmR7Y5zyRa4Xy4BExmKb6Zjf2OX9oxK0lQfXTnJdBJDvqJZgeMQ
  jTmERDT4sCK5q9iOKDMTahY1  jbsYLEAoCf3Znn0YWRJ5-TzKSc64u0Z9avew1wGEt
  iT2AW9nFacwC4-U4zJgf1Qj-qw",
  "token_type": "bearer",
  "expires_in": 7199,
  "userName": "sonamag78",
  ".issued": "Mon, 12 Feb 2018 07:28:21 GMT",
  ".expires": "Mon, 12 Feb 2018 09:28:21 GMT"
}
    

With HTTP Headers
curl -X POST  -d "UserName": "a123" -d "Password": "asdf@123"   
  "http://conflictEndpoint.azurewebsites.net/v1/Endpoint/Account/Login"
                                       
                       
With HTTP Headers
require 'rest-client'
require 'json'

params = { 
  :UserName => "a123", 
  :Password => "asdf@123"
  
}

response = RestClient.post "http://conflictEndpoint.azurewebsites.net/v1/Endpoint/Account/Login", params.to_json
JSON.parse(response)
                                       
                       
With HTTP Headers
import requests

data = { "UserName": "a123", "Password": "asdf@123"  }
r = requests.post(
  'http://conflictEndpoint.azurewebsites.net/v1/Endpoint/Account/Login', 
  data=data)
  #line breaks and indentation are for readability only.
r.json()
                                       
                       
With HTTP Headers
$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 
    "http://conflictEndpoint.azurewebsites.net/v1/Endpoint/Account/Login",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => "POST"
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_POSTFIELDS => http_build_query(
    array(
      'UserName' : "a123",
      'Password' : "asdf@123"       
    )
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);
$json = json_decode($response, true);
                                       
                       
With HTTP Headers
String jsonResponse = null;    
try {
  URL object = new URL("http://conflictEndpoint.azurewebsites.net/v1/Endpoint/Account/Login");

  String parameters = Json.createObjectBuilder()
      .add("UserName","a123")
      .add("Password","asdf@123")      
      .build().toString();

  HttpURLConnection connection = (HttpURLConnection) object
          .openConnection();
  
  connection.setRequestMethod("POST");
  connect.setDoOutput(true);
  connection.setReadTimeout(60 * 1000);
  connection.setConnectTimeout(60 * 1000);
  connection.setFixedLengthStreamingMode(parameters.getBytes().length);
  OutputStreamWriter out = new OutputStreamWriter(
    httpCon.getOutputStream());
  out.write(parameters.getBytes());
  out.close();

  int responseCode = connection.getResponseCode();            

  if (responseCode == 200) {
      InputStream inputStr = connection.getInputStream();
      String encoding = connection.getContentEncoding() == null ? "UTF-8"
              : connection.getContentEncoding();
      jsonResponse = IOUtils.toString(inputStr, encoding); 
  }
} catch (Exception e) {
  e.printStackTrace();
} 
                                       
                       
With HTTP Headers
var request = require('request');

var options = {
  url: "http://conflictEndpoint.azurewebsites.net/v1/Endpoint/Account/Login",

  method: 'POST',
  json: {
    UserName : "a123",
    Password : "asdf@123"    
  }
};

function callback(error, response, body) {
  if (!error && response.statusCode == 200) {
    var info = JSON.parse(body);
    console.log(info.stargazers_count + " Stars");
    console.log(info.forks_count + " Forks");
  }
}

request(options, callback);
                       
With HTTP Headers
using (var client = new HttpClient())   
{   
  var parameters = new { 
    UserName = "a123", 
    Password = "asdf@123", 
  };   
  client.BaseAddress = new Uri("http://conflictEndpoint.azurewebsites.net/");   
  var response = client.PostAsJsonAsync("v1/Endpoint/Account/Login", parameters).Result;    
}
                       

/Logout endpoint documentation

The Endpoint logs out the logged in username.The Endpoint defines the Bearer token in the Header Request. The token must be similar to the value generated in Login/Registered Endpoint Response.

Allowed HTTP Request

  • POST: Update Resource

List Resource

  • V1/Endpoint/Account/Logout

Parameters

Empty

Request

URL: POST http://conflictEndpoint.azurewebsites.net/v1/Endpoint/
Account/Logout

Header

Authorization: Bearer [valid token value]

Body

Empty

Response Formats

  • Application/Json
  • Application/xml
  • Text/javascript

Returned Attributes

Empty

Response Sample

200 OK
Empty

With HTTP Headers
curl -X POST  -H "Authorization": "Bearer "    
  "http://conflictEndpoint.azurewebsites.net/v1/Endpoint/Account/Logout"
                                       
                       
With HTTP Headers
require 'rest-client'
require 'json'

headers = {  
  :Authorization => 'Bearer ', 
} 

params = {}

response = RestClient.post "http://conflictEndpoint.azurewebsites.net/v1/Endpoint/Account/Logout", params.to_json, headers
JSON.parse(response)
                                       
                       
With HTTP Headers
import requests

headers = { "Authorization": "Bearer " }
r = requests.post(
  'http://conflictEndpoint.azurewebsites.net/v1/Endpoint/Account/Logout', 
  headers=headers)
  #line breaks and indentation are for readability only.
r.json()
                                       
                       
With HTTP Headers
$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 
    "http://conflictEndpoint.azurewebsites.net/v1/Endpoint/Account/Logout",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => "POST"
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_HTTPHEADER => array(
    'Authorization'=> 'Bearer ',
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);
$json = json_decode($response, true);
                                       
                       
With HTTP Headers
String jsonResponse = null;    
try {
  URL object = new URL("http://conflictEndpoint.azurewebsites.net/v1/Endpoint/Account/Logout");

  String parameters = Json.createObjectBuilder()
      .add("UserName","a123")
      .add("Password","asdf@123")      
      .build().toString();

  HttpURLConnection connection = (HttpURLConnection) object
          .openConnection();
  
  connection.setRequestMethod("POST");
  connect.setDoOutput(true);
  connection.setReadTimeout(60 * 1000);
  connection.setConnectTimeout(60 * 1000);
  connection.setFixedLengthStreamingMode(parameters.getBytes().length);
  connection.setRequestProperty("Authorization", "Bearer ");
  OutputStreamWriter out = new OutputStreamWriter(
    httpCon.getOutputStream());
  out.write(parameters.getBytes());
  out.close();

  int responseCode = connection.getResponseCode();            

  if (responseCode == 200) {
      InputStream inputStr = connection.getInputStream();
      String encoding = connection.getContentEncoding() == null ? "UTF-8"
              : connection.getContentEncoding();
      jsonResponse = IOUtils.toString(inputStr, encoding); 
  }
} catch (Exception e) {
  e.printStackTrace();
}
                                       
                       
With HTTP Headers
var request = require('request');

var options = {
  url: "http://conflictEndpoint.azurewebsites.net/v1/Endpoint/Account/Logout",

  method: 'POST',
  headers: {
    'Authorization': 'Bearer '
  },
};

function callback(error, response, body) {
  if (!error && response.statusCode == 200) {
    var info = JSON.parse(body);
    console.log(info.stargazers_count + " Stars");
    console.log(info.forks_count + " Forks");
  }
}

request(options, callback);
                       
With HTTP Headers
using (var client = new HttpClient())   
{   
  client.DefaultRequestHeaders.Add("Authorization","Bearer "); 
  client.BaseAddress = new Uri("http://conflictEndpoint.azurewebsites.net/");   
  var response = client.PostAsJsonAsync("v1/Endpoint/Account/Logout", parameters).Result;    
}
                       

/ChangePassword endpoint documentation

The Endpoint allows the user to log in by giving registered username and password in the Body parameters.

Allowed HTTP Request

  • POST: Update Resource

List Resource

  • V1/Endpoint/Account/ChangePassword

Parameters

ParameterDescription
oldPasswordEnter the existing password of the registered userName
NewPasswordEnter the new Password you want to keep.
ConfirmPasswordEnter the NewPassword value.

Parameter Validations

  • Authorized Bearer token is mandatory in the Request Header.
  • Bearer token should be similar to the token generated in Login/Register Endpoint’s ‘access_token’ parameter in Response Body.
  • OldPassword is mandatory.
  • OldPassword must be a valid value for the existing username.
  • NewPassword is mandatory.
  • New Password must be between 6-100 characters
  • New Password must contain atleast one digit,one character and special character
  • ConfirmPassword is mandatory.
  • ConfirmPassword must be similar to NewPassword.

Request

Text/Json Format

URL: POST http://conflictEndpoint.azurewebsites.net/v1/Endpoint/
Account/ChangePassword

{ "OldPassword": "sample@123", "NewPassword": "sample@1234", "confirmPassword": "sample@1234" }

Application/xml, text/xml format

URL: POST http://conflictEndpoint.azurewebsites.net/v1/Endpoint/
Account/ChangePassword

<ChangePasswordBindingModel xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/ConflictGames.Models">
   <oldPassword>sample string 1</oldPassword >
   <NewPassword>sample string 2</NewPassword>
   <ConfirmPassword>sample string 2</ConfirmPassword>                                                                                                                                                                                                                                                                                                                                                                                  
</ChangePasswordBindingModel>

Response Formats

  • Application/Json
  • Application/xml
  • Text/javascript

Returned Attributes

Empty

Response Sample

200 OK
Empty

With HTTP Headers
curl -X POST  -d "oldPassword": "sample@1234" -d "NewPassword": "sample@1234" -d "NewPassword": "sample@1234"
  "http://conflictEndpoint.azurewebsites.net/v1/Endpoint/Account/ChangePassword"
                                       
                       
With HTTP Headers
require 'rest-client'
require 'json'

params = { 
  :oldPassword => "sample@1234", 
  :NewPassword => "sample@1234", 
  :ConfirmPassword => "sample@1234"  
}

response = RestClient.post "http://conflictEndpoint.azurewebsites.net/v1/Endpoint/Account/ChangePassword", params.to_json
JSON.parse(response)
                                       
                       
With HTTP Headers
import requests

data = { "oldPassword": "sample@1234", "NewPassword": "sample@1234", "NewPassword": "sample@1234"  }
r = requests.post(
  'http://conflictEndpoint.azurewebsites.net/v1/Endpoint/Account/ChangePassword', 
  data=data)
  #line breaks and indentation are for readability only.
r.json()
                                       
                       
With HTTP Headers
$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 
    "http://conflictEndpoint.azurewebsites.net/v1/Endpoint/Account/ChangePassword",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => "POST"
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_POSTFIELDS => http_build_query(
    array(
      'oldPassword' : "sample@1234",
      'NewPassword' : "sample@1234",
      'ConfirmPassword' : "sample@1234"       
    )
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);
$json = json_decode($response, true);
                                       
                       
With HTTP Headers
String jsonResponse = null;    
try {
  URL object = new URL("http://conflictEndpoint.azurewebsites.net/v1/Endpoint/Account/ChangePassword");

  String parameters = Json.createObjectBuilder()
      .add("oldPassword","sample@1234")
      .add("NewPassword","sample@1234")   
      .add("ConfirmPassword","sample@1234")   
      .build().toString();

  HttpURLConnection connection = (HttpURLConnection) object
          .openConnection();
  
  connection.setRequestMethod("POST");
  connect.setDoOutput(true);
  connection.setReadTimeout(60 * 1000);
  connection.setConnectTimeout(60 * 1000);
  connection.setFixedLengthStreamingMode(parameters.getBytes().length);
  OutputStreamWriter out = new OutputStreamWriter(
    httpCon.getOutputStream());
  out.write(parameters.getBytes());
  out.close();

  int responseCode = connection.getResponseCode();            

  if (responseCode == 200) {
      InputStream inputStr = connection.getInputStream();
      String encoding = connection.getContentEncoding() == null ? "UTF-8"
              : connection.getContentEncoding();
      jsonResponse = IOUtils.toString(inputStr, encoding); 
  }
} catch (Exception e) {
  e.printStackTrace();
}
                                       
                       
With HTTP Headers
var request = require('request');

var options = {
  url: "http://conflictEndpoint.azurewebsites.net/v1/Endpoint/Account/ChangePassword",

  method: 'POST',
  json: {
    oldPassword : "sample@1234",
    NewPassword : "sample@1234",
    ConfirmPassword : "sample@1234"  
  }
};

function callback(error, response, body) {
  if (!error && response.statusCode == 200) {
    var info = JSON.parse(body);
    console.log(info.stargazers_count + " Stars");
    console.log(info.forks_count + " Forks");
  }
}

request(options, callback);
                       
With HTTP Headers
using (var client = new HttpClient())   
{   
  var parameters = new { 
    oldPassword = "sample@1234", 
    NewPassword = "sample@1234", 
    ConfirmPassword = "sample@1234"
  };   
  client.BaseAddress = new Uri("http://conflictEndpoint.azurewebsites.net/");   
  var response = client.PostAsJsonAsync("v1/Endpoint/Account/ChangePassword", parameters).Result;    
}
                       

/UpdatePassword endpoint documentation

The Endpoint updates the password of the existing username.It defines username, resetToken, newPassword, and confirmPassword in the Request Body parameters. The user needs to be logged out for UpdatePassword to work successfully.

Allowed HTTP Request

  • POST: Update Resource

List Resource

  • V1/Endpoint/Account/UpdatePassword

Parameters

ParameterDescription
userNameEnter the registered userName
resetTokenEnter the token value generated from PasswordResetToken Endpoint for the corresponding username.
NewPasswordEnter the new Password value
ConfirmPasswordEnter the new Password value

Parameter Validations

  • The user needs to be logged out before updating the password.
  • Username is mandatory
  • Username should be already registered username.
  • ResetToken is mandatory.
  • ResetToken should be similar to the value of token parameter value generated in PasswordResetToken Endpoint response(for the corresponding username)
  • NewPassword and ConfirmPassword are mandatory.
  • New Password must be between 6-100 characters
  • New Password must contain atleast one digit,one character and special character
  • Confirm Password must be similar to the New Password

Request

Text/Json Format

URL: POST http://conflictEndpoint.azurewebsites.net/v1/Endpoint/Account/UpdatePassword
{ "userName": "sonamag78", "resetToken": "WK8N6", "newPassword": "sample@123", "confirmPassword": "sample@123" }

Application/xml, text/xml format

URL: POST http://conflictEndpoint.azurewebsites.net/v1/Endpoint/Account/UpdatePassword

<UpdatePasswordBindingModel xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/ConflictGames.Models"> 
   <UserName>sample string 2</UserName>
   <resetToken>token value</resetToken>
   <NewPassword> sample string 3</NewPassword>
   <ConfirmPassword> sample string 3</ConfirmPassword>
</UpdatePasswordBindingModel>

Response Formats

  • Application/Json
  • Application/xml
  • Text/javascript

Returned Attributes

AttributeData typeDescription
SuccessStringIt denoates that the valid response is coming form the server.

Response Sample

200 OK

{
  "success": true
}

With HTTP Headers
curl -X POST  -d "UserName": "a123" -d "resetToken": "WK8N6" -d "newPassword": "sample@123" -d "confirmPassword": "sample@123"
  "http://conflictEndpoint.azurewebsites.net/v1/Endpoint/Account/UpdatePassword"
                                       
                       
With HTTP Headers
require 'rest-client'
require 'json'

params = { 
  :UserName => "a123"
  :ResetToken => "WK8N6",
  :NewPassword => "sample@123",
  :ConfirmPassword => "sample@123"
}

response = RestClient.post "http://conflictEndpoint.azurewebsites.net/v1/Endpoint/Account/UpdatePassword", params.to_json
JSON.parse(response)
                                       
                       
With HTTP Headers
import requests

data = {
  "userName": "sonamag78",
  "resetToken": "WK8N6",
  "newPassword": "sample@123",
  "confirmPassword": "sample@123"
}
r = requests.post(
  'http://conflictEndpoint.azurewebsites.net/v1/Endpoint/Account/UpdatePassword', 
  data=data)
  #line breaks and indentation are for readability only.
r.json()
                                       
                       
With HTTP Headers
$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 
    "http://conflictEndpoint.azurewebsites.net/v1/Endpoint/Account/UpdatePassword",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => "POST"
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_POSTFIELDS => http_build_query(
    array(
      "UserName" => "a123"
      "ResetToken" => "WK8N6",
      "NewPassword" => "sample@123",
      "ConfirmPassword" => "sample@123"   
    )
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);
$json = json_decode($response, true);
                                       
                       
With HTTP Headers
String jsonResponse = null;    
try {
  URL object = new URL("http://conflictEndpoint.azurewebsites.net/v1/Endpoint/Account/UpdatePassword");

  String parameters = Json.createObjectBuilder()
      .add("UserName","a123")    
      .add("ResetToken","WK8N6")  
      .add("NewPassword","sample@123")  
      .add("ConfirmPassword","sample@123")  
      .build().toString();

  HttpURLConnection connection = (HttpURLConnection) object
          .openConnection();
  
  connection.setRequestMethod("POST");
  connect.setDoOutput(true);
  connection.setReadTimeout(60 * 1000);
  connection.setConnectTimeout(60 * 1000);
  connection.setFixedLengthStreamingMode(parameters.getBytes().length);
  OutputStreamWriter out = new OutputStreamWriter(
    httpCon.getOutputStream());
  out.write(parameters.getBytes());
  out.close();

  int responseCode = connection.getResponseCode();            

  if (responseCode == 200) {
      InputStream inputStr = connection.getInputStream();
      String encoding = connection.getContentEncoding() == null ? "UTF-8"
              : connection.getContentEncoding();
      jsonResponse = IOUtils.toString(inputStr, encoding); 
  }
} catch (Exception e) {
  e.printStackTrace();
} 
                                       
                       
With HTTP Headers
var request = require('request');

var options = {
  url: "http://conflictEndpoint.azurewebsites.net/v1/Endpoint/Account/UpdatePassword",

  method: 'POST',
  json: {
    UserName : "a123"
    ResetToken : "WK8N6",
    NewPassword : "sample@123",
    ConfirmPassword : "sample@123"
  }
};

function callback(error, response, body) {
  if (!error && response.statusCode == 200) {
    var info = JSON.parse(body);
    console.log(info.stargazers_count + " Stars");
    console.log(info.forks_count + " Forks");
  }
}

request(options, callback);
                       
With HTTP Headers
using (var client = new HttpClient())   
{   
  var parameters = new { 
    UserName = "a123",
    ResetToken = "WK8N6",
    NewPassword = "sample@123",
    ConfirmPassword = "sample@123"
  };   
  client.BaseAddress = new Uri("http://conflictEndpoint.azurewebsites.net/");   
  var response = client.PostAsJsonAsync("v1/Endpoint/Account/UpdatePassword", parameters).Result;    
}
                       

/PasswordResetToken endpoint documentation

The Endpoint generates a token for the given username in the Request Body. The token value is required in the Request Body parameter of the UpdatePassword Endpoint.

Allowed HTTP Request

  • POST: Update Resource

List Resource

  • V1/Endpoint/Account/PasswordResetToken

Parameters

ParameterDescription
UserNameEnter the registered username

Parameter Validations

  • UserName is a mandatory field
  • UserName should be the registered UserName.

Request

Text/Json Format

URL: POST http://conflictEndpoint.azurewebsites.net/v1/Endpoint/
Account/PasswordResetToken

{ "UserName": "sonamag78", }

Application/xml, text/xml format

URL: POST http://conflictEndpoint.azurewebsites.net/v1/Endpoint/Account/
PasswordResetToken

<PasswordResetTokenBindingModel xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/ConflictGames.Models">
  <UserName>sample string 2</UserName>
</PasswordResetTokenBindingModel>

Response Formats

  • Application/Json
  • Application/xml
  • Text/javascript

Returned Attributes

AttributeData typeDescription
SuccessStringIt denoates that the valid response is coming form the server.
TokenStringIt is a unique value for the corresponding userName.This token value will be used in the request body parameter of the UpdatePassword end point.

Response Sample

200 OK

{
  "success": true,
  "token": "WK8N6"
}

With HTTP Headers
curl -X POST  -d "UserName": "a123" 
  "http://conflictEndpoint.azurewebsites.net/v1/Endpoint/Account/PasswordResetToken"
                                       
                       
With HTTP Headers
require 'rest-client'
require 'json'

params = { 
  :UserName => "a123"
  
}

response = RestClient.post "http://conflictEndpoint.azurewebsites.net/v1/Endpoint/Account/PasswordResetToken", params.to_json
JSON.parse(response)
                                       
                       
With HTTP Headers
import requests

data = { "UserName": "a123"  }
r = requests.post(
  'http://conflictEndpoint.azurewebsites.net/v1/Endpoint/Account/PasswordResetToken', 
  data=data)
  #line breaks and indentation are for readability only.
r.json()
                                       
                       
With HTTP Headers
$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 
    "http://conflictEndpoint.azurewebsites.net/v1/Endpoint/Account/PasswordResetToken",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => "POST"
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_POSTFIELDS => http_build_query(
    array(
      'UserName' : "a123"    
    )
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);
$json = json_decode($response, true);
                                       
                       
With HTTP Headers
String jsonResponse = null;    
try {
  URL object = new URL("http://conflictEndpoint.azurewebsites.net/v1/Endpoint/Account/PasswordResetToken");

  String parameters = Json.createObjectBuilder()
      .add("UserName","a123")    
      .build().toString();

  HttpURLConnection connection = (HttpURLConnection) object
          .openConnection();
  
  connection.setRequestMethod("POST");
  connect.setDoOutput(true);
  connection.setReadTimeout(60 * 1000);
  connection.setConnectTimeout(60 * 1000);
  connection.setFixedLengthStreamingMode(parameters.getBytes().length);
  OutputStreamWriter out = new OutputStreamWriter(
    httpCon.getOutputStream());
  out.write(parameters.getBytes());
  out.close();

  int responseCode = connection.getResponseCode();            

  if (responseCode == 200) {
      InputStream inputStr = connection.getInputStream();
      String encoding = connection.getContentEncoding() == null ? "UTF-8"
              : connection.getContentEncoding();
      jsonResponse = IOUtils.toString(inputStr, encoding); 
  }
} catch (Exception e) {
  e.printStackTrace();
} 
                                       
                       
With HTTP Headers
var request = require('request');

var options = {
  url: "http://conflictEndpoint.azurewebsites.net/v1/Endpoint/Account/PasswordResetToken",

  method: 'POST',
  json: {
    UserName : "a123" 
  }
};

function callback(error, response, body) {
  if (!error && response.statusCode == 200) {
    var info = JSON.parse(body);
    console.log(info.stargazers_count + " Stars");
    console.log(info.forks_count + " Forks");
  }
}

request(options, callback);
                       
With HTTP Headers
using (var client = new HttpClient())   
{   
  var parameters = new { 
    UserName = "a123"
  };   
  client.BaseAddress = new Uri("http://conflictEndpoint.azurewebsites.net/");   
  var response = client.PostAsJsonAsync("v1/Endpoint/Account/PasswordResetToken", parameters).Result;    
}