Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $this->client = new \GuzzleHttp\Client([
- 'base_uri' => 'https://api.carrotquest.io',
- 'verify' => false,
- 'http_errors' => false,
- 'decode_content' => true,
- ]);
- $response = $this->client->post('/v1/users/' . $userId . '/props', [
- 'form_params' => [
- 'auth_token' => 'API TOKEN',
- 'by_user_id' => true, // Именно булевое true
- 'operations' => json_encode([
- [
- 'op' => 'update_or_create',
- 'key' => '$name',
- 'value' => $user->getName(),
- ],
- [
- 'op' => 'update_or_create',
- 'key' => '$phone',
- 'value' => $user->getPhone(),
- ],
- [
- 'op' => 'update_or_create',
- 'key' => '$email',
- 'value' => $user->getEmail(),
- ],
- [
- 'op' => 'update_or_create',
- 'key' => '$group',
- 'value' => $user->getGroupName(),
- ],
- ]),
- ]
- ]);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement