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.
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.
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.
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.
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 Code | Message | Meaning | Response body |
---|---|---|---|
200 | OK | Success! | A JSON response (see below.) |
201 | Created | A new resource was successfully created. | A JSON response containing the new resource's data. |
400 | Bad Request | You've made an error in your request (such as passing a string for a parameter that expects a number). | An error message |
403 | Forbidden | You've exceeded the rate limits for your account, or the data you're trying to access is private. | An error message |
404 | Not Found | The requested resource could not be found, or the URI doesn't correspond to any known command. | An error message |
500 | Server Error | An internal error on our side. If this problem persists, submit a bug report in the bug section of our forums. | An error message |
503 | Service Unavailable | The 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.
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 Type | Meaning |
string | Any string (up to 255 characters). Can include both number and characters |
int | A whole number value. |
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
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".
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.
&q=grilled+cheese
or &q=grilled%20cheese
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.
&MaxRecords=10
Specifying a Sortby against the Sortby [] parameter will sort the description by the field provided in descending order.
http://conflictapi.com/v1/api/Metadatasearch?app_id=YOUR_APP_ID&app_key=Your_APP_key&lookup=sortBy
&Sortby=rating
Setting this to "true" means to only return slaps with images or Gifs
&requirePictures=true
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.
http://conflictapi.com/v1/api/Metadata/allowedGenre
&allowedGenres=R-Rated
allowedGenres=R-rated,PG-Rated
http://conflictapi.com/v1/api/Metadatasearch?app_id=YOUR_APP_ID&app_key=Your_APP_key&
lookup=allowedGenres
)Fantasy | Modern | Detective | Horror |
SuperHero | Humor | Science Fiction | Western |
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.
http://conflictapi.com/v1/api/Metadatasearch?app_id=YOUR_APP_ID&app_key=Your_APP_key&
lookup=allowedCollections
&allowedCollections=NSFW
&allowedCollections=NSFW&allowedCollections=SFW
http://conflictapi.com/v1/api/Metadatasearch?app_id=YOUR_APP_ID&app_key=Your_APP_key&
lookup=allowedCollections
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.
http://conflictapi.com/v1/api/Metadatasearch?app_id=YOUR_APP_ID&app_key=Your_APP_key&
lookup=allowedSeverityy
&allowedSeverity=R
&allowedSeverity=R,PG
http://conflictapi.com/v1/api/Metadatasearch?app_id=YOUR_APP_ID&app_key=Your_APP_key&
lookup=allowedSeverity
)PG | PG-13 |
R | NC-17 |
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.
&allowedRating=3
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.
&id=2431
http://conflictapi.com/v1/api/Slaps?app_id=YOUR_ID&app_key=YOUR_APP_KEY&id=2431
&id=2431,2428,2429
http://conflictapi.com/v1/api/Slaps?app_id=YOUR_ID&app_key=YOUR_APP_KEY&id=2431,2428,2429
curl -H 'app_id: X' -H 'app_key: Y' -X
GET "http://conflictapi.com/v1/api/SLAP?q=Low+Jaw"
curl -X
GET "http://conflictapi.com/v1/api/SLAP?app_id=X&app_key=Y&q=Low+Jaw"
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)
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)
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()
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()
$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);
$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);
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();
}
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();
}
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);
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);
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");
}
using (WebClient wc = new WebClient())
{
var json = wc.
DownloadString("http://conflictapi.com/v1/api/SLAP?app_id=X&app_key=Y&q=Low+Jaw");
}
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
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
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.
&MaxRecords=10
Specifying a Sortby against the Sortby parameter will sort the description by the field provided in descending order.
http://conflictapi.com/v1/api/Metadata/Sortby
&Sortby=rating
Setting this to “true” means to only return Tongue Twisters with images or Gifs links
&requirePictures=true
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.
http://conflictapi.com/v1/api/Metadata/allowedGenre
&allowedGenres=Humor
allowedGenres=Humor,Twisters
http://conflictapi.com/v1/api/Metadata/allowedGenres
)Fantasy | Modern | Detective | Horror |
SuperHero | Humor | Science Fiction | Western |
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.
http://conflictapi.com/v1/api/Metadata/allowedCollections
&allowedCollections=NSFW
&allowedCollections=NSFW&allowedCollections=SFW
http://conflictapi.com/v1/api/Metadata/allowedCollections
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.
http://conflictapi.com/v1/api/Metadata/allowedSeverity
&allowedSeverity=R
&allowedSeverity=R,PG
http://conflictapi.com/v1/api/Metadata/allowedSeverity
)PG | PG-13 |
R | NC-17 |
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.
&allowedRating=3
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.
&id=2432
&id=2432,2434,2433
curl -H 'app_id: X' -H 'app_key: Y' -X
GET "http://conflictapi.com/v1/api/Twister?id=1,3&MaxRecords=40"
curl -X
GET "http://conflictapi.com/v1/api/Twister?app_id=X&app_key=Y&id=1,3&MaxRecords=40"
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)
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)
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()
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()
$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);
$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);
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();
}
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();
}
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);
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);
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");
}
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");
}
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
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
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.
&MaxRecords=10
Specifying a Sortby against the Sortby parameter will sort the description by the field provided in descending order.
http://conflictapi.com/v1/api/Metadata/Sortby
&Sortby=rating
Setting this to “true” means to only return Hairline Insults with images or Gifs links
&requirePictures=true
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.
http://conflictapi.com/v1/api/Metadata/allowedGenre
&allowedGenres=Humor
allowedGenres=Humor,Hairline Insults
http://conflictapi.com/v1/api/Metadata/allowedGenres
)Fantasy | Modern | Detective | Horror |
SuperHero | Humor | Science Fiction | Western |
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.
http://conflictapi.com/v1/api/Metadata/allowedCollections
&allowedCollections=NSFW
&allowedCollections=NSFW&allowedCollections=SFW
http://conflictapi.com/v1/api/Metadata/allowedCollections
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.
http://conflictapi.com/v1/api/Metadata/allowedSeverity
&allowedSeverity=R
&allowedSeverity=R,PG
http://conflictapi.com/v1/api/Metadata/allowedSeverity
)PG | PG-13 |
R | NC-17 |
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.
&allowedRating=3
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.
&id=333
&id=333&id=111&id=444
curl -H 'app_id: X' -H 'app_key: Y' -X
GET "http://conflictapi.com/v1/api/Hairline?id=1,3&MaxRecords=40"
curl -X
GET "http://conflictapi.com/v1/api/Hairline?app_id=X&app_key=Y&id=1,3&MaxRecords=40"
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)
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)
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()
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()
$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);
$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);
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();
}
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();
}
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);
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);
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");
}
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");
}
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
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
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.
&MaxRecords=10
Specifying a Sortby against the Sortby parameter will sort the description by the field provided in descending order.
http://conflictapi.com/v1/api/Metadata/Sortby
&Sortby=rating
Setting this to “true” means to only return Love Descriptions with images or Gifs links
&requirePictures=true
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.
http://conflictapi.com/v1/api/Metadata/allowedGenre
&allowedGenres=Humor
allowedGenres=Humor,Loves
http://conflictapi.com/v1/api/Metadata/allowedGenres
)Fantasy | Modern | Detective | Horror |
SuperHero | Humor | Science Fiction | Western |
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.
http://conflictapi.com/v1/api/Metadata/allowedCollections
&allowedCollections=NSFW
&allowedCollections=NSFW&allowedCollections=SFW
http://conflictapi.com/v1/api/Metadata/allowedCollections
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.
http://conflictapi.com/v1/api/Metadata/allowedSeverity
&allowedSeverity=R
&allowedSeverity=R,PG
http://conflictapi.com/v1/api/Metadata/allowedSeverity
)PG | PG-13 |
R | NC-17 |
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.
&allowedRating=3
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.
&id=22442
&id=22442,2443,2442
curl -H 'app_id: X' -H 'app_key: Y' -X
GET "http://conflictapi.com/v1/api/Love?id=1,3&MaxRecords=40"
curl -X
GET "http://conflictapi.com/v1/api/Love?app_id=X&app_key=Y&id=1,3&MaxRecords=40"
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)
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)
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()
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()
$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);
$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);
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();
}
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();
}
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);
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);
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");
}
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");
}
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
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
&q=Race+Horse
or q=Race%20Horse
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.
&MaxRecords=10
Specifying a Sortby against the Sortby parameter will sort the description by the field provided in descending order.
http://conflictapi.com/v1/api/Metadata/Sortby
&Sortby=rating
Setting this to “true” means to only return Appreciate Descriptions with images or Gifs links
&requirePictures=true
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.
http://conflictapi.com/v1/api/Metadata/allowedGenre
&allowedGenres=Humor
allowedGenres=Humor,Appreciates
http://conflictapi.com/v1/api/Metadata/allowedGenres
)Fantasy | Modern | Detective | Horror |
SuperHero | Humor | Science Fiction | Western |
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.
http://conflictapi.com/v1/api/Metadata/allowedCollections
&allowedCollections=NSFW
&allowedCollections=NSFW&allowedCollections=SFW
http://conflictapi.com/v1/api/Metadata/allowedCollections
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.
http://conflictapi.com/v1/api/Metadata/allowedSeverity
&allowedSeverity=R
&allowedSeverity=R,PG
http://conflictapi.com/v1/api/Metadata/allowedSeverity
)PG | PG-13 |
R | NC-17 |
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.
&allowedRating=3
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.
&id=2449
&id=2449&id=2448&id=2447
curl -H 'app_id: X' -H 'app_key: Y' -X
GET "http://conflictapi.com/v1/api/Appreciate?id=1,3&MaxRecords=40"
curl -X
GET "http://conflictapi.com/v1/api/Appreciate?app_id=X&app_key=Y&id=1,3&MaxRecords=40"
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)
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)
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()
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()
$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);
$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);
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();
}
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();
}
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);
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);
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");
}
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");
}
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
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:
/v1/api/Metadata/allowedPublishers
http://conflictapi.com/v1/api/Metadata/allowedPublishers?appid=YOUR_ID&_appkey=YOURAPP_KEY&allowedPackages=
'Slapbot,CombatDescriptionCards'
Example: "Conflict Games, MN-Games"
curl -H 'app_id: X' -H 'app_key: Y' -X
GET "http://conflictapi.com/v1/api/Metadata/allowedPublishers"
curl -X
GET "http://conflictapi.com/v1/api/Metadata/allowedPublishers?app_id=X&app_key=Y"
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)
require 'rest-client'
require 'json'
response = RestClient.get "http://conflictapi.com/v1/api/Metadata/allowedPublishers?app_id=X&app_key=Y"
JSON.parse(response)
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()
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()
$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);
$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);
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();
}
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();
}
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);
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);
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");
}
using (WebClient wc = new WebClient())
{
var json = wc.
DownloadString("http://conflictapi.com/v1/api/Metadata/allowedPublishers?app_id=X&app_key=Y");
}
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 |
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.
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.
http://conflictapi.com/v1/api/Metadatasearch?app_id=YOUR_APP_ID&app_key=Your_APP_key&lookup=
allowedPackages
&allowedPackages=Slapbot
&allowedPackages='Slapbot,CombatDescriptionCards'
http://conflictapi.com/v1/api/Metadatasearch?app_id=YOUR_APP_ID&app_key=Your_APP_key&lookup=
allowedPackages
)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.
http://conflictapi.com/v1/api/Metadatasearch?app_id=YOUR_APP_ID&app_key=Your_APP_key&lookup=
allowedproducts
&allowedProducts=Slaps
&allowedProducts=Slapbot,Tonguetwisters
http://conflictapi.com/v1/api/Metadatasearch?app_id=YOUR_APP_ID&app_key=Your_APP_key&lookup=
allowedproducts
)Labyrinth | III Intent | Pain | Piercing |
Character Distinctions | Environments | Expressions | EvilEye |
SuperHero | Humor | Science Fiction | Western |
Slap | TongueTwister | YoMama | Insults |
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).
http://conflictapi.com/v1/api/Metadatasearch?app_id=YOUR_APP_ID&app_key=Your_APP_key&lookup=
allowedCollections
&allowedCollections=Jungles
&allowedCollections=Power,Finesse
http://conflictapi.com/v1/api/Metadatasearch?app_id=YOUR_APP_ID&app_key=Your_APP_key&lookup=
allowedCollections
)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.
http://conflictapi.com/v1/api/Metadatasearch?app_id=YOUR_APP_ID&app_key=Your_APP_key&lookup=
allowedGenre
&allowedGenres=R
allowedGenre=R,PG
http://conflictapi.com/v1/api/slap?app_id=YOUR_ID&app_key=YOUR_APP_KEY&allowedPackages=
slapbot&allowedGenres=Humor,Fantasy
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.
&MaxRecords=10
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.
&q=grilled+cheese
or &q=grilled%20cheese
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.
&id=2428
&id=2428,2429
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'.
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.
&packid=4
to the end point.&packid=3,4
http://conflictapi.com/v1/api/Metadatasearch?app_id=YOUR_APP_ID&app_key=Your_APP_key&lookup=
allowedPackages
)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.
&productId=4
&productidid=1,23
curl -H 'app_id: X' -H 'app_key: Y' -X
GET "http://conflictapi.com/v1/api/tags?id=1,3&activeOnly=false"
curl -X
GET "http://conflictapi.com/v1/api/tags?app_id=X&app_key=Y&id=1,3&activeOnly=false"
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)
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)
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()
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()
$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);
$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);
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();
}
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();
}
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);
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);
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");
}
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");
}
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
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 .
&overReleaseDate=2018-01-01
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.
&MaxRecords=10
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.
&productId=4
&productidid=1,23
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.
http://conflictapi.com/v1/api/Metadata/allowedPublishers
&allowedPublishers=Conflict%20Games
&allowedPublishers=Conflict%20Games&allowedPublishers=MN-Games
http://conflictapi.com/v1/api/Metadata/allowedPublishers
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.
http://conflictapi.com/v1/api/Metadata/allowedPackages
&allowedPackages=Slapbot
&allowedPackages='Slapbot,CombatDescriptionCards'
http://conflictapi.com/v1/api/Metadata/allowedPackages
)curl -H 'app_id: X' -H 'app_key: Y' -X
GET "http://conflictapi.com/v1/api/ProductList?allowedPackages='Slapbot,CombatDescriptionCards'"
curl -X
GET "http://conflictapi.com/v1/api/ProductList?app_id=X&app_key=Y&allowedPackages='Slapbot,CombatDescriptionCards'"
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)
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)
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()
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()
$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);
$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);
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();
}
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();
}
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);
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);
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'");
}
using (WebClient wc = new WebClient())
{
var json = wc.
DownloadString("http://conflictapi.com/v1/api/ProductList?app_id=X&app_key=Y&allowedPackages='Slapbot,CombatDescriptionCards'");
}
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
Name | Description | Type | Additional information |
---|---|---|---|
contentid | a number which uniquely identifies a description. | integer | Required |
ContentEdit | is this string value of the offered suggestion. | string | Required |
SessionID | any value that uniquely identifies in user session | string | |
UserID | User key | string |
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)
&id=111
is this string value of the offered suggestion.
&Contentid=5&contentedit=You%27re+Mamma+is+so+fat%2C+she+jumped+up+in+the+air+and+got+stuck
{
"id": 111,
" contentedit ": "You're Mamma is so fat, she jump up in the air and got stuck",
}
is any value that uniquely identifies a user’s session
&SessionID=0fce6c05939c2a4d9f5c
Unique ID given to a user
&UserID=111
values: "Success" or "Failure"
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"
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"
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)
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)
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()
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()
$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);
$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);
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();
}
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();
}
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);
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);
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");
}
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");
}
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:
indicates a description was displayed to the user and not just retrieve into cache or storage.
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)
&id=111
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.
indicates a user explicitly indicated they liked or disliked a description
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)
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.
is any value that uniquely identifies a user's session
indicates a description was used or processed by the user
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)
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.
is any value that uniquely identifies a user's session.
indicates a description was explicitly marked as a favorite 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)
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.
is any value that uniquely identifies a user’s session
curl -X PUT -H app_id:X -H app_key:Y -d id:111 -d metric:1
"http://conflictapi.com/v1/api/metricslik"
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)
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()
$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);
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();
}
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);
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;
}
Http code | Message | Meaning |
---|---|---|
200OK | Success! | The request has succeeded |
201 Created | created | A new resource was successfully created. |
400Bad Request | An error message | You've made an error in your request (such as passing a string for a parameter that expects a number). |
401 UNAUTHORIZED | Unauthorized | You have not log in with a valid user ID and password. |
403 Forbidden | An error message | You've exceeded the rate limits for your account, or the data you're trying to access is private. |
404 Not Found | An error message | The requested resource could not be found, or the URI doesn't correspond to any known command. |
500 InternalServer Error | An error message | An internal error on our side. If this problem persists, submit a bug report in the bug section of our forums. |
503 Service Unavailable | An error message | The API is down for scheduled maintenance; please try again later (this should be rare!) |
415 unsupported media type | An error message | The message comes when invalid content-type in request body. |
The Endpoint creates a new user. It defines the Email, Password, ConfirmPassword, FullName, Username in the Body parameters.
Parameter | Description |
---|---|
User is required to give unique Email Id | |
Password | Enter password value |
ConfirmPassword | Re-Enter the password given above. |
FullName | Enter your full name |
UserName | Enter a unique username |
URL: POST http://conflictEndpoint.azurewebsites.net/v1/Endpoint/
Account/Register{
"Email": "abcd@gmail.com",
"Password": "asdf@123",
"ConfirmPassword": "asdf@123",
"FullName": "Abcd",
"UserName": "a123"
}
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>
Attribute | Data type | Description |
---|---|---|
Access_token | String | It is a unique value.This token is required as a bearer token header for ChangePassword and Logout endpoints. |
Token_type | String | It 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 | ||
userName | String | It is a unique user id.It is used in other endponts like Register,PasswoedRestToken and UpdatePassword. |
.issued | Datetime | It specified a time when token was created. |
.expires | Datetime | It specifies the duration after which the generated token will expire.The user has to call the Register/Login endpoint again to generate new token. |
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"
}
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"
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)
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()
$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);
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();
}
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);
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;
}
The Endpoint allows the user to log in by giving registered username and password in the Body parameters.
Parameter | Description |
---|---|
UserName | Enter the registered username |
Password | Enter the password corresponding to the registered userName |
URL: POST http://conflictEndpoint.azurewebsites.net/v1/Endpoint/
Account/Login{
"UserName": "sonamag78",
"Password": "sonam@123"
}
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>
Attribute | Data type | Description |
---|---|---|
Access_token | String | It is a unique value.This token is required as a bearer token header for ChangePassword and Logout endpoints. |
Token_type | String | It 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 | ||
userName | String | It is a unique user id.It is used in other endponts like Register,PasswoedRestToken and UpdatePassword. |
.issued | Datetime | It specified a time when token was created. |
.expires | Datetime | It specifies the duration after which the generated token will expire.The user has to call the Register/Login endpoint again to generate new token. |
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"
}
curl -X POST -d "UserName": "a123" -d "Password": "asdf@123"
"http://conflictEndpoint.azurewebsites.net/v1/Endpoint/Account/Login"
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)
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()
$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);
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();
}
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);
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;
}
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.
Empty
URL: POST http://conflictEndpoint.azurewebsites.net/v1/Endpoint/
Account/Logout
Authorization: Bearer [valid token value]
Empty
Empty
200 OK
Empty
curl -X POST -H "Authorization": "Bearer "
"http://conflictEndpoint.azurewebsites.net/v1/Endpoint/Account/Logout"
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)
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()
$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);
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();
}
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);
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;
}
The Endpoint allows the user to log in by giving registered username and password in the Body parameters.
Parameter | Description |
---|---|
oldPassword | Enter the existing password of the registered userName |
NewPassword | Enter the new Password you want to keep. |
ConfirmPassword | Enter the NewPassword value. |
URL: POST http://conflictEndpoint.azurewebsites.net/v1/Endpoint/
Account/ChangePassword{
"OldPassword": "sample@123",
"NewPassword": "sample@1234",
"confirmPassword": "sample@1234"
}
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>
Empty
200 OK
Empty
curl -X POST -d "oldPassword": "sample@1234" -d "NewPassword": "sample@1234" -d "NewPassword": "sample@1234"
"http://conflictEndpoint.azurewebsites.net/v1/Endpoint/Account/ChangePassword"
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)
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()
$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);
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();
}
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);
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;
}
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.
Parameter | Description |
---|---|
userName | Enter the registered userName |
resetToken | Enter the token value generated from PasswordResetToken Endpoint for the corresponding username. |
NewPassword | Enter the new Password value |
ConfirmPassword | Enter the new Password value |
URL: POST http://conflictEndpoint.azurewebsites.net/v1/Endpoint/Account/UpdatePassword
{
"userName": "sonamag78",
"resetToken": "WK8N6",
"newPassword": "sample@123",
"confirmPassword": "sample@123"
}
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>
Attribute | Data type | Description |
---|---|---|
Success | String | It denoates that the valid response is coming form the server. |
200 OK
{
"success": true
}
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"
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)
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()
$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);
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();
}
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);
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;
}
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.
Parameter | Description |
---|---|
UserName | Enter the registered username |
URL: POST http://conflictEndpoint.azurewebsites.net/v1/Endpoint/
Account/PasswordResetToken{
"UserName": "sonamag78",
}
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>
Attribute | Data type | Description |
---|---|---|
Success | String | It denoates that the valid response is coming form the server. |
Token | String | It is a unique value for the corresponding userName.This token value will be used in the request body parameter of the UpdatePassword end point. |
200 OK
{
"success": true,
"token": "WK8N6"
}
curl -X POST -d "UserName": "a123"
"http://conflictEndpoint.azurewebsites.net/v1/Endpoint/Account/PasswordResetToken"
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)
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()
$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);
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();
}
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);
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;
}