સત્તાવાર Agilis Advertising SDK
સાત ભાષાઓ માટે લાઇબ્રેરી. દરેક લાઇબ્રેરી બધા એન્ડપૉઇન્ટ આવરી લે છે, આપની કી AGILIS_API_KEYમાંથી વાંચે છે, સુરક્ષિત રીતે ફરી પ્રયાસ કરે છે, કોઈ પણ રિટર્ન કોડ માટે ભૂલ દર્શાવે છે અને વેબહુક સિગ્નેચર ચકાસે છે.
| ભાષા | પૅકેજ | ઇન્સ્ટૉલ | આવશ્યકતા | સોર્સ અને ચેન્જલૉગ |
|---|---|---|---|---|
| Node.js and TypeScript | @agilisdating/ads (npm) |
npm install @agilisdating/ads |
Node.js 20 or later | સોર્સ · ચેન્જલૉગ |
| Python | agilis-ads (PyPI) |
pip install agilis-ads |
Python 3.10 or later | સોર્સ · ચેન્જલૉગ |
| PHP | agilisdating/agilis-ads (Packagist) |
composer require agilisdating/agilis-ads guzzlehttp/guzzle |
PHP 8.2 or later, with any PSR-18 HTTP client (Guzzle suggested) | સોર્સ · ચેન્જલૉગ |
| .NET (C#) | Agilis.Ads (NuGet) |
dotnet add package Agilis.Ads |
.NET 8 or later, or .NET Standard 2.0; usable from Visual Basic too | સોર્સ · ચેન્જલૉગ |
| Java | dating.agilis:agilis-ads (Maven Central) |
implementation("dating.agilis:agilis-ads:0.1.0") Gradle (Kotlin). With Maven: groupId dating.agilis, artifactId agilis-ads, version 0.1.0. |
Java 17 or later | સોર્સ · ચેન્જલૉગ |
| Go | github.com/agilisdating/agilis-ads-go (pkg.go.dev) |
go get github.com/agilisdating/agilis-ads-go |
Go 1.22 or later | સોર્સ · ચેન્જલૉગ |
| Ruby | agilis-ads (RubyGems) |
gem install agilis-ads |
Ruby 3.2 or later | સોર્સ · ચેન્જલૉગ |
આપની પ્રથમ રિક્વેસ્ટ
Test કી વડે Offer કૅટેગરીની સૂચિ મેળવો. દરેક ઉદાહરણ API રેફરન્સના જ સોર્સમાંથી લેવામાં આવ્યું છે.
Node.js and TypeScript
import { Agilis } from '@agilisdating/ads';
const client = new Agilis(); // reads AGILIS_API_KEY
const result = await client.categories.list();
console.log(result.categories?.length);Python
from agilis_ads import Agilis client = Agilis() # reads AGILIS_API_KEY result = client.categories.list() print(len(result["categories"]))
PHP
<?php require 'vendor/autoload.php'; use Agilis\Ads\AgilisClient; $agilis = new AgilisClient(); // reads AGILIS_API_KEY $result = $agilis->categories->list(); echo count($result['categories']), "\n";
.NET (C#)
using Agilis.Ads; using var client = new AgilisClient(); // reads AGILIS_API_KEY var result = await client.Categories.ListAsync(); Console.WriteLine(result.Categories.Count);
Java
import dating.agilis.ads.AgilisClient; AgilisClient client = AgilisClient.builder().build(); // reads AGILIS_API_KEY var result = client.categories().list(); System.out.println(result.getCategories().size());
Go
package main
import (
"context"
"fmt"
"log"
agilisads "github.com/agilisdating/agilis-ads-go"
)
func main() {
client := agilisads.NewClient("") // reads AGILIS_API_KEY
ctx := context.Background()
result, err := client.Categories.List(ctx)
if err != nil {
log.Fatal(err)
}
fmt.Println(len(result.Categories))
}Ruby
require "agilis_ads" client = AgilisAds::Client.new # reads AGILIS_API_KEY result = client.categories.list puts result.categories.length
વેબહૂક ચકાસો
દરેક SDK એક જ કૉલ વડે Agilis-Signature હેડરને આપના એન્ડપોઇન્ટના સિક્રેટ સાથે ચકાસે છે. કોઈ પણ પાર્સિંગ પહેલાંની, રિક્વેસ્ટની મૂળ (raw) બૉડીનો ઉપયોગ કરો.
Node.js and TypeScript
import { webhooks } from '@agilisdating/ads';
const event = webhooks.constructEvent(rawBody, signatureHeader, secret);Python
from agilis_ads import construct_event event = construct_event(raw_body, signature_header, secret)
PHP
use Agilis\Ads\Webhooks; $event = (new Webhooks())->constructEvent($rawBody, $signatureHeader, $secret);
.NET (C#)
using Agilis.Ads; var webhookEvent = Webhooks.ConstructEvent(rawBody, signatureHeader, secret);
Java
import dating.agilis.ads.Webhooks; var event = Webhooks.constructEvent(rawBody, signatureHeader, secret);
Go
import agilisads "github.com/agilisdating/agilis-ads-go" event, err := agilisads.ConstructEvent(payload, signatureHeader, secret)
Ruby
require "agilis_ads" event = AgilisAds::Webhook.construct_event(raw_body, signature_header, secret)
સમસ્યાનિવારણ
- કી સ્વીકારવામાં આવી નથી: કી અને તેનો મોડ તપાસો; Test કી ફક્ત Test મોડમાં જ કામ કરે છે.
- HTTP 200 સાથેની ભૂલ: SDK તેને તેના રિટર્ન કોડ સાથે ભૂલ તરીકે દર્શાવે છે (ઉદાહરણ તરીકે E3, પૂરતી જમા રકમ નથી).
- ખૂબ વધુ રિક્વેસ્ટ: SDK રાહ જુએ છે અને ફરી પ્રયાસ કરે છે; દરેક કી માટે પ્રતિ મિનિટ 60 થી ઓછી રિક્વેસ્ટ રાખો.
- કંપનીના પ્રોક્સી પાછળ: કેટલાક નેટવર્ક સુરક્ષિત કનેક્શનની તપાસ કરે છે;
ads.agilis.datingને મંજૂરી આપો. - છબી નકારવામાં આવી: છબીઓ પ્રકાશિત થાય તે પહેલાં તપાસવામાં આવે છે; બીજી છબી પસંદ કરો.
