L'API RemotePC accetta richieste e restituisce risposte nel formato 'JSON'. Il meccanismo di autenticazione tramite chiave API viene utilizzato insieme all'inserimento in whitelist degli IP per autenticare le API. Per tutte le API, la chiave API deve essere aggiunta nell'intestazione di autorizzazione.
I rivenditori possono inviare le richieste API utilizzando la chiave API generata per il loro account nella console web.
Per ottenere la chiave API:
- Accedi al tuo account RemotePC Reseller.
- Vai alla scheda My Account e fai clic su API Keys.
- Fai clic su View, inserisci la password dell'account e fai clic su View.
- La chiave API verrà visualizzata. Fai clic su Copy Key per copiarla negli appunti.
Per modificare la chiave API, fai clic su Change. Inserisci la password dell'account e fai clic su View per visualizzare la nuova chiave API.
1. Aggiungi utente
URL: https://web1.remotepc.com/rpc-api/reseller/private/user/add
Method-Type: POST
Request headers:
- Authorization: Bearer <api key>
- Content-type: application/json
Richiesta
string firstName;
string lastName;
string invitedUserEmailId;
string password;
integer allotedComputers; //parametro opzionale, il valore predefinito è 0
boolean sendEmailToUser; //la notifica email all'utente è un parametro opzionale
Codici di risposta HTTP
200 (Success)
500 (Server Error)
400 (Invalid Parameters)
401 (Unauthorized)
403 (Invalid request)
Esempio di richiesta
{ "firstName": "firstname", "lastName": "lastname", "invitedUserEmailId": "[email protected]", "password": "password", "allotedComputers": 1, "sendEmailToUser": true }
Esempio di risposta (Successo)
{ "status": "OK", "code": 200, "message": "SUCCESS" }
Esempio di risposta di errore
{ "status": "BAD_REQUEST", "code": 400, "errorsCount": 1, "errors": [{ "description": "EMAIL_EXISTS" }] }
{ "status": "UNAUTHORIZED", "code": 401, "errorsCount": 1, "errors": [{ "description": "NOT_AUTHORIZED" }] }
{ "status": "INTERNAL_SERVER_ERROR", "code": 500, "errorsCount": 1, "errors": [{ "description": "INTERNAL_SERVER_ERROR" }] }
{ "status": "Forbidden", "code": 403, "errorsCount": 1, "errors": [{ "description": "Forbidden" }] }
La descrizione può includere:
- FIRSTNAME_REQUIRED,
- LASTNAME_REQUIRED,
- EMAILID_REQUIRED,
- ENTER_VALID_EMAIL,
- PASSWORD_REQUIRED,
- INVALID_PASSWORD
2. Invita utenti
URL: https://web1.remotepc.com/rpc-api/reseller/private/user/invite
Method-Type: POST
Request headers:
- Authorization: Bearer <api key>
- Content-type: application/json
Richiesta
string invitedUserEmailId;
integer allotedComputers; //parametro opzionale, il valore predefinito è 0
Codici di risposta HTTP
200 (Success)
500 (Server Error)
400 (Invalid Parameters)
401 (Unauthorized)
403 (Invalid request)
Esempio di richiesta
[{ "invitedUserEmailId": "[email protected]", "allotedComputers": 10 }]
Esempio di risposta (Successo)
{ "status": "OK", "code": 200, "message": [{ "username": "[email protected]", "status": "ALREADY_INVITED" }, { "username": "[email protected]", "status": "EXISTS" }, { "username": "[email protected]", "status": "INVITED" }] }
Esempio di risposta di errore
{ "status": "UNAUTHORIZED", "code": 401, "errorsCount": 1, "errors": [{ "description": "NOT_AUTHORIZED" }] }
{ "status": "INTERNAL_SERVER_ERROR", "code": 500, "errorsCount": 1, "errors": [{ "description": "INTERNAL_SERVER_ERROR" }] }
{ "status": "Forbidden", "code": 403, "errorsCount": 1, "errors": [{ "description": "Forbidden" }] }
3. Accesso utente
URL: https://web1.remotepc.com/rpc-api/reseller/private/user/signin
Method-Type: POST
Request headers:
- Authorization: Bearer <api key>
- Content-type: application/json
Richiesta
string username;
string password;
Codici di risposta HTTP
200 (Success)
500 (Server Error)
400 (Invalid Parameters)
401 (Unauthorized)
403 (Invalid request)
Esempio di richiesta
{ "username": "username", "password": "password" }
Esempio di risposta (Successo)
{ "status": "OK", "code": 200, "message": { "rpc_redirect_link": "https://login.remotepc.com/rpcnew/process/autologin/eyJhbGciOiJIUzUxMiJ9" } }
Nota: Utilizzare rpc_redirect_link per accedere automaticamente all'account.
Esempio di risposta di errore
{ "status": "BAD_REQUEST", "code": 400, "errorsCount": 1, "errors": [{ "description": "USERNAME_DOES_NOT_EXIST" }] }
{ "status": "BAD_REQUEST", "code": 400, "errorsCount": 1, "errors": [{ "description": "ACTION_PARENT_ACCOUNT_SUSPENDED" }] }
{ "status": "BAD_REQUEST", "code": 400, "errorsCount": 1, "errors": [{ "description": "IP_ADDRESS_BLOCKED" }] }
{ "status": "BAD_REQUEST", "code": 400, "errorsCount": 1, "errors": [{ "description": "CANCELLED_ACCOUNT" }] }
La descrizione può includere
EMAILID_REQUIRED,
INVALID_EMAIL,
PASSWORD_REQUIRED,
USERNAME_REQUIRED
{ "status": "UNAUTHORIZED", "code": 401, "errorsCount": 1, "errors": [{ "description": "NOT_AUTHORIZED" }] }
{ "status": "INTERNAL_SERVER_ERROR", "code": 500, "errorsCount": 1, "errors": [{ "description": "INTERNAL_SERVER_ERROR" }] }
4. Elenco utenti
URL: https://web1.remotepc.com/rpc-api/reseller/private/user/list
Method-Type: POST
Request headers:
- Authorization: Bearer <api key>
- Content-type: application/json
Codici di risposta HTTP
200 (Success)
500 (Server Error)
401 (Unauthorized)
Esempio di risposta (Successo)
{ "status": "OK", "code": 200, "message": { "resellerUsersList": [{ "alloted_computers": 1, "created_date": "01-13-2023", "isActive": true, "utilized_computers": 0, "username": "[email protected]" }] } }
Esempio di risposta di errore
{ "status": "UNAUTHORIZED", "code": 401, "errorsCount": 1, "errors": [{ "description": "UNAUTHORIZED_ACCESS" }] }
{ "status": "INTERNAL_SERVER_ERROR", "code": 500, "errorsCount": 1, "errors": [{ "description": "INTERNAL_SERVER_ERROR" }] }