Add a favorite
curl --request POST \
--url https://b.anny.co/api/v1/favorites \
--header 'Content-Type: application/vnd.api+json' \
--data '
{
"data": {
"type": "favorites",
"attributes": {
"liked": true,
"recent": false,
"viewed": false,
"model_id": "3049",
"model_type": "resources"
},
"relationships": {}
},
"meta": {}
}
'import requests
url = "https://b.anny.co/api/v1/favorites"
payload = {
"data": {
"type": "favorites",
"attributes": {
"liked": True,
"recent": False,
"viewed": False,
"model_id": "3049",
"model_type": "resources"
},
"relationships": {}
},
"meta": {}
}
headers = {"Content-Type": "application/vnd.api+json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/vnd.api+json'},
body: JSON.stringify({
data: {
type: 'favorites',
attributes: {
liked: true,
recent: false,
viewed: false,
model_id: '3049',
model_type: 'resources'
},
relationships: {}
},
meta: {}
})
};
fetch('https://b.anny.co/api/v1/favorites', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://b.anny.co/api/v1/favorites",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'data' => [
'type' => 'favorites',
'attributes' => [
'liked' => true,
'recent' => false,
'viewed' => false,
'model_id' => '3049',
'model_type' => 'resources'
],
'relationships' => [
]
],
'meta' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/vnd.api+json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://b.anny.co/api/v1/favorites"
payload := strings.NewReader("{\n \"data\": {\n \"type\": \"favorites\",\n \"attributes\": {\n \"liked\": true,\n \"recent\": false,\n \"viewed\": false,\n \"model_id\": \"3049\",\n \"model_type\": \"resources\"\n },\n \"relationships\": {}\n },\n \"meta\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/vnd.api+json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://b.anny.co/api/v1/favorites")
.header("Content-Type", "application/vnd.api+json")
.body("{\n \"data\": {\n \"type\": \"favorites\",\n \"attributes\": {\n \"liked\": true,\n \"recent\": false,\n \"viewed\": false,\n \"model_id\": \"3049\",\n \"model_type\": \"resources\"\n },\n \"relationships\": {}\n },\n \"meta\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://b.anny.co/api/v1/favorites")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/vnd.api+json'
request.body = "{\n \"data\": {\n \"type\": \"favorites\",\n \"attributes\": {\n \"liked\": true,\n \"recent\": false,\n \"viewed\": false,\n \"model_id\": \"3049\",\n \"model_type\": \"resources\"\n },\n \"relationships\": {}\n },\n \"meta\": {}\n}"
response = http.request(request)
puts response.read_body{
"data": {
"type": "favorites",
"id": "a78d9064-76ed-45e2-996a-99628eb757f1",
"attributes": {
"liked": true,
"recent": false,
"viewed": false,
"model_id": "3049",
"model_type": "resources",
"created_at": "2023-04-13T17:10:45+00:00"
},
"relationships": {
"model": {
"links": {
"related": "https://b.staging.anny.co/api/v1/favorites/a78d9064-76ed-45e2-996a-99628eb757f1/model"
}
}
},
"links": {
"self": "https://b.staging.anny.co/api/v1/favorites/a78d9064-76ed-45e2-996a-99628eb757f1"
}
}
}Account
Add a favorite
Create new favorite for model.
POST
/
api
/
v1
/
favorites
Add a favorite
curl --request POST \
--url https://b.anny.co/api/v1/favorites \
--header 'Content-Type: application/vnd.api+json' \
--data '
{
"data": {
"type": "favorites",
"attributes": {
"liked": true,
"recent": false,
"viewed": false,
"model_id": "3049",
"model_type": "resources"
},
"relationships": {}
},
"meta": {}
}
'import requests
url = "https://b.anny.co/api/v1/favorites"
payload = {
"data": {
"type": "favorites",
"attributes": {
"liked": True,
"recent": False,
"viewed": False,
"model_id": "3049",
"model_type": "resources"
},
"relationships": {}
},
"meta": {}
}
headers = {"Content-Type": "application/vnd.api+json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/vnd.api+json'},
body: JSON.stringify({
data: {
type: 'favorites',
attributes: {
liked: true,
recent: false,
viewed: false,
model_id: '3049',
model_type: 'resources'
},
relationships: {}
},
meta: {}
})
};
fetch('https://b.anny.co/api/v1/favorites', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://b.anny.co/api/v1/favorites",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'data' => [
'type' => 'favorites',
'attributes' => [
'liked' => true,
'recent' => false,
'viewed' => false,
'model_id' => '3049',
'model_type' => 'resources'
],
'relationships' => [
]
],
'meta' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/vnd.api+json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://b.anny.co/api/v1/favorites"
payload := strings.NewReader("{\n \"data\": {\n \"type\": \"favorites\",\n \"attributes\": {\n \"liked\": true,\n \"recent\": false,\n \"viewed\": false,\n \"model_id\": \"3049\",\n \"model_type\": \"resources\"\n },\n \"relationships\": {}\n },\n \"meta\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/vnd.api+json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://b.anny.co/api/v1/favorites")
.header("Content-Type", "application/vnd.api+json")
.body("{\n \"data\": {\n \"type\": \"favorites\",\n \"attributes\": {\n \"liked\": true,\n \"recent\": false,\n \"viewed\": false,\n \"model_id\": \"3049\",\n \"model_type\": \"resources\"\n },\n \"relationships\": {}\n },\n \"meta\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://b.anny.co/api/v1/favorites")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/vnd.api+json'
request.body = "{\n \"data\": {\n \"type\": \"favorites\",\n \"attributes\": {\n \"liked\": true,\n \"recent\": false,\n \"viewed\": false,\n \"model_id\": \"3049\",\n \"model_type\": \"resources\"\n },\n \"relationships\": {}\n },\n \"meta\": {}\n}"
response = http.request(request)
puts response.read_body{
"data": {
"type": "favorites",
"id": "a78d9064-76ed-45e2-996a-99628eb757f1",
"attributes": {
"liked": true,
"recent": false,
"viewed": false,
"model_id": "3049",
"model_type": "resources",
"created_at": "2023-04-13T17:10:45+00:00"
},
"relationships": {
"model": {
"links": {
"related": "https://b.staging.anny.co/api/v1/favorites/a78d9064-76ed-45e2-996a-99628eb757f1/model"
}
}
},
"links": {
"self": "https://b.staging.anny.co/api/v1/favorites/a78d9064-76ed-45e2-996a-99628eb757f1"
}
}
}⌘I