Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $api_url = "url";
- $username = "name";
- $password = "hitler";
- $ch = curl_init($api_url);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
- curl_setopt($ch, CURLOPT_HTTPHEADER, [
- 'Content-Type: application/json'
- ]);
- curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
- 'identification' => $username,
- 'password' => $password
- ]));
- $result = curl_exec($ch);
- $session = json_decode($result);
- $session->token;
- $session->userId;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement